diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/application_insights_management_client.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/application_insights_management_client.py index 62b9c2aaf442..200d916f2e80 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/application_insights_management_client.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/application_insights_management_client.py @@ -14,12 +14,20 @@ from msrestazure import AzureConfiguration from .version import VERSION from .operations.operations import Operations -from .operations.components_operations import ComponentsOperations -from .operations.web_tests_operations import WebTestsOperations +from .operations.annotations_operations import AnnotationsOperations +from .operations.api_keys_operations import APIKeysOperations from .operations.export_configurations_operations import ExportConfigurationsOperations from .operations.component_current_billing_features_operations import ComponentCurrentBillingFeaturesOperations from .operations.component_quota_status_operations import ComponentQuotaStatusOperations -from .operations.api_keys_operations import APIKeysOperations +from .operations.component_feature_capabilities_operations import ComponentFeatureCapabilitiesOperations +from .operations.component_available_features_operations import ComponentAvailableFeaturesOperations +from .operations.proactive_detection_configurations_operations import ProactiveDetectionConfigurationsOperations +from .operations.components_operations import ComponentsOperations +from .operations.work_item_configurations_operations import WorkItemConfigurationsOperations +from .operations.favorites_operations import FavoritesOperations +from .operations.favorite_operations import FavoriteOperations +from .operations.web_test_locations_operations import WebTestLocationsOperations +from .operations.web_tests_operations import WebTestsOperations from . import models @@ -33,16 +41,21 @@ class ApplicationInsightsManagementClientConfiguration(AzureConfiguration): object` :param subscription_id: The Azure subscription ID. :type subscription_id: str + :param purge_id: In a purge status request, this is the Id of the + operation the status of which is returned. + :type purge_id: str :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, subscription_id, purge_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 purge_id is None: + raise ValueError("Parameter 'purge_id' must not be None.") if not base_url: base_url = 'https://management.azure.com' @@ -53,6 +66,7 @@ def __init__( self.credentials = credentials self.subscription_id = subscription_id + self.purge_id = purge_id class ApplicationInsightsManagementClient(object): @@ -63,31 +77,50 @@ class ApplicationInsightsManagementClient(object): :ivar operations: Operations operations :vartype operations: azure.mgmt.applicationinsights.operations.Operations - :ivar components: Components operations - :vartype components: azure.mgmt.applicationinsights.operations.ComponentsOperations - :ivar web_tests: WebTests operations - :vartype web_tests: azure.mgmt.applicationinsights.operations.WebTestsOperations + :ivar annotations: Annotations operations + :vartype annotations: azure.mgmt.applicationinsights.operations.AnnotationsOperations + :ivar api_keys: APIKeys operations + :vartype api_keys: azure.mgmt.applicationinsights.operations.APIKeysOperations :ivar export_configurations: ExportConfigurations operations :vartype export_configurations: azure.mgmt.applicationinsights.operations.ExportConfigurationsOperations :ivar component_current_billing_features: ComponentCurrentBillingFeatures operations :vartype component_current_billing_features: azure.mgmt.applicationinsights.operations.ComponentCurrentBillingFeaturesOperations :ivar component_quota_status: ComponentQuotaStatus operations :vartype component_quota_status: azure.mgmt.applicationinsights.operations.ComponentQuotaStatusOperations - :ivar api_keys: APIKeys operations - :vartype api_keys: azure.mgmt.applicationinsights.operations.APIKeysOperations + :ivar component_feature_capabilities: ComponentFeatureCapabilities operations + :vartype component_feature_capabilities: azure.mgmt.applicationinsights.operations.ComponentFeatureCapabilitiesOperations + :ivar component_available_features: ComponentAvailableFeatures operations + :vartype component_available_features: azure.mgmt.applicationinsights.operations.ComponentAvailableFeaturesOperations + :ivar proactive_detection_configurations: ProactiveDetectionConfigurations operations + :vartype proactive_detection_configurations: azure.mgmt.applicationinsights.operations.ProactiveDetectionConfigurationsOperations + :ivar components: Components operations + :vartype components: azure.mgmt.applicationinsights.operations.ComponentsOperations + :ivar work_item_configurations: WorkItemConfigurations operations + :vartype work_item_configurations: azure.mgmt.applicationinsights.operations.WorkItemConfigurationsOperations + :ivar favorites: Favorites operations + :vartype favorites: azure.mgmt.applicationinsights.operations.FavoritesOperations + :ivar favorite: Favorite operations + :vartype favorite: azure.mgmt.applicationinsights.operations.FavoriteOperations + :ivar web_test_locations: WebTestLocations operations + :vartype web_test_locations: azure.mgmt.applicationinsights.operations.WebTestLocationsOperations + :ivar web_tests: WebTests operations + :vartype web_tests: azure.mgmt.applicationinsights.operations.WebTestsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` :param subscription_id: The Azure subscription ID. :type subscription_id: str + :param purge_id: In a purge status request, this is the Id of the + operation the status of which is returned. + :type purge_id: str :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, subscription_id, purge_id, base_url=None): - self.config = ApplicationInsightsManagementClientConfiguration(credentials, subscription_id, base_url) + self.config = ApplicationInsightsManagementClientConfiguration(credentials, subscription_id, purge_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)} @@ -97,9 +130,9 @@ def __init__( self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) - self.components = ComponentsOperations( + self.annotations = AnnotationsOperations( self._client, self.config, self._serialize, self._deserialize) - self.web_tests = WebTestsOperations( + self.api_keys = APIKeysOperations( self._client, self.config, self._serialize, self._deserialize) self.export_configurations = ExportConfigurationsOperations( self._client, self.config, self._serialize, self._deserialize) @@ -107,5 +140,21 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.component_quota_status = ComponentQuotaStatusOperations( self._client, self.config, self._serialize, self._deserialize) - self.api_keys = APIKeysOperations( + self.component_feature_capabilities = ComponentFeatureCapabilitiesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.component_available_features = ComponentAvailableFeaturesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.proactive_detection_configurations = ProactiveDetectionConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.components = ComponentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.work_item_configurations = WorkItemConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.favorites = FavoritesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.favorite = FavoriteOperations( + self._client, self.config, self._serialize, self._deserialize) + self.web_test_locations = WebTestLocationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.web_tests = WebTestsOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/__init__.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/__init__.py index 8318a9567e80..5530b917b28f 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/__init__.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/__init__.py @@ -9,56 +9,136 @@ # regenerated. # -------------------------------------------------------------------------- -from .error_response import ErrorResponse, ErrorResponseException -from .operation_display import OperationDisplay -from .operation import Operation -from .resource import Resource -from .tags_resource import TagsResource -from .application_insights_component import ApplicationInsightsComponent -from .web_test_geolocation import WebTestGeolocation -from .web_test_properties_configuration import WebTestPropertiesConfiguration -from .web_test import WebTest -from .application_insights_component_export_request import ApplicationInsightsComponentExportRequest -from .application_insights_component_export_configuration import ApplicationInsightsComponentExportConfiguration -from .application_insights_component_data_volume_cap import ApplicationInsightsComponentDataVolumeCap -from .application_insights_component_billing_features import ApplicationInsightsComponentBillingFeatures -from .application_insights_component_quota_status import ApplicationInsightsComponentQuotaStatus -from .api_key_request import APIKeyRequest -from .application_insights_component_api_key import ApplicationInsightsComponentAPIKey +try: + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .annotation_py3 import Annotation + from .inner_error_py3 import InnerError + from .annotation_error_py3 import AnnotationError, AnnotationErrorException + from .api_key_request_py3 import APIKeyRequest + from .application_insights_component_api_key_py3 import ApplicationInsightsComponentAPIKey + from .application_insights_component_export_request_py3 import ApplicationInsightsComponentExportRequest + from .application_insights_component_export_configuration_py3 import ApplicationInsightsComponentExportConfiguration + from .application_insights_component_data_volume_cap_py3 import ApplicationInsightsComponentDataVolumeCap + from .application_insights_component_billing_features_py3 import ApplicationInsightsComponentBillingFeatures + from .application_insights_component_quota_status_py3 import ApplicationInsightsComponentQuotaStatus + from .application_insights_component_feature_capabilities_py3 import ApplicationInsightsComponentFeatureCapabilities + from .application_insights_component_feature_capability_py3 import ApplicationInsightsComponentFeatureCapability + from .application_insights_component_feature_py3 import ApplicationInsightsComponentFeature + from .application_insights_component_available_features_py3 import ApplicationInsightsComponentAvailableFeatures + from .application_insights_component_proactive_detection_configuration_rule_definitions_py3 import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + from .application_insights_component_proactive_detection_configuration_py3 import ApplicationInsightsComponentProactiveDetectionConfiguration + from .resource_py3 import Resource + from .tags_resource_py3 import TagsResource + from .application_insights_component_py3 import ApplicationInsightsComponent + from .component_purge_body_filters_py3 import ComponentPurgeBodyFilters + from .component_purge_body_py3 import ComponentPurgeBody + from .component_purge_response_py3 import ComponentPurgeResponse + from .component_purge_status_response_py3 import ComponentPurgeStatusResponse + from .work_item_configuration_py3 import WorkItemConfiguration + from .work_item_create_configuration_py3 import WorkItemCreateConfiguration + from .work_item_configuration_error_py3 import WorkItemConfigurationError, WorkItemConfigurationErrorException + from .application_insights_component_favorite_py3 import ApplicationInsightsComponentFavorite + from .application_insights_component_web_test_location_py3 import ApplicationInsightsComponentWebTestLocation + from .web_test_geolocation_py3 import WebTestGeolocation + from .web_test_properties_configuration_py3 import WebTestPropertiesConfiguration + from .web_test_py3 import WebTest +except (SyntaxError, ImportError): + from .error_response import ErrorResponse, ErrorResponseException + from .operation_display import OperationDisplay + from .operation import Operation + from .annotation import Annotation + from .inner_error import InnerError + from .annotation_error import AnnotationError, AnnotationErrorException + from .api_key_request import APIKeyRequest + from .application_insights_component_api_key import ApplicationInsightsComponentAPIKey + from .application_insights_component_export_request import ApplicationInsightsComponentExportRequest + from .application_insights_component_export_configuration import ApplicationInsightsComponentExportConfiguration + from .application_insights_component_data_volume_cap import ApplicationInsightsComponentDataVolumeCap + from .application_insights_component_billing_features import ApplicationInsightsComponentBillingFeatures + from .application_insights_component_quota_status import ApplicationInsightsComponentQuotaStatus + from .application_insights_component_feature_capabilities import ApplicationInsightsComponentFeatureCapabilities + from .application_insights_component_feature_capability import ApplicationInsightsComponentFeatureCapability + from .application_insights_component_feature import ApplicationInsightsComponentFeature + from .application_insights_component_available_features import ApplicationInsightsComponentAvailableFeatures + from .application_insights_component_proactive_detection_configuration_rule_definitions import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + from .application_insights_component_proactive_detection_configuration import ApplicationInsightsComponentProactiveDetectionConfiguration + from .resource import Resource + from .tags_resource import TagsResource + from .application_insights_component import ApplicationInsightsComponent + from .component_purge_body_filters import ComponentPurgeBodyFilters + from .component_purge_body import ComponentPurgeBody + from .component_purge_response import ComponentPurgeResponse + from .component_purge_status_response import ComponentPurgeStatusResponse + from .work_item_configuration import WorkItemConfiguration + from .work_item_create_configuration import WorkItemCreateConfiguration + from .work_item_configuration_error import WorkItemConfigurationError, WorkItemConfigurationErrorException + from .application_insights_component_favorite import ApplicationInsightsComponentFavorite + from .application_insights_component_web_test_location import ApplicationInsightsComponentWebTestLocation + from .web_test_geolocation import WebTestGeolocation + from .web_test_properties_configuration import WebTestPropertiesConfiguration + from .web_test import WebTest from .operation_paged import OperationPaged +from .application_insights_component_api_key_paged import ApplicationInsightsComponentAPIKeyPaged from .application_insights_component_paged import ApplicationInsightsComponentPaged +from .application_insights_component_web_test_location_paged import ApplicationInsightsComponentWebTestLocationPaged from .web_test_paged import WebTestPaged -from .application_insights_component_api_key_paged import ApplicationInsightsComponentAPIKeyPaged from .application_insights_management_client_enums import ( ApplicationType, FlowType, RequestSource, + PurgeState, + FavoriteType, WebTestKind, + FavoriteSourceType, ) __all__ = [ 'ErrorResponse', 'ErrorResponseException', 'OperationDisplay', 'Operation', + 'Annotation', + 'InnerError', + 'AnnotationError', 'AnnotationErrorException', + 'APIKeyRequest', + 'ApplicationInsightsComponentAPIKey', + 'ApplicationInsightsComponentExportRequest', + 'ApplicationInsightsComponentExportConfiguration', + 'ApplicationInsightsComponentDataVolumeCap', + 'ApplicationInsightsComponentBillingFeatures', + 'ApplicationInsightsComponentQuotaStatus', + 'ApplicationInsightsComponentFeatureCapabilities', + 'ApplicationInsightsComponentFeatureCapability', + 'ApplicationInsightsComponentFeature', + 'ApplicationInsightsComponentAvailableFeatures', + 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions', + 'ApplicationInsightsComponentProactiveDetectionConfiguration', 'Resource', 'TagsResource', 'ApplicationInsightsComponent', + 'ComponentPurgeBodyFilters', + 'ComponentPurgeBody', + 'ComponentPurgeResponse', + 'ComponentPurgeStatusResponse', + 'WorkItemConfiguration', + 'WorkItemCreateConfiguration', + 'WorkItemConfigurationError', 'WorkItemConfigurationErrorException', + 'ApplicationInsightsComponentFavorite', + 'ApplicationInsightsComponentWebTestLocation', 'WebTestGeolocation', 'WebTestPropertiesConfiguration', 'WebTest', - 'ApplicationInsightsComponentExportRequest', - 'ApplicationInsightsComponentExportConfiguration', - 'ApplicationInsightsComponentDataVolumeCap', - 'ApplicationInsightsComponentBillingFeatures', - 'ApplicationInsightsComponentQuotaStatus', - 'APIKeyRequest', - 'ApplicationInsightsComponentAPIKey', 'OperationPaged', + 'ApplicationInsightsComponentAPIKeyPaged', 'ApplicationInsightsComponentPaged', + 'ApplicationInsightsComponentWebTestLocationPaged', 'WebTestPaged', - 'ApplicationInsightsComponentAPIKeyPaged', 'ApplicationType', 'FlowType', 'RequestSource', + 'PurgeState', + 'FavoriteType', 'WebTestKind', + 'FavoriteSourceType', ] diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation.py new file mode 100644 index 000000000000..34b96b0d7660 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Annotation(Model): + """Annotation associated with an application insights resource. + + :param annotation_name: Name of annotation + :type annotation_name: str + :param category: Category of annotation, free form + :type category: str + :param event_time: Time when event occurred + :type event_time: datetime + :param id: Unique Id for annotation + :type id: str + :param properties: Serialized JSON object for detailed properties + :type properties: str + :param related_annotation: Related parent annotation if any. Default + value: "null" . + :type related_annotation: str + """ + + _attribute_map = { + 'annotation_name': {'key': 'AnnotationName', 'type': 'str'}, + 'category': {'key': 'Category', 'type': 'str'}, + 'event_time': {'key': 'EventTime', 'type': 'iso-8601'}, + 'id': {'key': 'Id', 'type': 'str'}, + 'properties': {'key': 'Properties', 'type': 'str'}, + 'related_annotation': {'key': 'RelatedAnnotation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Annotation, self).__init__(**kwargs) + self.annotation_name = kwargs.get('annotation_name', None) + self.category = kwargs.get('category', None) + self.event_time = kwargs.get('event_time', None) + self.id = kwargs.get('id', None) + self.properties = kwargs.get('properties', None) + self.related_annotation = kwargs.get('related_annotation', "null") diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_error.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_error.py new file mode 100644 index 000000000000..b0eb1feb10e2 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_error.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AnnotationError(Model): + """Error associated with trying to create annotation with Id that already + exist. + + :param code: Error detail code and explanation + :type code: str + :param message: Error message + :type message: str + :param innererror: + :type innererror: ~azure.mgmt.applicationinsights.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, **kwargs): + super(AnnotationError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.innererror = kwargs.get('innererror', None) + + +class AnnotationErrorException(HttpOperationError): + """Server responsed with exception of type: 'AnnotationError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(AnnotationErrorException, self).__init__(deserialize, response, 'AnnotationError', *args) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_error_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_error_py3.py new file mode 100644 index 000000000000..81ac3d4340b1 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_error_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AnnotationError(Model): + """Error associated with trying to create annotation with Id that already + exist. + + :param code: Error detail code and explanation + :type code: str + :param message: Error message + :type message: str + :param innererror: + :type innererror: ~azure.mgmt.applicationinsights.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, *, code: str=None, message: str=None, innererror=None, **kwargs) -> None: + super(AnnotationError, self).__init__(**kwargs) + self.code = code + self.message = message + self.innererror = innererror + + +class AnnotationErrorException(HttpOperationError): + """Server responsed with exception of type: 'AnnotationError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(AnnotationErrorException, self).__init__(deserialize, response, 'AnnotationError', *args) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_py3.py new file mode 100644 index 000000000000..f9e84417d725 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/annotation_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Annotation(Model): + """Annotation associated with an application insights resource. + + :param annotation_name: Name of annotation + :type annotation_name: str + :param category: Category of annotation, free form + :type category: str + :param event_time: Time when event occurred + :type event_time: datetime + :param id: Unique Id for annotation + :type id: str + :param properties: Serialized JSON object for detailed properties + :type properties: str + :param related_annotation: Related parent annotation if any. Default + value: "null" . + :type related_annotation: str + """ + + _attribute_map = { + 'annotation_name': {'key': 'AnnotationName', 'type': 'str'}, + 'category': {'key': 'Category', 'type': 'str'}, + 'event_time': {'key': 'EventTime', 'type': 'iso-8601'}, + 'id': {'key': 'Id', 'type': 'str'}, + 'properties': {'key': 'Properties', 'type': 'str'}, + 'related_annotation': {'key': 'RelatedAnnotation', 'type': 'str'}, + } + + def __init__(self, *, annotation_name: str=None, category: str=None, event_time=None, id: str=None, properties: str=None, related_annotation: str="null", **kwargs) -> None: + super(Annotation, self).__init__(**kwargs) + self.annotation_name = annotation_name + self.category = category + self.event_time = event_time + self.id = id + self.properties = properties + self.related_annotation = related_annotation diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request.py index a802d1544b81..8e6ca3e87a6a 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request.py @@ -29,8 +29,8 @@ class APIKeyRequest(Model): 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, } - def __init__(self, name=None, linked_read_properties=None, linked_write_properties=None): - super(APIKeyRequest, self).__init__() - self.name = name - self.linked_read_properties = linked_read_properties - self.linked_write_properties = linked_write_properties + def __init__(self, **kwargs): + super(APIKeyRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.linked_read_properties = kwargs.get('linked_read_properties', None) + self.linked_write_properties = kwargs.get('linked_write_properties', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request_py3.py new file mode 100644 index 000000000000..91309113c606 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/api_key_request_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class APIKeyRequest(Model): + """An Application Insights component API Key createion request definition. + + :param name: The name of the API Key. + :type name: str + :param linked_read_properties: The read access rights of this API Key. + :type linked_read_properties: list[str] + :param linked_write_properties: The write access rights of this API Key. + :type linked_write_properties: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'linked_read_properties': {'key': 'linkedReadProperties', 'type': '[str]'}, + 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, linked_read_properties=None, linked_write_properties=None, **kwargs) -> None: + super(APIKeyRequest, self).__init__(**kwargs) + self.name = name + self.linked_read_properties = linked_read_properties + self.linked_write_properties = linked_write_properties diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component.py index f3c11134bfe0..d9832b688e99 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component.py @@ -18,27 +18,29 @@ class ApplicationInsightsComponent(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Azure resource Id :vartype id: str :ivar name: Azure resource name :vartype name: str :ivar type: Azure resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param kind: The kind of application that this component refers to, used - to customize UI. This value is a freeform string, values should typically - be one of the following: web, ios, other, store, java, phone. + :param kind: Required. The kind of application that this component refers + to, used to customize UI. This value is a freeform string, values should + typically be one of the following: web, ios, other, store, java, phone. :type kind: str :ivar application_id: The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. :vartype application_id: str :ivar app_id: Application Insights Unique ID for your Application. :vartype app_id: str - :param application_type: Type of application being monitored. Possible - values include: 'web', 'other'. Default value: "web" . + :param application_type: Required. Type of application being monitored. + Possible values include: 'web', 'other'. Default value: "web" . :type application_type: str or ~azure.mgmt.applicationinsights.models.ApplicationType :param flow_type: Used by the Application Insights system to determine @@ -115,18 +117,18 @@ class ApplicationInsightsComponent(Resource): 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, } - def __init__(self, location, kind, tags=None, application_type="web", flow_type="Bluefield", request_source="rest", hockey_app_id=None, sampling_percentage=None): - super(ApplicationInsightsComponent, self).__init__(location=location, tags=tags) - self.kind = kind + def __init__(self, **kwargs): + super(ApplicationInsightsComponent, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) self.application_id = None self.app_id = None - self.application_type = application_type - self.flow_type = flow_type - self.request_source = request_source + self.application_type = kwargs.get('application_type', "web") + self.flow_type = kwargs.get('flow_type', "Bluefield") + self.request_source = kwargs.get('request_source', "rest") self.instrumentation_key = None self.creation_date = None self.tenant_id = None - self.hockey_app_id = hockey_app_id + self.hockey_app_id = kwargs.get('hockey_app_id', None) self.hockey_app_token = None self.provisioning_state = None - self.sampling_percentage = sampling_percentage + self.sampling_percentage = kwargs.get('sampling_percentage', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key.py index b5d76a452508..c6488e118773 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key.py @@ -48,11 +48,11 @@ class ApplicationInsightsComponentAPIKey(Model): 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, } - def __init__(self, created_date=None, name=None, linked_read_properties=None, linked_write_properties=None): - super(ApplicationInsightsComponentAPIKey, self).__init__() + def __init__(self, **kwargs): + super(ApplicationInsightsComponentAPIKey, self).__init__(**kwargs) self.id = None self.api_key = None - self.created_date = created_date - self.name = name - self.linked_read_properties = linked_read_properties - self.linked_write_properties = linked_write_properties + self.created_date = kwargs.get('created_date', None) + self.name = kwargs.get('name', None) + self.linked_read_properties = kwargs.get('linked_read_properties', None) + self.linked_write_properties = kwargs.get('linked_write_properties', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key_py3.py new file mode 100644 index 000000000000..95df67902f15 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_api_key_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentAPIKey(Model): + """Properties that define an API key of an Application Insights Component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique ID of the API key inside an Applciation Insights + component. It is auto generated when the API key is created. + :vartype id: str + :ivar api_key: The API key value. It will be only return once when the API + Key was created. + :vartype api_key: str + :param created_date: The create date of this API key. + :type created_date: str + :param name: The name of the API key. + :type name: str + :param linked_read_properties: The read access rights of this API Key. + :type linked_read_properties: list[str] + :param linked_write_properties: The write access rights of this API Key. + :type linked_write_properties: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'api_key': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'api_key': {'key': 'apiKey', 'type': 'str'}, + 'created_date': {'key': 'createdDate', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'linked_read_properties': {'key': 'linkedReadProperties', 'type': '[str]'}, + 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, + } + + def __init__(self, *, created_date: str=None, name: str=None, linked_read_properties=None, linked_write_properties=None, **kwargs) -> None: + super(ApplicationInsightsComponentAPIKey, self).__init__(**kwargs) + self.id = None + self.api_key = None + self.created_date = created_date + self.name = name + self.linked_read_properties = linked_read_properties + self.linked_write_properties = linked_write_properties diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_available_features.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_available_features.py new file mode 100644 index 000000000000..cbf081c200ab --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_available_features.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentAvailableFeatures(Model): + """An Application Insights component available features. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar result: A list of Application Insigths component feature. + :vartype result: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeature] + """ + + _validation = { + 'result': {'readonly': True}, + } + + _attribute_map = { + 'result': {'key': 'Result', 'type': '[ApplicationInsightsComponentFeature]'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentAvailableFeatures, self).__init__(**kwargs) + self.result = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_available_features_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_available_features_py3.py new file mode 100644 index 000000000000..838fbe432265 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_available_features_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentAvailableFeatures(Model): + """An Application Insights component available features. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar result: A list of Application Insigths component feature. + :vartype result: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeature] + """ + + _validation = { + 'result': {'readonly': True}, + } + + _attribute_map = { + 'result': {'key': 'Result', 'type': '[ApplicationInsightsComponentFeature]'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentAvailableFeatures, self).__init__(**kwargs) + self.result = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features.py index c6a653660cda..ff7c3608eacc 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features.py @@ -30,7 +30,7 @@ class ApplicationInsightsComponentBillingFeatures(Model): 'current_billing_features': {'key': 'CurrentBillingFeatures', 'type': '[str]'}, } - def __init__(self, data_volume_cap=None, current_billing_features=None): - super(ApplicationInsightsComponentBillingFeatures, self).__init__() - self.data_volume_cap = data_volume_cap - self.current_billing_features = current_billing_features + def __init__(self, **kwargs): + super(ApplicationInsightsComponentBillingFeatures, self).__init__(**kwargs) + self.data_volume_cap = kwargs.get('data_volume_cap', None) + self.current_billing_features = kwargs.get('current_billing_features', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features_py3.py new file mode 100644 index 000000000000..5bacc6e5a129 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_billing_features_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentBillingFeatures(Model): + """An Application Insights component billing features. + + :param data_volume_cap: An Application Insights component daily data + volumne cap + :type data_volume_cap: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentDataVolumeCap + :param current_billing_features: Current enabled pricing plan. When the + component is in the Enterprise plan, this will list both 'Basic' and + 'Application Insights Enterprise'. + :type current_billing_features: list[str] + """ + + _attribute_map = { + 'data_volume_cap': {'key': 'DataVolumeCap', 'type': 'ApplicationInsightsComponentDataVolumeCap'}, + 'current_billing_features': {'key': 'CurrentBillingFeatures', 'type': '[str]'}, + } + + def __init__(self, *, data_volume_cap=None, current_billing_features=None, **kwargs) -> None: + super(ApplicationInsightsComponentBillingFeatures, self).__init__(**kwargs) + self.data_volume_cap = data_volume_cap + self.current_billing_features = current_billing_features diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap.py index 3fd7a709fc2f..00eeada8ed37 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap.py @@ -49,11 +49,11 @@ class ApplicationInsightsComponentDataVolumeCap(Model): 'max_history_cap': {'key': 'MaxHistoryCap', 'type': 'float'}, } - def __init__(self, cap=None, warning_threshold=None, stop_send_notification_when_hit_threshold=None, stop_send_notification_when_hit_cap=None): - super(ApplicationInsightsComponentDataVolumeCap, self).__init__() - self.cap = cap + def __init__(self, **kwargs): + super(ApplicationInsightsComponentDataVolumeCap, self).__init__(**kwargs) + self.cap = kwargs.get('cap', None) self.reset_time = None - self.warning_threshold = warning_threshold - self.stop_send_notification_when_hit_threshold = stop_send_notification_when_hit_threshold - self.stop_send_notification_when_hit_cap = stop_send_notification_when_hit_cap + self.warning_threshold = kwargs.get('warning_threshold', None) + self.stop_send_notification_when_hit_threshold = kwargs.get('stop_send_notification_when_hit_threshold', None) + self.stop_send_notification_when_hit_cap = kwargs.get('stop_send_notification_when_hit_cap', None) self.max_history_cap = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap_py3.py new file mode 100644 index 000000000000..1d576c282e54 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_data_volume_cap_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentDataVolumeCap(Model): + """An Application Insights component daily data volumne cap. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param cap: Daily data volume cap in GB. + :type cap: float + :ivar reset_time: Daily data volume cap UTC reset hour. + :vartype reset_time: int + :param warning_threshold: Reserved, not used for now. + :type warning_threshold: int + :param stop_send_notification_when_hit_threshold: Reserved, not used for + now. + :type stop_send_notification_when_hit_threshold: bool + :param stop_send_notification_when_hit_cap: Do not send a notification + email when the daily data volume cap is met. + :type stop_send_notification_when_hit_cap: bool + :ivar max_history_cap: Maximum daily data volume cap that the user can set + for this component. + :vartype max_history_cap: float + """ + + _validation = { + 'reset_time': {'readonly': True}, + 'max_history_cap': {'readonly': True}, + } + + _attribute_map = { + 'cap': {'key': 'Cap', 'type': 'float'}, + 'reset_time': {'key': 'ResetTime', 'type': 'int'}, + 'warning_threshold': {'key': 'WarningThreshold', 'type': 'int'}, + 'stop_send_notification_when_hit_threshold': {'key': 'StopSendNotificationWhenHitThreshold', 'type': 'bool'}, + 'stop_send_notification_when_hit_cap': {'key': 'StopSendNotificationWhenHitCap', 'type': 'bool'}, + 'max_history_cap': {'key': 'MaxHistoryCap', 'type': 'float'}, + } + + def __init__(self, *, cap: float=None, warning_threshold: int=None, stop_send_notification_when_hit_threshold: bool=None, stop_send_notification_when_hit_cap: bool=None, **kwargs) -> None: + super(ApplicationInsightsComponentDataVolumeCap, self).__init__(**kwargs) + self.cap = cap + self.reset_time = None + self.warning_threshold = warning_threshold + self.stop_send_notification_when_hit_threshold = stop_send_notification_when_hit_threshold + self.stop_send_notification_when_hit_cap = stop_send_notification_when_hit_cap + self.max_history_cap = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration.py index 33a28500dd76..87cc18b68383 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration.py @@ -119,11 +119,11 @@ class ApplicationInsightsComponentExportConfiguration(Model): 'container_name': {'key': 'ContainerName', 'type': 'str'}, } - def __init__(self, record_types=None, notification_queue_enabled=None): - super(ApplicationInsightsComponentExportConfiguration, self).__init__() + def __init__(self, **kwargs): + super(ApplicationInsightsComponentExportConfiguration, self).__init__(**kwargs) self.export_id = None self.instrumentation_key = None - self.record_types = record_types + self.record_types = kwargs.get('record_types', None) self.application_name = None self.subscription_id = None self.resource_group = None @@ -133,7 +133,7 @@ def __init__(self, record_types=None, notification_queue_enabled=None): self.destination_type = None self.is_user_enabled = None self.last_user_update = None - self.notification_queue_enabled = notification_queue_enabled + self.notification_queue_enabled = kwargs.get('notification_queue_enabled', None) self.export_status = None self.last_success_time = None self.last_gap_time = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration_py3.py new file mode 100644 index 000000000000..272762870348 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_configuration_py3.py @@ -0,0 +1,142 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentExportConfiguration(Model): + """Properties that define a Continuous Export configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar export_id: The unique ID of the export configuration inside an + Applciation Insights component. It is auto generated when the Continuous + Export configuration is created. + :vartype export_id: str + :ivar instrumentation_key: The instrumentation key of the Application + Insights component. + :vartype instrumentation_key: str + :param record_types: This comma separated list of document types that will + be exported. The possible values include 'Requests', 'Event', + 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', + 'PerformanceCounters', 'Availability', 'Messages'. + :type record_types: str + :ivar application_name: The name of the Application Insights component. + :vartype application_name: str + :ivar subscription_id: The subscription of the Application Insights + component. + :vartype subscription_id: str + :ivar resource_group: The resource group of the Application Insights + component. + :vartype resource_group: str + :ivar destination_storage_subscription_id: The destination storage account + subscription ID. + :vartype destination_storage_subscription_id: str + :ivar destination_storage_location_id: The destination account location + ID. + :vartype destination_storage_location_id: str + :ivar destination_account_id: The name of destination account. + :vartype destination_account_id: str + :ivar destination_type: The destination type. + :vartype destination_type: str + :ivar is_user_enabled: This will be 'true' if the Continuous Export + configuration is enabled, otherwise it will be 'false'. + :vartype is_user_enabled: str + :ivar last_user_update: Last time the Continuous Export configuration was + updated. + :vartype last_user_update: str + :param notification_queue_enabled: Deprecated + :type notification_queue_enabled: str + :ivar export_status: This indicates current Continuous Export + configuration status. The possible values are 'Preparing', 'Success', + 'Failure'. + :vartype export_status: str + :ivar last_success_time: The last time data was successfully delivered to + the destination storage container for this Continuous Export + configuration. + :vartype last_success_time: str + :ivar last_gap_time: The last time the Continuous Export configuration + started failing. + :vartype last_gap_time: str + :ivar permanent_error_reason: This is the reason the Continuous Export + configuration started failing. It can be 'AzureStorageNotFound' or + 'AzureStorageAccessDenied'. + :vartype permanent_error_reason: str + :ivar storage_name: The name of the destination storage account. + :vartype storage_name: str + :ivar container_name: The name of the destination storage container. + :vartype container_name: str + """ + + _validation = { + 'export_id': {'readonly': True}, + 'instrumentation_key': {'readonly': True}, + 'application_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'destination_storage_subscription_id': {'readonly': True}, + 'destination_storage_location_id': {'readonly': True}, + 'destination_account_id': {'readonly': True}, + 'destination_type': {'readonly': True}, + 'is_user_enabled': {'readonly': True}, + 'last_user_update': {'readonly': True}, + 'export_status': {'readonly': True}, + 'last_success_time': {'readonly': True}, + 'last_gap_time': {'readonly': True}, + 'permanent_error_reason': {'readonly': True}, + 'storage_name': {'readonly': True}, + 'container_name': {'readonly': True}, + } + + _attribute_map = { + 'export_id': {'key': 'ExportId', 'type': 'str'}, + 'instrumentation_key': {'key': 'InstrumentationKey', 'type': 'str'}, + 'record_types': {'key': 'RecordTypes', 'type': 'str'}, + 'application_name': {'key': 'ApplicationName', 'type': 'str'}, + 'subscription_id': {'key': 'SubscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'ResourceGroup', 'type': 'str'}, + 'destination_storage_subscription_id': {'key': 'DestinationStorageSubscriptionId', 'type': 'str'}, + 'destination_storage_location_id': {'key': 'DestinationStorageLocationId', 'type': 'str'}, + 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, + 'destination_type': {'key': 'DestinationType', 'type': 'str'}, + 'is_user_enabled': {'key': 'IsUserEnabled', 'type': 'str'}, + 'last_user_update': {'key': 'LastUserUpdate', 'type': 'str'}, + 'notification_queue_enabled': {'key': 'NotificationQueueEnabled', 'type': 'str'}, + 'export_status': {'key': 'ExportStatus', 'type': 'str'}, + 'last_success_time': {'key': 'LastSuccessTime', 'type': 'str'}, + 'last_gap_time': {'key': 'LastGapTime', 'type': 'str'}, + 'permanent_error_reason': {'key': 'PermanentErrorReason', 'type': 'str'}, + 'storage_name': {'key': 'StorageName', 'type': 'str'}, + 'container_name': {'key': 'ContainerName', 'type': 'str'}, + } + + def __init__(self, *, record_types: str=None, notification_queue_enabled: str=None, **kwargs) -> None: + super(ApplicationInsightsComponentExportConfiguration, self).__init__(**kwargs) + self.export_id = None + self.instrumentation_key = None + self.record_types = record_types + self.application_name = None + self.subscription_id = None + self.resource_group = None + self.destination_storage_subscription_id = None + self.destination_storage_location_id = None + self.destination_account_id = None + self.destination_type = None + self.is_user_enabled = None + self.last_user_update = None + self.notification_queue_enabled = notification_queue_enabled + self.export_status = None + self.last_success_time = None + self.last_gap_time = None + self.permanent_error_reason = None + self.storage_name = None + self.container_name = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request.py index c35eb10ab564..19e940c75162 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request.py @@ -56,14 +56,14 @@ class ApplicationInsightsComponentExportRequest(Model): 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, } - def __init__(self, record_types=None, destination_type=None, destination_address=None, is_enabled=None, notification_queue_enabled=None, notification_queue_uri=None, destination_storage_subscription_id=None, destination_storage_location_id=None, destination_account_id=None): - super(ApplicationInsightsComponentExportRequest, self).__init__() - self.record_types = record_types - self.destination_type = destination_type - self.destination_address = destination_address - self.is_enabled = is_enabled - self.notification_queue_enabled = notification_queue_enabled - self.notification_queue_uri = notification_queue_uri - self.destination_storage_subscription_id = destination_storage_subscription_id - self.destination_storage_location_id = destination_storage_location_id - self.destination_account_id = destination_account_id + def __init__(self, **kwargs): + super(ApplicationInsightsComponentExportRequest, self).__init__(**kwargs) + self.record_types = kwargs.get('record_types', None) + self.destination_type = kwargs.get('destination_type', None) + self.destination_address = kwargs.get('destination_address', None) + self.is_enabled = kwargs.get('is_enabled', None) + self.notification_queue_enabled = kwargs.get('notification_queue_enabled', None) + self.notification_queue_uri = kwargs.get('notification_queue_uri', None) + self.destination_storage_subscription_id = kwargs.get('destination_storage_subscription_id', None) + self.destination_storage_location_id = kwargs.get('destination_storage_location_id', None) + self.destination_account_id = kwargs.get('destination_account_id', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request_py3.py new file mode 100644 index 000000000000..ecacc3b49a02 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_export_request_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentExportRequest(Model): + """An Application Insights component Continuous Export configuration request + definition. + + :param record_types: The document types to be exported, as comma separated + values. Allowed values include 'Requests', 'Event', 'Exceptions', + 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', + 'PerformanceCounters', 'Availability', 'Messages'. + :type record_types: str + :param destination_type: The Continuous Export destination type. This has + to be 'Blob'. + :type destination_type: str + :param destination_address: The SAS URL for the destination storage + container. It must grant write permission. + :type destination_address: str + :param is_enabled: Set to 'true' to create a Continuous Export + configuration as enabled, otherwise set it to 'false'. + :type is_enabled: str + :param notification_queue_enabled: Deprecated + :type notification_queue_enabled: str + :param notification_queue_uri: Deprecated + :type notification_queue_uri: str + :param destination_storage_subscription_id: The subscription ID of the + destination storage container. + :type destination_storage_subscription_id: str + :param destination_storage_location_id: The location ID of the destination + storage container. + :type destination_storage_location_id: str + :param destination_account_id: The name of destination storage account. + :type destination_account_id: str + """ + + _attribute_map = { + 'record_types': {'key': 'RecordTypes', 'type': 'str'}, + 'destination_type': {'key': 'DestinationType', 'type': 'str'}, + 'destination_address': {'key': 'DestinationAddress', 'type': 'str'}, + 'is_enabled': {'key': 'IsEnabled', 'type': 'str'}, + 'notification_queue_enabled': {'key': 'NotificationQueueEnabled', 'type': 'str'}, + 'notification_queue_uri': {'key': 'NotificationQueueUri', 'type': 'str'}, + 'destination_storage_subscription_id': {'key': 'DestinationStorageSubscriptionId', 'type': 'str'}, + 'destination_storage_location_id': {'key': 'DestinationStorageLocationId', 'type': 'str'}, + 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, + } + + def __init__(self, *, record_types: str=None, destination_type: str=None, destination_address: str=None, is_enabled: str=None, notification_queue_enabled: str=None, notification_queue_uri: str=None, destination_storage_subscription_id: str=None, destination_storage_location_id: str=None, destination_account_id: str=None, **kwargs) -> None: + super(ApplicationInsightsComponentExportRequest, self).__init__(**kwargs) + self.record_types = record_types + self.destination_type = destination_type + self.destination_address = destination_address + self.is_enabled = is_enabled + self.notification_queue_enabled = notification_queue_enabled + self.notification_queue_uri = notification_queue_uri + self.destination_storage_subscription_id = destination_storage_subscription_id + self.destination_storage_location_id = destination_storage_location_id + self.destination_account_id = destination_account_id diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_favorite.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_favorite.py new file mode 100644 index 000000000000..a4e853688245 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_favorite.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFavorite(Model): + """Properties that define a favorite that is associated to an Application + Insights component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The user-defined name of the favorite. + :type name: str + :param config: Configuration of this particular favorite, which are driven + by the Azure portal UX. Configuration data is a string containing valid + JSON + :type config: str + :param version: This instance's version of the data model. This can change + as new features are added that can be marked favorite. Current examples + include MetricsExplorer (ME) and Search. + :type version: str + :ivar favorite_id: Internally assigned unique id of the favorite + definition. + :vartype favorite_id: str + :param favorite_type: Enum indicating if this favorite definition is owned + by a specific user or is shared between all users with access to the + Application Insights component. Possible values include: 'shared', 'user' + :type favorite_type: str or + ~azure.mgmt.applicationinsights.models.FavoriteType + :param source_type: The source of the favorite definition. + :type source_type: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this favorite definition. + :vartype time_modified: str + :param tags: A list of 0 or more tags that are associated with this + favorite definition + :type tags: list[str] + :param category: Favorite category, as defined by the user at creation + time. + :type category: str + :param is_generated_from_template: Flag denoting wether or not this + favorite was generated from a template. + :type is_generated_from_template: bool + :ivar user_id: Unique user id of the specific user that owns this + favorite. + :vartype user_id: str + """ + + _validation = { + 'favorite_id': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'config': {'key': 'Config', 'type': 'str'}, + 'version': {'key': 'Version', 'type': 'str'}, + 'favorite_id': {'key': 'FavoriteId', 'type': 'str'}, + 'favorite_type': {'key': 'FavoriteType', 'type': 'FavoriteType'}, + 'source_type': {'key': 'SourceType', 'type': 'str'}, + 'time_modified': {'key': 'TimeModified', 'type': 'str'}, + 'tags': {'key': 'Tags', 'type': '[str]'}, + 'category': {'key': 'Category', 'type': 'str'}, + 'is_generated_from_template': {'key': 'IsGeneratedFromTemplate', 'type': 'bool'}, + 'user_id': {'key': 'UserId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentFavorite, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.config = kwargs.get('config', None) + self.version = kwargs.get('version', None) + self.favorite_id = None + self.favorite_type = kwargs.get('favorite_type', None) + self.source_type = kwargs.get('source_type', None) + self.time_modified = None + self.tags = kwargs.get('tags', None) + self.category = kwargs.get('category', None) + self.is_generated_from_template = kwargs.get('is_generated_from_template', None) + self.user_id = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_favorite_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_favorite_py3.py new file mode 100644 index 000000000000..e259c7974f11 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_favorite_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFavorite(Model): + """Properties that define a favorite that is associated to an Application + Insights component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The user-defined name of the favorite. + :type name: str + :param config: Configuration of this particular favorite, which are driven + by the Azure portal UX. Configuration data is a string containing valid + JSON + :type config: str + :param version: This instance's version of the data model. This can change + as new features are added that can be marked favorite. Current examples + include MetricsExplorer (ME) and Search. + :type version: str + :ivar favorite_id: Internally assigned unique id of the favorite + definition. + :vartype favorite_id: str + :param favorite_type: Enum indicating if this favorite definition is owned + by a specific user or is shared between all users with access to the + Application Insights component. Possible values include: 'shared', 'user' + :type favorite_type: str or + ~azure.mgmt.applicationinsights.models.FavoriteType + :param source_type: The source of the favorite definition. + :type source_type: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this favorite definition. + :vartype time_modified: str + :param tags: A list of 0 or more tags that are associated with this + favorite definition + :type tags: list[str] + :param category: Favorite category, as defined by the user at creation + time. + :type category: str + :param is_generated_from_template: Flag denoting wether or not this + favorite was generated from a template. + :type is_generated_from_template: bool + :ivar user_id: Unique user id of the specific user that owns this + favorite. + :vartype user_id: str + """ + + _validation = { + 'favorite_id': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'config': {'key': 'Config', 'type': 'str'}, + 'version': {'key': 'Version', 'type': 'str'}, + 'favorite_id': {'key': 'FavoriteId', 'type': 'str'}, + 'favorite_type': {'key': 'FavoriteType', 'type': 'FavoriteType'}, + 'source_type': {'key': 'SourceType', 'type': 'str'}, + 'time_modified': {'key': 'TimeModified', 'type': 'str'}, + 'tags': {'key': 'Tags', 'type': '[str]'}, + 'category': {'key': 'Category', 'type': 'str'}, + 'is_generated_from_template': {'key': 'IsGeneratedFromTemplate', 'type': 'bool'}, + 'user_id': {'key': 'UserId', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, config: str=None, version: str=None, favorite_type=None, source_type: str=None, tags=None, category: str=None, is_generated_from_template: bool=None, **kwargs) -> None: + super(ApplicationInsightsComponentFavorite, self).__init__(**kwargs) + self.name = name + self.config = config + self.version = version + self.favorite_id = None + self.favorite_type = favorite_type + self.source_type = source_type + self.time_modified = None + self.tags = tags + self.category = category + self.is_generated_from_template = is_generated_from_template + self.user_id = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature.py new file mode 100644 index 000000000000..d6c01805851b --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFeature(Model): + """An Application Insights component daily data volume cap status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar feature_name: The pricing feature name. + :vartype feature_name: str + :ivar meter_id: The meter id used for the feature. + :vartype meter_id: str + :ivar meter_rate_frequency: The meter meter rate for the feature's meter. + :vartype meter_rate_frequency: str + :ivar resouce_id: Reserved, not used now. + :vartype resouce_id: str + :ivar is_hidden: Reserved, not used now. + :vartype is_hidden: bool + :ivar capabilities: A list of Application Insigths component feature + capability. + :vartype capabilities: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeatureCapability] + :ivar title: Desplay name of the feature. + :vartype title: str + :ivar is_main_feature: Whether can apply addon feature on to it. + :vartype is_main_feature: bool + :ivar supported_addon_features: The add on features on main feature. + :vartype supported_addon_features: str + """ + + _validation = { + 'feature_name': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_rate_frequency': {'readonly': True}, + 'resouce_id': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'title': {'readonly': True}, + 'is_main_feature': {'readonly': True}, + 'supported_addon_features': {'readonly': True}, + } + + _attribute_map = { + 'feature_name': {'key': 'FeatureName', 'type': 'str'}, + 'meter_id': {'key': 'MeterId', 'type': 'str'}, + 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, + 'resouce_id': {'key': 'ResouceId', 'type': 'str'}, + 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, + 'capabilities': {'key': 'Capabilities', 'type': '[ApplicationInsightsComponentFeatureCapability]'}, + 'title': {'key': 'Title', 'type': 'str'}, + 'is_main_feature': {'key': 'IsMainFeature', 'type': 'bool'}, + 'supported_addon_features': {'key': 'SupportedAddonFeatures', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentFeature, self).__init__(**kwargs) + self.feature_name = None + self.meter_id = None + self.meter_rate_frequency = None + self.resouce_id = None + self.is_hidden = None + self.capabilities = None + self.title = None + self.is_main_feature = None + self.supported_addon_features = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capabilities.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capabilities.py new file mode 100644 index 000000000000..eee1d17a161d --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capabilities.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFeatureCapabilities(Model): + """An Application Insights component feature capabilities. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar support_export_data: Whether allow to use continuous export feature. + :vartype support_export_data: bool + :ivar burst_throttle_policy: Reserved, not used now. + :vartype burst_throttle_policy: str + :ivar metadata_class: Reserved, not used now. + :vartype metadata_class: str + :ivar live_stream_metrics: Reserved, not used now. + :vartype live_stream_metrics: bool + :ivar application_map: Reserved, not used now. + :vartype application_map: bool + :ivar work_item_integration: Whether allow to use work item integration + feature. + :vartype work_item_integration: bool + :ivar power_bi_integration: Reserved, not used now. + :vartype power_bi_integration: bool + :ivar open_schema: Reserved, not used now. + :vartype open_schema: bool + :ivar proactive_detection: Reserved, not used now. + :vartype proactive_detection: bool + :ivar analytics_integration: Reserved, not used now. + :vartype analytics_integration: bool + :ivar multiple_step_web_test: Whether allow to use multiple steps web test + feature. + :vartype multiple_step_web_test: bool + :ivar api_access_level: Reserved, not used now. + :vartype api_access_level: str + :ivar tracking_type: The applciation insights component used tracking + type. + :vartype tracking_type: str + :ivar daily_cap: Daily data volume cap in GB. + :vartype daily_cap: float + :ivar daily_cap_reset_time: Daily data volume cap UTC reset hour. + :vartype daily_cap_reset_time: float + :ivar throttle_rate: Reserved, not used now. + :vartype throttle_rate: float + """ + + _validation = { + 'support_export_data': {'readonly': True}, + 'burst_throttle_policy': {'readonly': True}, + 'metadata_class': {'readonly': True}, + 'live_stream_metrics': {'readonly': True}, + 'application_map': {'readonly': True}, + 'work_item_integration': {'readonly': True}, + 'power_bi_integration': {'readonly': True}, + 'open_schema': {'readonly': True}, + 'proactive_detection': {'readonly': True}, + 'analytics_integration': {'readonly': True}, + 'multiple_step_web_test': {'readonly': True}, + 'api_access_level': {'readonly': True}, + 'tracking_type': {'readonly': True}, + 'daily_cap': {'readonly': True}, + 'daily_cap_reset_time': {'readonly': True}, + 'throttle_rate': {'readonly': True}, + } + + _attribute_map = { + 'support_export_data': {'key': 'SupportExportData', 'type': 'bool'}, + 'burst_throttle_policy': {'key': 'BurstThrottlePolicy', 'type': 'str'}, + 'metadata_class': {'key': 'MetadataClass', 'type': 'str'}, + 'live_stream_metrics': {'key': 'LiveStreamMetrics', 'type': 'bool'}, + 'application_map': {'key': 'ApplicationMap', 'type': 'bool'}, + 'work_item_integration': {'key': 'WorkItemIntegration', 'type': 'bool'}, + 'power_bi_integration': {'key': 'PowerBIIntegration', 'type': 'bool'}, + 'open_schema': {'key': 'OpenSchema', 'type': 'bool'}, + 'proactive_detection': {'key': 'ProactiveDetection', 'type': 'bool'}, + 'analytics_integration': {'key': 'AnalyticsIntegration', 'type': 'bool'}, + 'multiple_step_web_test': {'key': 'MultipleStepWebTest', 'type': 'bool'}, + 'api_access_level': {'key': 'ApiAccessLevel', 'type': 'str'}, + 'tracking_type': {'key': 'TrackingType', 'type': 'str'}, + 'daily_cap': {'key': 'DailyCap', 'type': 'float'}, + 'daily_cap_reset_time': {'key': 'DailyCapResetTime', 'type': 'float'}, + 'throttle_rate': {'key': 'ThrottleRate', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentFeatureCapabilities, self).__init__(**kwargs) + self.support_export_data = None + self.burst_throttle_policy = None + self.metadata_class = None + self.live_stream_metrics = None + self.application_map = None + self.work_item_integration = None + self.power_bi_integration = None + self.open_schema = None + self.proactive_detection = None + self.analytics_integration = None + self.multiple_step_web_test = None + self.api_access_level = None + self.tracking_type = None + self.daily_cap = None + self.daily_cap_reset_time = None + self.throttle_rate = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capabilities_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capabilities_py3.py new file mode 100644 index 000000000000..8287db7a2e95 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capabilities_py3.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFeatureCapabilities(Model): + """An Application Insights component feature capabilities. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar support_export_data: Whether allow to use continuous export feature. + :vartype support_export_data: bool + :ivar burst_throttle_policy: Reserved, not used now. + :vartype burst_throttle_policy: str + :ivar metadata_class: Reserved, not used now. + :vartype metadata_class: str + :ivar live_stream_metrics: Reserved, not used now. + :vartype live_stream_metrics: bool + :ivar application_map: Reserved, not used now. + :vartype application_map: bool + :ivar work_item_integration: Whether allow to use work item integration + feature. + :vartype work_item_integration: bool + :ivar power_bi_integration: Reserved, not used now. + :vartype power_bi_integration: bool + :ivar open_schema: Reserved, not used now. + :vartype open_schema: bool + :ivar proactive_detection: Reserved, not used now. + :vartype proactive_detection: bool + :ivar analytics_integration: Reserved, not used now. + :vartype analytics_integration: bool + :ivar multiple_step_web_test: Whether allow to use multiple steps web test + feature. + :vartype multiple_step_web_test: bool + :ivar api_access_level: Reserved, not used now. + :vartype api_access_level: str + :ivar tracking_type: The applciation insights component used tracking + type. + :vartype tracking_type: str + :ivar daily_cap: Daily data volume cap in GB. + :vartype daily_cap: float + :ivar daily_cap_reset_time: Daily data volume cap UTC reset hour. + :vartype daily_cap_reset_time: float + :ivar throttle_rate: Reserved, not used now. + :vartype throttle_rate: float + """ + + _validation = { + 'support_export_data': {'readonly': True}, + 'burst_throttle_policy': {'readonly': True}, + 'metadata_class': {'readonly': True}, + 'live_stream_metrics': {'readonly': True}, + 'application_map': {'readonly': True}, + 'work_item_integration': {'readonly': True}, + 'power_bi_integration': {'readonly': True}, + 'open_schema': {'readonly': True}, + 'proactive_detection': {'readonly': True}, + 'analytics_integration': {'readonly': True}, + 'multiple_step_web_test': {'readonly': True}, + 'api_access_level': {'readonly': True}, + 'tracking_type': {'readonly': True}, + 'daily_cap': {'readonly': True}, + 'daily_cap_reset_time': {'readonly': True}, + 'throttle_rate': {'readonly': True}, + } + + _attribute_map = { + 'support_export_data': {'key': 'SupportExportData', 'type': 'bool'}, + 'burst_throttle_policy': {'key': 'BurstThrottlePolicy', 'type': 'str'}, + 'metadata_class': {'key': 'MetadataClass', 'type': 'str'}, + 'live_stream_metrics': {'key': 'LiveStreamMetrics', 'type': 'bool'}, + 'application_map': {'key': 'ApplicationMap', 'type': 'bool'}, + 'work_item_integration': {'key': 'WorkItemIntegration', 'type': 'bool'}, + 'power_bi_integration': {'key': 'PowerBIIntegration', 'type': 'bool'}, + 'open_schema': {'key': 'OpenSchema', 'type': 'bool'}, + 'proactive_detection': {'key': 'ProactiveDetection', 'type': 'bool'}, + 'analytics_integration': {'key': 'AnalyticsIntegration', 'type': 'bool'}, + 'multiple_step_web_test': {'key': 'MultipleStepWebTest', 'type': 'bool'}, + 'api_access_level': {'key': 'ApiAccessLevel', 'type': 'str'}, + 'tracking_type': {'key': 'TrackingType', 'type': 'str'}, + 'daily_cap': {'key': 'DailyCap', 'type': 'float'}, + 'daily_cap_reset_time': {'key': 'DailyCapResetTime', 'type': 'float'}, + 'throttle_rate': {'key': 'ThrottleRate', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentFeatureCapabilities, self).__init__(**kwargs) + self.support_export_data = None + self.burst_throttle_policy = None + self.metadata_class = None + self.live_stream_metrics = None + self.application_map = None + self.work_item_integration = None + self.power_bi_integration = None + self.open_schema = None + self.proactive_detection = None + self.analytics_integration = None + self.multiple_step_web_test = None + self.api_access_level = None + self.tracking_type = None + self.daily_cap = None + self.daily_cap_reset_time = None + self.throttle_rate = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capability.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capability.py new file mode 100644 index 000000000000..6bb75e0c4f3a --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capability.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFeatureCapability(Model): + """An Application Insights component feature capability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the capability. + :vartype name: str + :ivar description: The description of the capability. + :vartype description: str + :ivar value: The vaule of the capability. + :vartype value: str + :ivar unit: The unit of the capability. + :vartype unit: str + :ivar meter_id: The meter used for the capability. + :vartype meter_id: str + :ivar meter_rate_frequency: The meter rate of the meter. + :vartype meter_rate_frequency: str + """ + + _validation = { + 'name': {'readonly': True}, + 'description': {'readonly': True}, + 'value': {'readonly': True}, + 'unit': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_rate_frequency': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + 'value': {'key': 'Value', 'type': 'str'}, + 'unit': {'key': 'Unit', 'type': 'str'}, + 'meter_id': {'key': 'MeterId', 'type': 'str'}, + 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentFeatureCapability, self).__init__(**kwargs) + self.name = None + self.description = None + self.value = None + self.unit = None + self.meter_id = None + self.meter_rate_frequency = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capability_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capability_py3.py new file mode 100644 index 000000000000..71bd56316042 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_capability_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFeatureCapability(Model): + """An Application Insights component feature capability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the capability. + :vartype name: str + :ivar description: The description of the capability. + :vartype description: str + :ivar value: The vaule of the capability. + :vartype value: str + :ivar unit: The unit of the capability. + :vartype unit: str + :ivar meter_id: The meter used for the capability. + :vartype meter_id: str + :ivar meter_rate_frequency: The meter rate of the meter. + :vartype meter_rate_frequency: str + """ + + _validation = { + 'name': {'readonly': True}, + 'description': {'readonly': True}, + 'value': {'readonly': True}, + 'unit': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_rate_frequency': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + 'value': {'key': 'Value', 'type': 'str'}, + 'unit': {'key': 'Unit', 'type': 'str'}, + 'meter_id': {'key': 'MeterId', 'type': 'str'}, + 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentFeatureCapability, self).__init__(**kwargs) + self.name = None + self.description = None + self.value = None + self.unit = None + self.meter_id = None + self.meter_rate_frequency = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_py3.py new file mode 100644 index 000000000000..fcad71779a8d --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_feature_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentFeature(Model): + """An Application Insights component daily data volume cap status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar feature_name: The pricing feature name. + :vartype feature_name: str + :ivar meter_id: The meter id used for the feature. + :vartype meter_id: str + :ivar meter_rate_frequency: The meter meter rate for the feature's meter. + :vartype meter_rate_frequency: str + :ivar resouce_id: Reserved, not used now. + :vartype resouce_id: str + :ivar is_hidden: Reserved, not used now. + :vartype is_hidden: bool + :ivar capabilities: A list of Application Insigths component feature + capability. + :vartype capabilities: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeatureCapability] + :ivar title: Desplay name of the feature. + :vartype title: str + :ivar is_main_feature: Whether can apply addon feature on to it. + :vartype is_main_feature: bool + :ivar supported_addon_features: The add on features on main feature. + :vartype supported_addon_features: str + """ + + _validation = { + 'feature_name': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_rate_frequency': {'readonly': True}, + 'resouce_id': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'title': {'readonly': True}, + 'is_main_feature': {'readonly': True}, + 'supported_addon_features': {'readonly': True}, + } + + _attribute_map = { + 'feature_name': {'key': 'FeatureName', 'type': 'str'}, + 'meter_id': {'key': 'MeterId', 'type': 'str'}, + 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, + 'resouce_id': {'key': 'ResouceId', 'type': 'str'}, + 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, + 'capabilities': {'key': 'Capabilities', 'type': '[ApplicationInsightsComponentFeatureCapability]'}, + 'title': {'key': 'Title', 'type': 'str'}, + 'is_main_feature': {'key': 'IsMainFeature', 'type': 'bool'}, + 'supported_addon_features': {'key': 'SupportedAddonFeatures', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentFeature, self).__init__(**kwargs) + self.feature_name = None + self.meter_id = None + self.meter_rate_frequency = None + self.resouce_id = None + self.is_hidden = None + self.capabilities = None + self.title = None + self.is_main_feature = None + self.supported_addon_features = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration.py new file mode 100644 index 000000000000..355e6bf6014a --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentProactiveDetectionConfiguration(Model): + """Properties that define a ProactiveDetection configuration. + + :param name: The rule name + :type name: str + :param enabled: A flag that indicates whether this rule is enabled by the + user + :type enabled: bool + :param send_emails_to_subscription_owners: A flag that indicated whether + notifications on this rule should be sent to subscription owners + :type send_emails_to_subscription_owners: bool + :param custom_emails: Custom email addresses for this rule notifications + :type custom_emails: list[str] + :param last_updated_time: The last time this rule was updated + :type last_updated_time: str + :param rule_definitions: Static definitions of the ProactiveDetection + configuration rule (same values for all components). + :type rule_definitions: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'enabled': {'key': 'Enabled', 'type': 'bool'}, + 'send_emails_to_subscription_owners': {'key': 'SendEmailsToSubscriptionOwners', 'type': 'bool'}, + 'custom_emails': {'key': 'CustomEmails', 'type': '[str]'}, + 'last_updated_time': {'key': 'LastUpdatedTime', 'type': 'str'}, + 'rule_definitions': {'key': 'RuleDefinitions', 'type': 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentProactiveDetectionConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.enabled = kwargs.get('enabled', None) + self.send_emails_to_subscription_owners = kwargs.get('send_emails_to_subscription_owners', None) + self.custom_emails = kwargs.get('custom_emails', None) + self.last_updated_time = kwargs.get('last_updated_time', None) + self.rule_definitions = kwargs.get('rule_definitions', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_py3.py new file mode 100644 index 000000000000..9dd76e067641 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentProactiveDetectionConfiguration(Model): + """Properties that define a ProactiveDetection configuration. + + :param name: The rule name + :type name: str + :param enabled: A flag that indicates whether this rule is enabled by the + user + :type enabled: bool + :param send_emails_to_subscription_owners: A flag that indicated whether + notifications on this rule should be sent to subscription owners + :type send_emails_to_subscription_owners: bool + :param custom_emails: Custom email addresses for this rule notifications + :type custom_emails: list[str] + :param last_updated_time: The last time this rule was updated + :type last_updated_time: str + :param rule_definitions: Static definitions of the ProactiveDetection + configuration rule (same values for all components). + :type rule_definitions: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'enabled': {'key': 'Enabled', 'type': 'bool'}, + 'send_emails_to_subscription_owners': {'key': 'SendEmailsToSubscriptionOwners', 'type': 'bool'}, + 'custom_emails': {'key': 'CustomEmails', 'type': '[str]'}, + 'last_updated_time': {'key': 'LastUpdatedTime', 'type': 'str'}, + 'rule_definitions': {'key': 'RuleDefinitions', 'type': 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions'}, + } + + def __init__(self, *, name: str=None, enabled: bool=None, send_emails_to_subscription_owners: bool=None, custom_emails=None, last_updated_time: str=None, rule_definitions=None, **kwargs) -> None: + super(ApplicationInsightsComponentProactiveDetectionConfiguration, self).__init__(**kwargs) + self.name = name + self.enabled = enabled + self.send_emails_to_subscription_owners = send_emails_to_subscription_owners + self.custom_emails = custom_emails + self.last_updated_time = last_updated_time + self.rule_definitions = rule_definitions diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions.py new file mode 100644 index 000000000000..ec1b4209bafe --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions(Model): + """Static definitions of the ProactiveDetection configuration rule (same + values for all components). + + :param name: The rule name + :type name: str + :param display_name: The rule name as it is displayed in UI + :type display_name: str + :param description: The rule description + :type description: str + :param help_url: URL which displays aditional info about the proactive + detection rule + :type help_url: str + :param is_hidden: A flag indicating whether the rule is hidden (from the + UI) + :type is_hidden: bool + :param is_enabled_by_default: A flag indicating whether the rule is + enabled by default + :type is_enabled_by_default: bool + :param is_in_preview: A flag indicating whether the rule is in preview + :type is_in_preview: bool + :param supports_email_notifications: A flag indicating whether email + notifications are supported for detections for this rule + :type supports_email_notifications: bool + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'display_name': {'key': 'DisplayName', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + 'help_url': {'key': 'HelpUrl', 'type': 'str'}, + 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, + 'is_enabled_by_default': {'key': 'IsEnabledByDefault', 'type': 'bool'}, + 'is_in_preview': {'key': 'IsInPreview', 'type': 'bool'}, + 'supports_email_notifications': {'key': 'SupportsEmailNotifications', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.help_url = kwargs.get('help_url', None) + self.is_hidden = kwargs.get('is_hidden', None) + self.is_enabled_by_default = kwargs.get('is_enabled_by_default', None) + self.is_in_preview = kwargs.get('is_in_preview', None) + self.supports_email_notifications = kwargs.get('supports_email_notifications', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions_py3.py new file mode 100644 index 000000000000..6e5f8302547b --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions(Model): + """Static definitions of the ProactiveDetection configuration rule (same + values for all components). + + :param name: The rule name + :type name: str + :param display_name: The rule name as it is displayed in UI + :type display_name: str + :param description: The rule description + :type description: str + :param help_url: URL which displays aditional info about the proactive + detection rule + :type help_url: str + :param is_hidden: A flag indicating whether the rule is hidden (from the + UI) + :type is_hidden: bool + :param is_enabled_by_default: A flag indicating whether the rule is + enabled by default + :type is_enabled_by_default: bool + :param is_in_preview: A flag indicating whether the rule is in preview + :type is_in_preview: bool + :param supports_email_notifications: A flag indicating whether email + notifications are supported for detections for this rule + :type supports_email_notifications: bool + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'display_name': {'key': 'DisplayName', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + 'help_url': {'key': 'HelpUrl', 'type': 'str'}, + 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, + 'is_enabled_by_default': {'key': 'IsEnabledByDefault', 'type': 'bool'}, + 'is_in_preview': {'key': 'IsInPreview', 'type': 'bool'}, + 'supports_email_notifications': {'key': 'SupportsEmailNotifications', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, description: str=None, help_url: str=None, is_hidden: bool=None, is_enabled_by_default: bool=None, is_in_preview: bool=None, supports_email_notifications: bool=None, **kwargs) -> None: + super(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.description = description + self.help_url = help_url + self.is_hidden = is_hidden + self.is_enabled_by_default = is_enabled_by_default + self.is_in_preview = is_in_preview + self.supports_email_notifications = supports_email_notifications diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_py3.py new file mode 100644 index 000000000000..324ae3df271b --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_py3.py @@ -0,0 +1,134 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationInsightsComponent(Resource): + """An Application Insights component definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. The kind of application that this component refers + to, used to customize UI. This value is a freeform string, values should + typically be one of the following: web, ios, other, store, java, phone. + :type kind: str + :ivar application_id: The unique ID of your application. This field + mirrors the 'Name' field and cannot be changed. + :vartype application_id: str + :ivar app_id: Application Insights Unique ID for your Application. + :vartype app_id: str + :param application_type: Required. Type of application being monitored. + Possible values include: 'web', 'other'. Default value: "web" . + :type application_type: str or + ~azure.mgmt.applicationinsights.models.ApplicationType + :param flow_type: Used by the Application Insights system to determine + what kind of flow this component was created by. This is to be set to + 'Bluefield' when creating/updating a component via the REST API. Possible + values include: 'Bluefield'. Default value: "Bluefield" . + :type flow_type: str or ~azure.mgmt.applicationinsights.models.FlowType + :param request_source: Describes what tool created this Application + Insights component. Customers using this API should set this to the + default 'rest'. Possible values include: 'rest'. Default value: "rest" . + :type request_source: str or + ~azure.mgmt.applicationinsights.models.RequestSource + :ivar instrumentation_key: Application Insights Instrumentation key. A + read-only value that applications can use to identify the destination for + all telemetry sent to Azure Application Insights. This value will be + supplied upon construction of each new Application Insights component. + :vartype instrumentation_key: str + :ivar creation_date: Creation Date for the Application Insights component, + in ISO 8601 format. + :vartype creation_date: datetime + :ivar tenant_id: Azure Tenant Id. + :vartype tenant_id: str + :param hockey_app_id: The unique application ID created when a new + application is added to HockeyApp, used for communications with HockeyApp. + :type hockey_app_id: str + :ivar hockey_app_token: Token used to authenticate communications with + between Application Insights and HockeyApp. + :vartype hockey_app_token: str + :ivar provisioning_state: Current state of this component: whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + :param sampling_percentage: Percentage of the data produced by the + application being monitored that is being sampled for Application Insights + telemetry. + :type sampling_percentage: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'application_id': {'readonly': True}, + 'app_id': {'readonly': True}, + 'application_type': {'required': True}, + 'instrumentation_key': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'hockey_app_token': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, + 'app_id': {'key': 'properties.AppId', 'type': 'str'}, + 'application_type': {'key': 'properties.Application_Type', 'type': 'str'}, + 'flow_type': {'key': 'properties.Flow_Type', 'type': 'str'}, + 'request_source': {'key': 'properties.Request_Source', 'type': 'str'}, + 'instrumentation_key': {'key': 'properties.InstrumentationKey', 'type': 'str'}, + 'creation_date': {'key': 'properties.CreationDate', 'type': 'iso-8601'}, + 'tenant_id': {'key': 'properties.TenantId', 'type': 'str'}, + 'hockey_app_id': {'key': 'properties.HockeyAppId', 'type': 'str'}, + 'hockey_app_token': {'key': 'properties.HockeyAppToken', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, + } + + def __init__(self, *, location: str, kind: str, tags=None, application_type="web", flow_type="Bluefield", request_source="rest", hockey_app_id: str=None, sampling_percentage: float=None, **kwargs) -> None: + super(ApplicationInsightsComponent, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.application_id = None + self.app_id = None + self.application_type = application_type + self.flow_type = flow_type + self.request_source = request_source + self.instrumentation_key = None + self.creation_date = None + self.tenant_id = None + self.hockey_app_id = hockey_app_id + self.hockey_app_token = None + self.provisioning_state = None + self.sampling_percentage = sampling_percentage diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status.py index 6b559a500614..3d9ad05948f1 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status.py @@ -40,8 +40,8 @@ class ApplicationInsightsComponentQuotaStatus(Model): 'expiration_time': {'key': 'ExpirationTime', 'type': 'str'}, } - def __init__(self): - super(ApplicationInsightsComponentQuotaStatus, self).__init__() + def __init__(self, **kwargs): + super(ApplicationInsightsComponentQuotaStatus, self).__init__(**kwargs) self.app_id = None self.should_be_throttled = None self.expiration_time = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status_py3.py new file mode 100644 index 000000000000..19d10c0dd902 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentQuotaStatus(Model): + """An Application Insights component daily data volume cap status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar app_id: The Application ID for the Application Insights component. + :vartype app_id: str + :ivar should_be_throttled: The daily data volume cap is met, and data + ingestion will be stopped. + :vartype should_be_throttled: bool + :ivar expiration_time: Date and time when the daily data volume cap will + be reset, and data ingestion will resume. + :vartype expiration_time: str + """ + + _validation = { + 'app_id': {'readonly': True}, + 'should_be_throttled': {'readonly': True}, + 'expiration_time': {'readonly': True}, + } + + _attribute_map = { + 'app_id': {'key': 'AppId', 'type': 'str'}, + 'should_be_throttled': {'key': 'ShouldBeThrottled', 'type': 'bool'}, + 'expiration_time': {'key': 'ExpirationTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentQuotaStatus, self).__init__(**kwargs) + self.app_id = None + self.should_be_throttled = None + self.expiration_time = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location.py new file mode 100644 index 000000000000..f58dd82e7eb2 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentWebTestLocation(Model): + """Properties that define a web test location available to an Application + Insights Component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar display_name: The display name of the web test location. + :vartype display_name: str + :ivar tag: Internally defined geographic location tag. + :vartype tag: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'tag': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'DisplayName', 'type': 'str'}, + 'tag': {'key': 'Tag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentWebTestLocation, self).__init__(**kwargs) + self.display_name = None + self.tag = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location_paged.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location_paged.py new file mode 100644 index 000000000000..7cfba600f3f5 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ApplicationInsightsComponentWebTestLocationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApplicationInsightsComponentWebTestLocation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApplicationInsightsComponentWebTestLocation]'} + } + + def __init__(self, *args, **kwargs): + + super(ApplicationInsightsComponentWebTestLocationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location_py3.py new file mode 100644 index 000000000000..408b28928111 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_web_test_location_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationInsightsComponentWebTestLocation(Model): + """Properties that define a web test location available to an Application + Insights Component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar display_name: The display name of the web test location. + :vartype display_name: str + :ivar tag: Internally defined geographic location tag. + :vartype tag: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'tag': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'DisplayName', 'type': 'str'}, + 'tag': {'key': 'Tag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentWebTestLocation, self).__init__(**kwargs) + self.display_name = None + self.tag = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_management_client_enums.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_management_client_enums.py index fdb344ca6bf3..441599d39bbb 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_management_client_enums.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_management_client_enums.py @@ -12,23 +12,47 @@ from enum import Enum -class ApplicationType(Enum): +class ApplicationType(str, Enum): web = "web" other = "other" -class FlowType(Enum): +class FlowType(str, Enum): bluefield = "Bluefield" -class RequestSource(Enum): +class RequestSource(str, Enum): rest = "rest" -class WebTestKind(Enum): +class PurgeState(str, Enum): + + pending = "Pending" + completed = "Completed" + + +class FavoriteType(str, Enum): + + shared = "shared" + user = "user" + + +class WebTestKind(str, Enum): ping = "ping" multistep = "multistep" + + +class FavoriteSourceType(str, Enum): + + retention = "retention" + notebook = "notebook" + sessions = "sessions" + events = "events" + userflows = "userflows" + funnel = "funnel" + impact = "impact" + segmentation = "segmentation" diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body.py new file mode 100644 index 000000000000..90a0be9c9bfa --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComponentPurgeBody(Model): + """Describes the body of a purge request for an App Insights component. + + All required parameters must be populated in order to send to Azure. + + :param table: Required. Table from which to purge data. + :type table: str + :param filters: Required. The set of columns and filters (queries) to run + over them to purge the resulting data. + :type filters: + list[~azure.mgmt.applicationinsights.models.ComponentPurgeBodyFilters] + """ + + _validation = { + 'table': {'required': True}, + 'filters': {'required': True}, + } + + _attribute_map = { + 'table': {'key': 'table', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': '[ComponentPurgeBodyFilters]'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeBody, self).__init__(**kwargs) + self.table = kwargs.get('table', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_filters.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_filters.py new file mode 100644 index 000000000000..615331f48856 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_filters.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComponentPurgeBodyFilters(Model): + """User-defined filters to return data which will be purged from the table. + + :param column: The column of the table over which the given query should + run + :type column: str + :param filter: A query to to run over the provided table and column to + purge the corresponding data. + :type filter: str + """ + + _attribute_map = { + 'column': {'key': 'column', 'type': 'str'}, + 'filter': {'key': 'filter', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeBodyFilters, self).__init__(**kwargs) + self.column = kwargs.get('column', None) + self.filter = kwargs.get('filter', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_filters_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_filters_py3.py new file mode 100644 index 000000000000..51e2ef819e02 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_filters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComponentPurgeBodyFilters(Model): + """User-defined filters to return data which will be purged from the table. + + :param column: The column of the table over which the given query should + run + :type column: str + :param filter: A query to to run over the provided table and column to + purge the corresponding data. + :type filter: str + """ + + _attribute_map = { + 'column': {'key': 'column', 'type': 'str'}, + 'filter': {'key': 'filter', 'type': 'str'}, + } + + def __init__(self, *, column: str=None, filter: str=None, **kwargs) -> None: + super(ComponentPurgeBodyFilters, self).__init__(**kwargs) + self.column = column + self.filter = filter diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_py3.py new file mode 100644 index 000000000000..d5dae00d2c93 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_body_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComponentPurgeBody(Model): + """Describes the body of a purge request for an App Insights component. + + All required parameters must be populated in order to send to Azure. + + :param table: Required. Table from which to purge data. + :type table: str + :param filters: Required. The set of columns and filters (queries) to run + over them to purge the resulting data. + :type filters: + list[~azure.mgmt.applicationinsights.models.ComponentPurgeBodyFilters] + """ + + _validation = { + 'table': {'required': True}, + 'filters': {'required': True}, + } + + _attribute_map = { + 'table': {'key': 'table', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': '[ComponentPurgeBodyFilters]'}, + } + + def __init__(self, *, table: str, filters, **kwargs) -> None: + super(ComponentPurgeBody, self).__init__(**kwargs) + self.table = table + self.filters = filters diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_response.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_response.py new file mode 100644 index 000000000000..fda99b2a52fb --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_response.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComponentPurgeResponse(Model): + """Response containing operationId for a specific purge action. + + All required parameters must be populated in order to send to Azure. + + :param operation_id: Required. Id to use when querying for status for a + particular purge operation. + :type operation_id: str + """ + + _validation = { + 'operation_id': {'required': True}, + } + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeResponse, self).__init__(**kwargs) + self.operation_id = kwargs.get('operation_id', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_response_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_response_py3.py new file mode 100644 index 000000000000..4ba086b30add --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_response_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComponentPurgeResponse(Model): + """Response containing operationId for a specific purge action. + + All required parameters must be populated in order to send to Azure. + + :param operation_id: Required. Id to use when querying for status for a + particular purge operation. + :type operation_id: str + """ + + _validation = { + 'operation_id': {'required': True}, + } + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + } + + def __init__(self, *, operation_id: str, **kwargs) -> None: + super(ComponentPurgeResponse, self).__init__(**kwargs) + self.operation_id = operation_id diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_status_response.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_status_response.py new file mode 100644 index 000000000000..085b9fad9a2a --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_status_response.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComponentPurgeStatusResponse(Model): + """Response containing status for a specific purge operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the operation represented by the + requested Id. Possible values include: 'Pending', 'Completed' + :type status: str or ~azure.mgmt.applicationinsights.models.PurgeState + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeStatusResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_status_response_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_status_response_py3.py new file mode 100644 index 000000000000..3e1d2eb8d1d1 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/component_purge_status_response_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ComponentPurgeStatusResponse(Model): + """Response containing status for a specific purge operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the operation represented by the + requested Id. Possible values include: 'Pending', 'Completed' + :type status: str or ~azure.mgmt.applicationinsights.models.PurgeState + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status, **kwargs) -> None: + super(ComponentPurgeStatusResponse, self).__init__(**kwargs) + self.status = status diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response.py index ba4967dac93c..95616531548f 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response.py @@ -28,10 +28,10 @@ class ErrorResponse(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, message=None): - super(ErrorResponse, self).__init__() - self.code = code - self.message = message + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) class ErrorResponseException(HttpOperationError): diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response_py3.py new file mode 100644 index 000000000000..84d6ef4e30f3 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/error_response_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error reponse indicates Insights service is not able to process the + incoming request. The reason is provided in the error message. + + :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 ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error.py new file mode 100644 index 000000000000..c6a045d11a9b --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InnerError(Model): + """Inner error. + + :param diagnosticcontext: Provides correlation for request + :type diagnosticcontext: str + :param time: Request time + :type time: datetime + """ + + _attribute_map = { + 'diagnosticcontext': {'key': 'diagnosticcontext', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(InnerError, self).__init__(**kwargs) + self.diagnosticcontext = kwargs.get('diagnosticcontext', None) + self.time = kwargs.get('time', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error_py3.py new file mode 100644 index 000000000000..3d49c7d88df6 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/inner_error_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InnerError(Model): + """Inner error. + + :param diagnosticcontext: Provides correlation for request + :type diagnosticcontext: str + :param time: Request time + :type time: datetime + """ + + _attribute_map = { + 'diagnosticcontext': {'key': 'diagnosticcontext', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__(self, *, diagnosticcontext: str=None, time=None, **kwargs) -> None: + super(InnerError, self).__init__(**kwargs) + self.diagnosticcontext = diagnosticcontext + self.time = time diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation.py index ff52ee65e1f9..994037f48c03 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation.py @@ -26,7 +26,7 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, name=None, display=None): - super(Operation, self).__init__() - self.name = name - self.display = display + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display.py index 1bd751e13fab..2ff48a6ea9fe 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display.py @@ -30,8 +30,8 @@ class OperationDisplay(Model): 'operation': {'key': 'operation', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display_py3.py new file mode 100644 index 000000000000..5ea914f161e4 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_display_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Cdn + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_py3.py new file mode 100644 index 000000000000..852ec7479e5e --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """CDN REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.applicationinsights.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/resource.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/resource.py index 1552cf70c86d..a081f9d31754 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/resource.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/resource.py @@ -18,13 +18,15 @@ class Resource(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Azure resource Id :vartype id: str :ivar name: Azure resource name :vartype name: str :ivar type: Azure resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -45,10 +47,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/resource_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/resource_py3.py new file mode 100644 index 000000000000..8411fb563e05 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/resource_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource.py index b00182fe1ed6..2c5923e9194b 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource.py @@ -24,6 +24,6 @@ class TagsResource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, tags=None): - super(TagsResource, self).__init__() - self.tags = tags + def __init__(self, **kwargs): + super(TagsResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource_py3.py new file mode 100644 index 000000000000..999720dda2fd --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/tags_resource_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a WebTest instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsResource, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test.py index 103aa8c9c064..2e64f76ea35c 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test.py @@ -18,13 +18,15 @@ class WebTest(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Azure resource Id :vartype id: str :ivar name: Azure resource name :vartype name: str :ivar type: Azure resource type :vartype type: str - :param location: Resource location + :param location: Required. Resource location :type location: str :param tags: Resource tags :type tags: dict[str, str] @@ -32,10 +34,10 @@ class WebTest(Resource): ping and multistep. Possible values include: 'ping', 'multistep'. Default value: "ping" . :type kind: str or ~azure.mgmt.applicationinsights.models.WebTestKind - :param synthetic_monitor_id: Unique ID of this WebTest. This is typically - the same value as the Name field. + :param synthetic_monitor_id: Required. Unique ID of this WebTest. This is + typically the same value as the Name field. :type synthetic_monitor_id: str - :param web_test_name: User defined name if this WebTest. + :param web_test_name: Required. User defined name if this WebTest. :type web_test_name: str :param description: Purpose/user defined descriptive test for this WebTest. @@ -48,15 +50,15 @@ class WebTest(Resource): :param timeout: Seconds until this WebTest will timeout and fail. Default value is 30. Default value: 30 . :type timeout: int - :param web_test_kind: The kind of web test this is, valid choices are ping - and multistep. Possible values include: 'ping', 'multistep'. Default - value: "ping" . + :param web_test_kind: Required. The kind of web test this is, valid + choices are ping and multistep. Possible values include: 'ping', + 'multistep'. Default value: "ping" . :type web_test_kind: str or ~azure.mgmt.applicationinsights.models.WebTestKind :param retry_enabled: Allow for retries should this WebTest fail. :type retry_enabled: bool - :param locations: A list of where to physically run the tests from to give - global coverage for accessibility of your application. + :param locations: Required. A list of where to physically run the tests + from to give global coverage for accessibility of your application. :type locations: list[~azure.mgmt.applicationinsights.models.WebTestGeolocation] :param configuration: An XML configuration specification for a WebTest. @@ -101,17 +103,17 @@ class WebTest(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, location, synthetic_monitor_id, web_test_name, locations, tags=None, kind="ping", description=None, enabled=None, frequency=300, timeout=30, web_test_kind="ping", retry_enabled=None, configuration=None): - super(WebTest, self).__init__(location=location, tags=tags) - self.kind = kind - self.synthetic_monitor_id = synthetic_monitor_id - self.web_test_name = web_test_name - self.description = description - self.enabled = enabled - self.frequency = frequency - self.timeout = timeout - self.web_test_kind = web_test_kind - self.retry_enabled = retry_enabled - self.locations = locations - self.configuration = configuration + def __init__(self, **kwargs): + super(WebTest, self).__init__(**kwargs) + self.kind = kwargs.get('kind', "ping") + self.synthetic_monitor_id = kwargs.get('synthetic_monitor_id', None) + self.web_test_name = kwargs.get('web_test_name', None) + self.description = kwargs.get('description', None) + self.enabled = kwargs.get('enabled', None) + self.frequency = kwargs.get('frequency', 300) + self.timeout = kwargs.get('timeout', 30) + self.web_test_kind = kwargs.get('web_test_kind', "ping") + self.retry_enabled = kwargs.get('retry_enabled', None) + self.locations = kwargs.get('locations', None) + self.configuration = kwargs.get('configuration', None) self.provisioning_state = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation.py index 8c52d9c31b80..c6560922a4e4 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation.py @@ -24,6 +24,6 @@ class WebTestGeolocation(Model): 'location': {'key': 'Id', 'type': 'str'}, } - def __init__(self, location=None): - super(WebTestGeolocation, self).__init__() - self.location = location + def __init__(self, **kwargs): + super(WebTestGeolocation, self).__init__(**kwargs) + self.location = kwargs.get('location', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation_py3.py new file mode 100644 index 000000000000..e3483d9fa678 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_geolocation_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WebTestGeolocation(Model): + """Geo-physical location to run a web test from. You must specify one or more + locations for the test to run from. + + :param location: Location ID for the webtest to run from. + :type location: str + """ + + _attribute_map = { + 'location': {'key': 'Id', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, **kwargs) -> None: + super(WebTestGeolocation, self).__init__(**kwargs) + self.location = location diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration.py index 6ddd1ec152c1..c21de2b8a490 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration.py @@ -24,6 +24,6 @@ class WebTestPropertiesConfiguration(Model): 'web_test': {'key': 'WebTest', 'type': 'str'}, } - def __init__(self, web_test=None): - super(WebTestPropertiesConfiguration, self).__init__() - self.web_test = web_test + def __init__(self, **kwargs): + super(WebTestPropertiesConfiguration, self).__init__(**kwargs) + self.web_test = kwargs.get('web_test', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration_py3.py new file mode 100644 index 000000000000..74e8b47f2c6b --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_properties_configuration_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WebTestPropertiesConfiguration(Model): + """An XML configuration specification for a WebTest. + + :param web_test: The XML specification of a WebTest to run against an + application. + :type web_test: str + """ + + _attribute_map = { + 'web_test': {'key': 'WebTest', 'type': 'str'}, + } + + def __init__(self, *, web_test: str=None, **kwargs) -> None: + super(WebTestPropertiesConfiguration, self).__init__(**kwargs) + self.web_test = web_test diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_py3.py new file mode 100644 index 000000000000..5d457a2e7507 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test_py3.py @@ -0,0 +1,119 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class WebTest(Resource): + """An Application Insights web test definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: The kind of web test that this web test watches. Choices are + ping and multistep. Possible values include: 'ping', 'multistep'. Default + value: "ping" . + :type kind: str or ~azure.mgmt.applicationinsights.models.WebTestKind + :param synthetic_monitor_id: Required. Unique ID of this WebTest. This is + typically the same value as the Name field. + :type synthetic_monitor_id: str + :param web_test_name: Required. User defined name if this WebTest. + :type web_test_name: str + :param description: Purpose/user defined descriptive test for this + WebTest. + :type description: str + :param enabled: Is the test actively being monitored. + :type enabled: bool + :param frequency: Interval in seconds between test runs for this WebTest. + Default value is 300. Default value: 300 . + :type frequency: int + :param timeout: Seconds until this WebTest will timeout and fail. Default + value is 30. Default value: 30 . + :type timeout: int + :param web_test_kind: Required. The kind of web test this is, valid + choices are ping and multistep. Possible values include: 'ping', + 'multistep'. Default value: "ping" . + :type web_test_kind: str or + ~azure.mgmt.applicationinsights.models.WebTestKind + :param retry_enabled: Allow for retries should this WebTest fail. + :type retry_enabled: bool + :param locations: Required. A list of where to physically run the tests + from to give global coverage for accessibility of your application. + :type locations: + list[~azure.mgmt.applicationinsights.models.WebTestGeolocation] + :param configuration: An XML configuration specification for a WebTest. + :type configuration: + ~azure.mgmt.applicationinsights.models.WebTestPropertiesConfiguration + :ivar provisioning_state: Current state of this component, whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'synthetic_monitor_id': {'required': True}, + 'web_test_name': {'required': True}, + 'web_test_kind': {'required': True}, + 'locations': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'WebTestKind'}, + 'synthetic_monitor_id': {'key': 'properties.SyntheticMonitorId', 'type': 'str'}, + 'web_test_name': {'key': 'properties.Name', 'type': 'str'}, + 'description': {'key': 'properties.Description', 'type': 'str'}, + 'enabled': {'key': 'properties.Enabled', 'type': 'bool'}, + 'frequency': {'key': 'properties.Frequency', 'type': 'int'}, + 'timeout': {'key': 'properties.Timeout', 'type': 'int'}, + 'web_test_kind': {'key': 'properties.Kind', 'type': 'WebTestKind'}, + 'retry_enabled': {'key': 'properties.RetryEnabled', 'type': 'bool'}, + 'locations': {'key': 'properties.Locations', 'type': '[WebTestGeolocation]'}, + 'configuration': {'key': 'properties.Configuration', 'type': 'WebTestPropertiesConfiguration'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, synthetic_monitor_id: str, web_test_name: str, locations, tags=None, kind="ping", description: str=None, enabled: bool=None, frequency: int=300, timeout: int=30, web_test_kind="ping", retry_enabled: bool=None, configuration=None, **kwargs) -> None: + super(WebTest, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.synthetic_monitor_id = synthetic_monitor_id + self.web_test_name = web_test_name + self.description = description + self.enabled = enabled + self.frequency = frequency + self.timeout = timeout + self.web_test_kind = web_test_kind + self.retry_enabled = retry_enabled + self.locations = locations + self.configuration = configuration + self.provisioning_state = None diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration.py new file mode 100644 index 000000000000..900129be8297 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WorkItemConfiguration(Model): + """Work item configuration associated with an application insights resource. + + :param connector_id: Connector identifier where work item is created + :type connector_id: str + :param config_display_name: Configuration friendly name + :type config_display_name: str + :param is_default: Boolean value indicating whether configuration is + default + :type is_default: bool + :param id: Unique Id for work item + :type id: str + :param config_properties: Serialized JSON object for detailed properties + :type config_properties: str + """ + + _attribute_map = { + 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, + 'config_display_name': {'key': 'ConfigDisplayName', 'type': 'str'}, + 'is_default': {'key': 'IsDefault', 'type': 'bool'}, + 'id': {'key': 'Id', 'type': 'str'}, + 'config_properties': {'key': 'ConfigProperties', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkItemConfiguration, self).__init__(**kwargs) + self.connector_id = kwargs.get('connector_id', None) + self.config_display_name = kwargs.get('config_display_name', None) + self.is_default = kwargs.get('is_default', None) + self.id = kwargs.get('id', None) + self.config_properties = kwargs.get('config_properties', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error.py new file mode 100644 index 000000000000..5552a22a16cf --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class WorkItemConfigurationError(Model): + """Error associated with trying to get work item configuration or + configurations. + + :param code: Error detail code and explanation + :type code: str + :param message: Error message + :type message: str + :param innererror: + :type innererror: ~azure.mgmt.applicationinsights.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, **kwargs): + super(WorkItemConfigurationError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.innererror = kwargs.get('innererror', None) + + +class WorkItemConfigurationErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkItemConfigurationError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkItemConfigurationErrorException, self).__init__(deserialize, response, 'WorkItemConfigurationError', *args) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error_py3.py new file mode 100644 index 000000000000..dcffcf9da20e --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_error_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class WorkItemConfigurationError(Model): + """Error associated with trying to get work item configuration or + configurations. + + :param code: Error detail code and explanation + :type code: str + :param message: Error message + :type message: str + :param innererror: + :type innererror: ~azure.mgmt.applicationinsights.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, *, code: str=None, message: str=None, innererror=None, **kwargs) -> None: + super(WorkItemConfigurationError, self).__init__(**kwargs) + self.code = code + self.message = message + self.innererror = innererror + + +class WorkItemConfigurationErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkItemConfigurationError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkItemConfigurationErrorException, self).__init__(deserialize, response, 'WorkItemConfigurationError', *args) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_py3.py new file mode 100644 index 000000000000..b0b85fff7ac7 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_configuration_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WorkItemConfiguration(Model): + """Work item configuration associated with an application insights resource. + + :param connector_id: Connector identifier where work item is created + :type connector_id: str + :param config_display_name: Configuration friendly name + :type config_display_name: str + :param is_default: Boolean value indicating whether configuration is + default + :type is_default: bool + :param id: Unique Id for work item + :type id: str + :param config_properties: Serialized JSON object for detailed properties + :type config_properties: str + """ + + _attribute_map = { + 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, + 'config_display_name': {'key': 'ConfigDisplayName', 'type': 'str'}, + 'is_default': {'key': 'IsDefault', 'type': 'bool'}, + 'id': {'key': 'Id', 'type': 'str'}, + 'config_properties': {'key': 'ConfigProperties', 'type': 'str'}, + } + + def __init__(self, *, connector_id: str=None, config_display_name: str=None, is_default: bool=None, id: str=None, config_properties: str=None, **kwargs) -> None: + super(WorkItemConfiguration, self).__init__(**kwargs) + self.connector_id = connector_id + self.config_display_name = config_display_name + self.is_default = is_default + self.id = id + self.config_properties = config_properties diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_create_configuration.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_create_configuration.py new file mode 100644 index 000000000000..5a6716f26147 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_create_configuration.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WorkItemCreateConfiguration(Model): + """Work item configuration creation payload. + + :param connector_id: Unique connector id + :type connector_id: str + :param connector_data_configuration: Serialized JSON object for detaile d + properties + :type connector_data_configuration: str + :param validate_only: Boolean indicating validate only + :type validate_only: bool + :param work_item_properties: Custom work item properties + :type work_item_properties: str + """ + + _attribute_map = { + 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, + 'connector_data_configuration': {'key': 'ConnectorDataConfiguration', 'type': 'str'}, + 'validate_only': {'key': 'ValidateOnly', 'type': 'bool'}, + 'work_item_properties': {'key': 'WorkItemProperties', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkItemCreateConfiguration, self).__init__(**kwargs) + self.connector_id = kwargs.get('connector_id', None) + self.connector_data_configuration = kwargs.get('connector_data_configuration', None) + self.validate_only = kwargs.get('validate_only', None) + self.work_item_properties = kwargs.get('work_item_properties', None) diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_create_configuration_py3.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_create_configuration_py3.py new file mode 100644 index 000000000000..93c72052ff2b --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/work_item_create_configuration_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WorkItemCreateConfiguration(Model): + """Work item configuration creation payload. + + :param connector_id: Unique connector id + :type connector_id: str + :param connector_data_configuration: Serialized JSON object for detaile d + properties + :type connector_data_configuration: str + :param validate_only: Boolean indicating validate only + :type validate_only: bool + :param work_item_properties: Custom work item properties + :type work_item_properties: str + """ + + _attribute_map = { + 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, + 'connector_data_configuration': {'key': 'ConnectorDataConfiguration', 'type': 'str'}, + 'validate_only': {'key': 'ValidateOnly', 'type': 'bool'}, + 'work_item_properties': {'key': 'WorkItemProperties', 'type': 'str'}, + } + + def __init__(self, *, connector_id: str=None, connector_data_configuration: str=None, validate_only: bool=None, work_item_properties: str=None, **kwargs) -> None: + super(WorkItemCreateConfiguration, self).__init__(**kwargs) + self.connector_id = connector_id + self.connector_data_configuration = connector_data_configuration + self.validate_only = validate_only + self.work_item_properties = work_item_properties diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/__init__.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/__init__.py index 7be29002d55c..21a96abfc775 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/__init__.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/__init__.py @@ -10,19 +10,35 @@ # -------------------------------------------------------------------------- from .operations import Operations -from .components_operations import ComponentsOperations -from .web_tests_operations import WebTestsOperations +from .annotations_operations import AnnotationsOperations +from .api_keys_operations import APIKeysOperations from .export_configurations_operations import ExportConfigurationsOperations from .component_current_billing_features_operations import ComponentCurrentBillingFeaturesOperations from .component_quota_status_operations import ComponentQuotaStatusOperations -from .api_keys_operations import APIKeysOperations +from .component_feature_capabilities_operations import ComponentFeatureCapabilitiesOperations +from .component_available_features_operations import ComponentAvailableFeaturesOperations +from .proactive_detection_configurations_operations import ProactiveDetectionConfigurationsOperations +from .components_operations import ComponentsOperations +from .work_item_configurations_operations import WorkItemConfigurationsOperations +from .favorites_operations import FavoritesOperations +from .favorite_operations import FavoriteOperations +from .web_test_locations_operations import WebTestLocationsOperations +from .web_tests_operations import WebTestsOperations __all__ = [ 'Operations', - 'ComponentsOperations', - 'WebTestsOperations', + 'AnnotationsOperations', + 'APIKeysOperations', 'ExportConfigurationsOperations', 'ComponentCurrentBillingFeaturesOperations', 'ComponentQuotaStatusOperations', - 'APIKeysOperations', + 'ComponentFeatureCapabilitiesOperations', + 'ComponentAvailableFeaturesOperations', + 'ProactiveDetectionConfigurationsOperations', + 'ComponentsOperations', + 'WorkItemConfigurationsOperations', + 'FavoritesOperations', + 'FavoriteOperations', + 'WebTestLocationsOperations', + 'WebTestsOperations', ] diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/annotations_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/annotations_operations.py new file mode 100644 index 000000000000..525dc3cdae67 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/annotations_operations.py @@ -0,0 +1,317 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class AnnotationsOperations(object): + """AnnotationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def list( + self, resource_group_name, resource_name, start, end, custom_headers=None, raw=False, **operation_config): + """Gets the list of annotations for a component for given time range. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param start: The start time to query from for annotations, cannot be + older than 90 days from current date. + :type start: str + :param end: The end time to query for annotations. + :type end: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of None + :rtype: list[~azure.mgmt.applicationinsights.models.Annotation][None] + :raises: + :class:`AnnotationErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['start'] = self._serialize.query("start", start, 'str') + query_parameters['end'] = self._serialize.query("end", end, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.AnnotationErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.list(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.list(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations'} + + def create( + self, resource_group_name, resource_name, annotation_properties, custom_headers=None, raw=False, **operation_config): + """Create an Annotation of an Application Insights component. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param annotation_properties: Properties that need to be specified to + create an annotation of a Application Insights component. + :type annotation_properties: + ~azure.mgmt.applicationinsights.models.Annotation + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.applicationinsights.models.Annotation] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`AnnotationErrorException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(annotation_properties, 'Annotation') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.AnnotationErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[Annotation]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations'} + + def delete( + self, resource_group_name, resource_name, annotation_id, custom_headers=None, raw=False, **operation_config): + """Delete an Annotation of an Application Insights component. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param annotation_id: The unique annotation ID. This is unique within + a Application Insights component. + :type annotation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'annotationId': self._serialize.url("annotation_id", annotation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('object', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}'} + + def get( + self, resource_group_name, resource_name, annotation_id, custom_headers=None, raw=False, **operation_config): + """Get the annotation for given id. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param annotation_id: The unique annotation ID. This is unique within + a Application Insights component. + :type annotation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.applicationinsights.models.Annotation] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`AnnotationErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'annotationId': self._serialize.url("annotation_id", annotation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.AnnotationErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[Annotation]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/api_keys_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/api_keys_operations.py index a80e2eddf565..e029b0dd8539 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/api_keys_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/api_keys_operations.py @@ -22,7 +22,7 @@ class APIKeysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-05-01". """ @@ -61,7 +61,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -108,6 +108,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys'} def create( self, resource_group_name, resource_name, api_key_properties, custom_headers=None, raw=False, **operation_config): @@ -135,7 +136,7 @@ def create( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -180,6 +181,7 @@ def create( return client_raw_response return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys'} def delete( self, resource_group_name, resource_name, key_id, custom_headers=None, raw=False, **operation_config): @@ -206,7 +208,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -248,6 +250,7 @@ def delete( return client_raw_response return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}'} def get( self, resource_group_name, resource_name, key_id, custom_headers=None, raw=False, **operation_config): @@ -274,7 +277,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -316,3 +319,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_available_features_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_available_features_operations.py new file mode 100644 index 000000000000..9da5ca195b2a --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_available_features_operations.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ComponentAvailableFeaturesOperations(object): + """ComponentAvailableFeaturesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Returns all available features of the application insights component. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationInsightsComponentAvailableFeatures or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAvailableFeatures + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentAvailableFeatures', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/getavailablebillingfeatures'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_current_billing_features_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_current_billing_features_operations.py index 16cade55aa9c..5287f8cd9d12 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_current_billing_features_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_current_billing_features_operations.py @@ -22,7 +22,7 @@ class ComponentCurrentBillingFeaturesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-05-01". """ @@ -59,7 +59,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -100,6 +100,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures'} def update( self, resource_group_name, resource_name, data_volume_cap=None, current_billing_features=None, custom_headers=None, raw=False, **operation_config): @@ -133,7 +134,7 @@ def update( billing_features_properties = models.ApplicationInsightsComponentBillingFeatures(data_volume_cap=data_volume_cap, current_billing_features=current_billing_features) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -178,3 +179,4 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_feature_capabilities_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_feature_capabilities_operations.py new file mode 100644 index 000000000000..415ef37d960a --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_feature_capabilities_operations.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ComponentFeatureCapabilitiesOperations(object): + """ComponentFeatureCapabilitiesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Returns feature capabilites of the application insights component. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationInsightsComponentFeatureCapabilities or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFeatureCapabilities + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentFeatureCapabilities', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/featurecapabilities'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_quota_status_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_quota_status_operations.py index 13771c68a22a..1f2a66ee7ac8 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_quota_status_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/component_quota_status_operations.py @@ -22,7 +22,7 @@ class ComponentQuotaStatusOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-05-01". """ @@ -60,7 +60,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/quotastatus' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -101,3 +101,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/quotastatus'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/components_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/components_operations.py index a8ed3b023375..a42f8cdce579 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/components_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/components_operations.py @@ -22,7 +22,7 @@ class ComponentsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-05-01". """ @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/microsoft.insights/components' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -101,6 +101,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -122,7 +123,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -168,6 +169,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components'} def delete( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): @@ -188,7 +190,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -222,6 +224,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} def get( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): @@ -244,7 +247,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -285,6 +288,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} def create_or_update( self, resource_group_name, resource_name, insight_properties, custom_headers=None, raw=False, **operation_config): @@ -313,7 +317,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -358,6 +362,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} def update_tags( self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): @@ -385,7 +390,7 @@ def update_tags( component_tags = models.TagsResource(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -430,3 +435,146 @@ def update_tags( return client_raw_response return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} + + def purge( + self, resource_group_name, resource_name, table, filters, custom_headers=None, raw=False, **operation_config): + """Purges data in an Application Insights component by a set of + user-defined filters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param table: Table from which to purge data. + :type table: str + :param filters: The set of columns and filters (queries) to run over + them to purge the resulting data. + :type filters: + list[~azure.mgmt.applicationinsights.models.ComponentPurgeBodyFilters] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ComponentPurgeResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.models.ComponentPurgeResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = models.ComponentPurgeBody(table=table, filters=filters) + + # Construct URL + url = self.purge.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'ComponentPurgeBody') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 202: + deserialized = self._deserialize('ComponentPurgeResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge'} + + def get_purge_status( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets the status of a previously submitted purge using the id returned + from the original purge request. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ComponentPurgeStatusResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ComponentPurgeStatusResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_purge_status.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'purgeId': self._serialize.url("self.config.purge_id", self.config.purge_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ComponentPurgeStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/export_configurations_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/export_configurations_operations.py index 8f5cd9f601e5..5a720636c315 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/export_configurations_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/export_configurations_operations.py @@ -22,7 +22,7 @@ class ExportConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-05-01". """ @@ -59,7 +59,7 @@ def list( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -100,6 +100,7 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration'} def create( self, resource_group_name, resource_name, export_properties, custom_headers=None, raw=False, **operation_config): @@ -128,7 +129,7 @@ def create( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -173,6 +174,7 @@ def create( return client_raw_response return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration'} def delete( self, resource_group_name, resource_name, export_id, custom_headers=None, raw=False, **operation_config): @@ -200,7 +202,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -242,6 +244,7 @@ def delete( return client_raw_response return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} def get( self, resource_group_name, resource_name, export_id, custom_headers=None, raw=False, **operation_config): @@ -268,7 +271,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -310,6 +313,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} def update( self, resource_group_name, resource_name, export_id, export_properties, custom_headers=None, raw=False, **operation_config): @@ -340,7 +344,7 @@ def update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -386,3 +390,4 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/favorite_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/favorite_operations.py new file mode 100644 index 000000000000..05c4e229f79e --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/favorite_operations.py @@ -0,0 +1,323 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class FavoriteOperations(object): + """FavoriteOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def get( + self, resource_group_name, resource_name, favorite_id, custom_headers=None, raw=False, **operation_config): + """Get a single favorite by its FavoriteId, defined within an Application + Insights component. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_id: The Id of a specific favorite defined in the + Application Insights component + :type favorite_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationInsightsComponentFavorite or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFavorite + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentFavorite', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} + + def add( + self, resource_group_name, resource_name, favorite_id, favorite_properties, custom_headers=None, raw=False, **operation_config): + """Adds a new favorites to an Application Insights component. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_id: The Id of a specific favorite defined in the + Application Insights component + :type favorite_id: str + :param favorite_properties: Properties that need to be specified to + create a new favorite and add it to an Application Insights component. + :type favorite_properties: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFavorite + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationInsightsComponentFavorite or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFavorite + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.add.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(favorite_properties, 'ApplicationInsightsComponentFavorite') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentFavorite', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} + + def update( + self, resource_group_name, resource_name, favorite_id, favorite_properties, custom_headers=None, raw=False, **operation_config): + """Updates a favorite that has already been added to an Application + Insights component. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_id: The Id of a specific favorite defined in the + Application Insights component + :type favorite_id: str + :param favorite_properties: Properties that need to be specified to + update the existing favorite. + :type favorite_properties: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFavorite + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationInsightsComponentFavorite or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFavorite + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(favorite_properties, 'ApplicationInsightsComponentFavorite') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentFavorite', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} + + def delete( + self, resource_group_name, resource_name, favorite_id, custom_headers=None, raw=False, **operation_config): + """Remove a favorite that is associated to an Application Insights + component. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_id: The Id of a specific favorite defined in the + Application Insights component + :type favorite_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/favorites_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/favorites_operations.py new file mode 100644 index 000000000000..baebf01c476f --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/favorites_operations.py @@ -0,0 +1,127 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class FavoritesOperations(object): + """FavoritesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def list( + self, resource_group_name, resource_name, favorite_type="shared", source_type=None, can_fetch_content=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of favorites defined within an Application Insights + component. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_type: The type of favorite. Value can be either shared + or user. Possible values include: 'shared', 'user' + :type favorite_type: str or + ~azure.mgmt.applicationinsights.models.FavoriteType + :param source_type: Source type of favorite to return. When left out, + the source type defaults to 'other' (not present in this enum). + Possible values include: 'retention', 'notebook', 'sessions', + 'events', 'userflows', 'funnel', 'impact', 'segmentation' + :type source_type: str or + ~azure.mgmt.applicationinsights.models.FavoriteSourceType + :param can_fetch_content: Flag indicating whether or not to return the + full content for each applicable favorite. If false, only return + summary content for favorites. + :type can_fetch_content: bool + :param tags: Tags that must be present on each favorite returned. + :type tags: list[str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentFavorite] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if favorite_type is not None: + query_parameters['favoriteType'] = self._serialize.query("favorite_type", favorite_type, 'FavoriteType') + if source_type is not None: + query_parameters['sourceType'] = self._serialize.query("source_type", source_type, 'str') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[ApplicationInsightsComponentFavorite]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/operations.py index 8c6c4ab58dec..3a0de7c753dc 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/operations.py @@ -21,7 +21,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-05-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/microsoft.insights/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -94,3 +94,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Insights/operations'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/proactive_detection_configurations_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/proactive_detection_configurations_operations.py new file mode 100644 index 000000000000..94caac7cdc92 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/proactive_detection_configurations_operations.py @@ -0,0 +1,249 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ProactiveDetectionConfigurationsOperations(object): + """ProactiveDetectionConfigurationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of ProactiveDetection configurations of an Application + Insights component. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: + list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfiguration] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('[ApplicationInsightsComponentProactiveDetectionConfiguration]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs'} + + def get( + self, resource_group_name, resource_name, configuration_id, custom_headers=None, raw=False, **operation_config): + """Get the ProactiveDetection configuration for this configuration id. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param configuration_id: The ProactiveDetection configuration ID. This + is unique within a Application Insights component. + :type configuration_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationInsightsComponentProactiveDetectionConfiguration + or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'ConfigurationId': self._serialize.url("configuration_id", configuration_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} + + def update( + self, resource_group_name, resource_name, configuration_id, proactive_detection_properties, custom_headers=None, raw=False, **operation_config): + """Update the ProactiveDetection configuration for this configuration id. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param configuration_id: The ProactiveDetection configuration ID. This + is unique within a Application Insights component. + :type configuration_id: str + :param proactive_detection_properties: Properties that need to be + specified to update the ProactiveDetection configuration. + :type proactive_detection_properties: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfiguration + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationInsightsComponentProactiveDetectionConfiguration + or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'ConfigurationId': self._serialize.url("configuration_id", configuration_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(proactive_detection_properties, 'ApplicationInsightsComponentProactiveDetectionConfiguration') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_test_locations_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_test_locations_operations.py new file mode 100644 index 000000000000..76478325ba14 --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_test_locations_operations.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class WebTestLocationsOperations(object): + """WebTestLocationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of web test locations available to this Application + Insights component. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + ApplicationInsightsComponentWebTestLocation + :rtype: + ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentWebTestLocationPaged[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentWebTestLocation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ApplicationInsightsComponentWebTestLocationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApplicationInsightsComponentWebTestLocationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/syntheticmonitorlocations'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_tests_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_tests_operations.py index 44a6e74d6e24..2274c8838f84 100644 --- a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_tests_operations.py +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/web_tests_operations.py @@ -22,7 +22,7 @@ class WebTestsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client Api Version. Constant value: "2015-05-01". """ @@ -58,7 +58,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -104,6 +104,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests'} def get( self, resource_group_name, web_test_name, custom_headers=None, raw=False, **operation_config): @@ -125,7 +126,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -166,6 +167,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} def create_or_update( self, resource_group_name, web_test_name, web_test_definition, custom_headers=None, raw=False, **operation_config): @@ -191,7 +193,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -236,6 +238,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} def update_tags( self, resource_group_name, web_test_name, tags=None, custom_headers=None, raw=False, **operation_config): @@ -261,7 +264,7 @@ def update_tags( web_test_tags = models.TagsResource(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), @@ -306,6 +309,7 @@ def update_tags( return client_raw_response return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} def delete( self, resource_group_name, web_test_name, custom_headers=None, raw=False, **operation_config): @@ -326,7 +330,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}' + url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -360,6 +364,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -380,7 +385,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/microsoft.insights/webtests' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -425,3 +430,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/webtests'} diff --git a/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/work_item_configurations_operations.py b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/work_item_configurations_operations.py new file mode 100644 index 000000000000..6000e78fca5c --- /dev/null +++ b/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/operations/work_item_configurations_operations.py @@ -0,0 +1,320 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class WorkItemConfigurationsOperations(object): + """WorkItemConfigurationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets the list work item configurations that exist for the application. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of None + :rtype: + list[~azure.mgmt.applicationinsights.models.WorkItemConfiguration][None] + :raises: + :class:`WorkItemConfigurationErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.WorkItemConfigurationErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.list(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.list(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs'} + + def create( + self, resource_group_name, resource_name, work_item_configuration_properties, custom_headers=None, raw=False, **operation_config): + """Create a work item configuration for an Application Insights component. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param work_item_configuration_properties: Properties that need to be + specified to create a work item configuration of a Application + Insights component. + :type work_item_configuration_properties: + ~azure.mgmt.applicationinsights.models.WorkItemCreateConfiguration + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkItemConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.models.WorkItemConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(work_item_configuration_properties, 'WorkItemCreateConfiguration') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkItemConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs'} + + def get_default( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets default work item configurations that exist for the application. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of None + :rtype: + ~azure.mgmt.applicationinsights.models.WorkItemConfiguration[None] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_default.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.WorkItemConfiguration(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.WorkItemConfiguration(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_default.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/DefaultWorkItemConfig'} + + def delete( + self, resource_group_name, resource_name, work_item_config_id, custom_headers=None, raw=False, **operation_config): + """Delete an workitem configuration of an Application Insights component. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param work_item_config_id: The unique work item configuration Id. + This can be either friendly name of connector as defined in connector + configuration + :type work_item_config_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'workItemConfigId': self._serialize.url("work_item_config_id", work_item_config_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('object', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'} diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py b/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py index d3ba61972e2b..7f9dd828fe5a 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/consumption_management_client.py @@ -14,9 +14,12 @@ from msrestazure import AzureConfiguration from .version import VERSION from .operations.usage_details_operations import UsageDetailsOperations +from .operations.marketplaces_operations import MarketplacesOperations from .operations.reservations_summaries_operations import ReservationsSummariesOperations from .operations.reservations_details_operations import ReservationsDetailsOperations +from .operations.budgets_operations import BudgetsOperations from .operations.operations import Operations +from .operations.price_sheet_operations import PriceSheetOperations from . import models @@ -30,16 +33,21 @@ class ConsumptionManagementClientConfiguration(AzureConfiguration): object` :param subscription_id: Azure Subscription ID. :type subscription_id: str + :param grain: Can be daily or monthly. Possible values include: + 'DailyGrain', 'MonthlyGrain' + :type grain: str or ~azure.mgmt.consumption.models.Datagrain :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, subscription_id, grain, 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 grain is None: + raise ValueError("Parameter 'grain' must not be None.") if not base_url: base_url = 'https://management.azure.com' @@ -50,6 +58,7 @@ def __init__( self.credentials = credentials self.subscription_id = subscription_id + self.grain = grain class ConsumptionManagementClient(object): @@ -60,37 +69,52 @@ class ConsumptionManagementClient(object): :ivar usage_details: UsageDetails operations :vartype usage_details: azure.mgmt.consumption.operations.UsageDetailsOperations + :ivar marketplaces: Marketplaces operations + :vartype marketplaces: azure.mgmt.consumption.operations.MarketplacesOperations :ivar reservations_summaries: ReservationsSummaries operations :vartype reservations_summaries: azure.mgmt.consumption.operations.ReservationsSummariesOperations :ivar reservations_details: ReservationsDetails operations :vartype reservations_details: azure.mgmt.consumption.operations.ReservationsDetailsOperations + :ivar budgets: Budgets operations + :vartype budgets: azure.mgmt.consumption.operations.BudgetsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.consumption.operations.Operations + :ivar price_sheet: PriceSheet operations + :vartype price_sheet: azure.mgmt.consumption.operations.PriceSheetOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` :param subscription_id: Azure Subscription ID. :type subscription_id: str + :param grain: Can be daily or monthly. Possible values include: + 'DailyGrain', 'MonthlyGrain' + :type grain: str or ~azure.mgmt.consumption.models.Datagrain :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, subscription_id, grain, base_url=None): - self.config = ConsumptionManagementClientConfiguration(credentials, subscription_id, base_url) + self.config = ConsumptionManagementClientConfiguration(credentials, subscription_id, grain, 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)} - self.api_version = '2017-11-30' + self.api_version = '2018-03-31' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.usage_details = UsageDetailsOperations( self._client, self.config, self._serialize, self._deserialize) + self.marketplaces = MarketplacesOperations( + self._client, self.config, self._serialize, self._deserialize) self.reservations_summaries = ReservationsSummariesOperations( self._client, self.config, self._serialize, self._deserialize) self.reservations_details = ReservationsDetailsOperations( self._client, self.config, self._serialize, self._deserialize) + self.budgets = BudgetsOperations( + self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.price_sheet = PriceSheetOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py index a9917c5cf0e8..a7db9d7b622d 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py @@ -9,36 +9,84 @@ # regenerated. # -------------------------------------------------------------------------- -from .meter_details import MeterDetails -from .usage_detail import UsageDetail -from .reservation_summaries import ReservationSummaries -from .reservation_details import ReservationDetails -from .error_details import ErrorDetails -from .error_response import ErrorResponse, ErrorResponseException -from .operation_display import OperationDisplay -from .operation import Operation -from .resource import Resource +try: + from .meter_details_py3 import MeterDetails + from .usage_detail_py3 import UsageDetail + from .marketplace_py3 import Marketplace + from .reservation_summaries_py3 import ReservationSummaries + from .reservation_details_py3 import ReservationDetails + from .budget_time_period_py3 import BudgetTimePeriod + from .filters_py3 import Filters + from .current_spend_py3 import CurrentSpend + from .notification_py3 import Notification + from .budget_py3 import Budget + from .error_details_py3 import ErrorDetails + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .resource_py3 import Resource + from .proxy_resource_py3 import ProxyResource + from .price_sheet_properties_py3 import PriceSheetProperties + from .price_sheet_result_py3 import PriceSheetResult +except (SyntaxError, ImportError): + from .meter_details import MeterDetails + from .usage_detail import UsageDetail + from .marketplace import Marketplace + from .reservation_summaries import ReservationSummaries + from .reservation_details import ReservationDetails + from .budget_time_period import BudgetTimePeriod + from .filters import Filters + from .current_spend import CurrentSpend + from .notification import Notification + from .budget import Budget + from .error_details import ErrorDetails + from .error_response import ErrorResponse, ErrorResponseException + from .operation_display import OperationDisplay + from .operation import Operation + from .resource import Resource + from .proxy_resource import ProxyResource + from .price_sheet_properties import PriceSheetProperties + from .price_sheet_result import PriceSheetResult from .usage_detail_paged import UsageDetailPaged +from .marketplace_paged import MarketplacePaged from .reservation_summaries_paged import ReservationSummariesPaged from .reservation_details_paged import ReservationDetailsPaged +from .budget_paged import BudgetPaged from .operation_paged import OperationPaged from .consumption_management_client_enums import ( + CategoryType, + TimeGrainType, + OperatorType, Datagrain, ) __all__ = [ 'MeterDetails', 'UsageDetail', + 'Marketplace', 'ReservationSummaries', 'ReservationDetails', + 'BudgetTimePeriod', + 'Filters', + 'CurrentSpend', + 'Notification', + 'Budget', 'ErrorDetails', 'ErrorResponse', 'ErrorResponseException', 'OperationDisplay', 'Operation', 'Resource', + 'ProxyResource', + 'PriceSheetProperties', + 'PriceSheetResult', 'UsageDetailPaged', + 'MarketplacePaged', 'ReservationSummariesPaged', 'ReservationDetailsPaged', + 'BudgetPaged', 'OperationPaged', + 'CategoryType', + 'TimeGrainType', + 'OperatorType', 'Datagrain', ] diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py new file mode 100644 index 000000000000..ee78757dabc9 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/budget.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class Budget(ProxyResource): + """A budget resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param e_tag: eTag of the resource. To handle concurrent update scenarion, + this field will be used to determine whether the user is updating the + latest version or not. + :type e_tag: str + :param category: Required. The category of the budget, whether the budget + tracks cost or usage. Possible values include: 'Cost', 'Usage' + :type category: str or ~azure.mgmt.consumption.models.CategoryType + :param amount: Required. The total amount of cost to track with the budget + :type amount: decimal.Decimal + :param time_grain: Required. The time covered by a budget. Tracking of the + amount will be reset based on the time grain. Possible values include: + 'Monthly', 'Quarterly', 'Annually' + :type time_grain: str or ~azure.mgmt.consumption.models.TimeGrainType + :param time_period: Required. Has start and end date of the budget. The + start date must be first of the month and should be less than the end + date. Budget start date must be on or after June 1, 2017. Future start + date should not be more than three months. Past start date should be + selected within the timegrain preiod. There are no restrictions on the end + date. + :type time_period: ~azure.mgmt.consumption.models.BudgetTimePeriod + :param filters: May be used to filter budgets by resource group, resource, + or meter. + :type filters: ~azure.mgmt.consumption.models.Filters + :ivar current_spend: The current amount of cost which is being tracked for + a budget. + :vartype current_spend: ~azure.mgmt.consumption.models.CurrentSpend + :param notifications: Dictionary of notifications associated with the + budget. Budget can have up to five notifications. + :type notifications: dict[str, + ~azure.mgmt.consumption.models.Notification] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'category': {'required': True}, + 'amount': {'required': True}, + 'time_grain': {'required': True}, + 'time_period': {'required': True}, + 'current_spend': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'amount': {'key': 'properties.amount', 'type': 'decimal'}, + 'time_grain': {'key': 'properties.timeGrain', 'type': 'str'}, + 'time_period': {'key': 'properties.timePeriod', 'type': 'BudgetTimePeriod'}, + 'filters': {'key': 'properties.filters', 'type': 'Filters'}, + 'current_spend': {'key': 'properties.currentSpend', 'type': 'CurrentSpend'}, + 'notifications': {'key': 'properties.notifications', 'type': '{Notification}'}, + } + + def __init__(self, **kwargs): + super(Budget, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.amount = kwargs.get('amount', None) + self.time_grain = kwargs.get('time_grain', None) + self.time_period = kwargs.get('time_period', None) + self.filters = kwargs.get('filters', None) + self.current_spend = None + self.notifications = kwargs.get('notifications', None) diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py new file mode 100644 index 000000000000..2668382253e2 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class BudgetPaged(Paged): + """ + A paging container for iterating over a list of :class:`Budget ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Budget]'} + } + + def __init__(self, *args, **kwargs): + + super(BudgetPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_py3.py new file mode 100644 index 000000000000..4c8ed53f61c8 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_py3.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class Budget(ProxyResource): + """A budget resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param e_tag: eTag of the resource. To handle concurrent update scenarion, + this field will be used to determine whether the user is updating the + latest version or not. + :type e_tag: str + :param category: Required. The category of the budget, whether the budget + tracks cost or usage. Possible values include: 'Cost', 'Usage' + :type category: str or ~azure.mgmt.consumption.models.CategoryType + :param amount: Required. The total amount of cost to track with the budget + :type amount: decimal.Decimal + :param time_grain: Required. The time covered by a budget. Tracking of the + amount will be reset based on the time grain. Possible values include: + 'Monthly', 'Quarterly', 'Annually' + :type time_grain: str or ~azure.mgmt.consumption.models.TimeGrainType + :param time_period: Required. Has start and end date of the budget. The + start date must be first of the month and should be less than the end + date. Budget start date must be on or after June 1, 2017. Future start + date should not be more than three months. Past start date should be + selected within the timegrain preiod. There are no restrictions on the end + date. + :type time_period: ~azure.mgmt.consumption.models.BudgetTimePeriod + :param filters: May be used to filter budgets by resource group, resource, + or meter. + :type filters: ~azure.mgmt.consumption.models.Filters + :ivar current_spend: The current amount of cost which is being tracked for + a budget. + :vartype current_spend: ~azure.mgmt.consumption.models.CurrentSpend + :param notifications: Dictionary of notifications associated with the + budget. Budget can have up to five notifications. + :type notifications: dict[str, + ~azure.mgmt.consumption.models.Notification] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'category': {'required': True}, + 'amount': {'required': True}, + 'time_grain': {'required': True}, + 'time_period': {'required': True}, + 'current_spend': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'amount': {'key': 'properties.amount', 'type': 'decimal'}, + 'time_grain': {'key': 'properties.timeGrain', 'type': 'str'}, + 'time_period': {'key': 'properties.timePeriod', 'type': 'BudgetTimePeriod'}, + 'filters': {'key': 'properties.filters', 'type': 'Filters'}, + 'current_spend': {'key': 'properties.currentSpend', 'type': 'CurrentSpend'}, + 'notifications': {'key': 'properties.notifications', 'type': '{Notification}'}, + } + + def __init__(self, *, category, amount, time_grain, time_period, e_tag: str=None, filters=None, notifications=None, **kwargs) -> None: + super(Budget, self).__init__(e_tag=e_tag, **kwargs) + self.category = category + self.amount = amount + self.time_grain = time_grain + self.time_period = time_period + self.filters = filters + self.current_spend = None + self.notifications = notifications diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py new file mode 100644 index 000000000000..a0fe9658a07f --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BudgetTimePeriod(Model): + """The start and end date for a budget. + + All required parameters must be populated in order to send to Azure. + + :param start_date: Required. The start date for the budget. + :type start_date: datetime + :param end_date: The end date for the budget. If not provided, we default + this to 10 years from the start date. + :type end_date: datetime + """ + + _validation = { + 'start_date': {'required': True}, + } + + _attribute_map = { + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(BudgetTimePeriod, self).__init__(**kwargs) + self.start_date = kwargs.get('start_date', None) + self.end_date = kwargs.get('end_date', None) diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period_py3.py new file mode 100644 index 000000000000..de0258c1d63f --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/budget_time_period_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BudgetTimePeriod(Model): + """The start and end date for a budget. + + All required parameters must be populated in order to send to Azure. + + :param start_date: Required. The start date for the budget. + :type start_date: datetime + :param end_date: The end date for the budget. If not provided, we default + this to 10 years from the start date. + :type end_date: datetime + """ + + _validation = { + 'start_date': {'required': True}, + } + + _attribute_map = { + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + } + + def __init__(self, *, start_date, end_date=None, **kwargs) -> None: + super(BudgetTimePeriod, self).__init__(**kwargs) + self.start_date = start_date + self.end_date = end_date diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py index f72574687e5a..c7c8cf4d09b2 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py @@ -12,7 +12,27 @@ from enum import Enum -class Datagrain(Enum): +class CategoryType(str, Enum): + + cost = "Cost" + usage = "Usage" + + +class TimeGrainType(str, Enum): + + monthly = "Monthly" + quarterly = "Quarterly" + annually = "Annually" + + +class OperatorType(str, Enum): + + equal_to = "EqualTo" + greater_than = "GreaterThan" + greater_than_or_equal_to = "GreaterThanOrEqualTo" + + +class Datagrain(str, Enum): daily_grain = "daily" monthly_grain = "monthly" diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py new file mode 100644 index 000000000000..42724a3aa6c6 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CurrentSpend(Model): + """The current amount of cost which is being tracked for a budget. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar amount: The total amount of cost which is being tracked by the + budget. + :vartype amount: decimal.Decimal + :ivar unit: The unit of measure for the budget amount. + :vartype unit: str + """ + + _validation = { + 'amount': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'amount': {'key': 'amount', 'type': 'decimal'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CurrentSpend, self).__init__(**kwargs) + self.amount = None + self.unit = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend_py3.py new file mode 100644 index 000000000000..87a5fc0bcc1d --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/current_spend_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CurrentSpend(Model): + """The current amount of cost which is being tracked for a budget. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar amount: The total amount of cost which is being tracked by the + budget. + :vartype amount: decimal.Decimal + :ivar unit: The unit of measure for the budget amount. + :vartype unit: str + """ + + _validation = { + 'amount': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'amount': {'key': 'amount', 'type': 'decimal'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CurrentSpend, self).__init__(**kwargs) + self.amount = None + self.unit = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/error_details.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/error_details.py index 9f7383eca84e..03f3e23d2153 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/error_details.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/error_details.py @@ -34,7 +34,7 @@ class ErrorDetails(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self): - super(ErrorDetails, self).__init__() + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) self.code = None self.message = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/error_details_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/error_details_py3.py new file mode 100644 index 000000000000..f9e1adeac9fe --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/error_details_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """The details of the error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/error_response.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/error_response.py index bba5c307f2c3..4bd88fdd8421 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/error_response.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/error_response.py @@ -25,9 +25,9 @@ class ErrorResponse(Model): 'error': {'key': 'error', 'type': 'ErrorDetails'}, } - def __init__(self, error=None): - super(ErrorResponse, self).__init__() - self.error = error + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) class ErrorResponseException(HttpOperationError): diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/error_response_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/error_response_py3.py new file mode 100644 index 000000000000..7ee8c9325c20 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/error_response_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Error response indicates that the service is not able to process the + incoming request. The reason is provided in the error message. + + :param error: The details of the error. + :type error: ~azure.mgmt.consumption.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py new file mode 100644 index 000000000000..42c5f41c6412 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/filters.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Filters(Model): + """May be used to filter budgets by resource group, resource, or meter. + + :param resource_groups: The list of filters on resource groups, allowed at + subscription level only. + :type resource_groups: list[str] + :param resources: The list of filters on resources. + :type resources: list[str] + :param meters: The list of filters on meters (GUID), mandatory for budgets + of usage category. + :type meters: list[str] + :param tags: The dictionary of filters on tags. + :type tags: dict[str, list[str]] + """ + + _validation = { + 'resource_groups': {'max_items': 10, 'min_items': 0}, + 'resources': {'max_items': 10, 'min_items': 0}, + 'meters': {'max_items': 10, 'min_items': 0}, + } + + _attribute_map = { + 'resource_groups': {'key': 'resourceGroups', 'type': '[str]'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + 'meters': {'key': 'meters', 'type': '[str]'}, + 'tags': {'key': 'tags', 'type': '{[str]}'}, + } + + def __init__(self, **kwargs): + super(Filters, self).__init__(**kwargs) + self.resource_groups = kwargs.get('resource_groups', None) + self.resources = kwargs.get('resources', None) + self.meters = kwargs.get('meters', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/filters_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/filters_py3.py new file mode 100644 index 000000000000..c478858ccf1b --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/filters_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Filters(Model): + """May be used to filter budgets by resource group, resource, or meter. + + :param resource_groups: The list of filters on resource groups, allowed at + subscription level only. + :type resource_groups: list[str] + :param resources: The list of filters on resources. + :type resources: list[str] + :param meters: The list of filters on meters (GUID), mandatory for budgets + of usage category. + :type meters: list[str] + :param tags: The dictionary of filters on tags. + :type tags: dict[str, list[str]] + """ + + _validation = { + 'resource_groups': {'max_items': 10, 'min_items': 0}, + 'resources': {'max_items': 10, 'min_items': 0}, + 'meters': {'max_items': 10, 'min_items': 0}, + } + + _attribute_map = { + 'resource_groups': {'key': 'resourceGroups', 'type': '[str]'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + 'meters': {'key': 'meters', 'type': '[str]'}, + 'tags': {'key': 'tags', 'type': '{[str]}'}, + } + + def __init__(self, *, resource_groups=None, resources=None, meters=None, tags=None, **kwargs) -> None: + super(Filters, self).__init__(**kwargs) + self.resource_groups = resource_groups + self.resources = resources + self.meters = meters + self.tags = tags diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py new file mode 100644 index 000000000000..ab995a105325 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace.py @@ -0,0 +1,174 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Marketplace(Resource): + """An marketplace resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar billing_period_id: The id of the billing period resource that the + usage belongs to. + :vartype billing_period_id: str + :ivar usage_start: The start of the date time range covered by the usage + detail. + :vartype usage_start: datetime + :ivar usage_end: The end of the date time range covered by the usage + detail. + :vartype usage_end: datetime + :ivar resource_rate: The marketplace resource rate. + :vartype resource_rate: decimal.Decimal + :ivar offer_name: The type of offer. + :vartype offer_name: str + :ivar resource_group: The name of resource group. + :vartype resource_group: str + :ivar order_number: The order number. + :vartype order_number: str + :ivar instance_name: The name of the resource instance that the usage is + about. + :vartype instance_name: str + :ivar instance_id: The uri of the resource instance that the usage is + about. + :vartype instance_id: str + :ivar currency: The ISO currency in which the meter is charged, for + example, USD. + :vartype currency: str + :ivar consumed_quantity: The quantity of usage. + :vartype consumed_quantity: decimal.Decimal + :ivar unit_of_measure: The unit of measure. + :vartype unit_of_measure: str + :ivar pretax_cost: The amount of cost before tax. + :vartype pretax_cost: decimal.Decimal + :ivar is_estimated: The estimated usage is subject to change. + :vartype is_estimated: bool + :ivar meter_id: The meter id (GUID). + :vartype meter_id: str + :ivar subscription_guid: Subscription guid. + :vartype subscription_guid: str + :ivar subscription_name: Subscription name. + :vartype subscription_name: str + :ivar account_name: Account name. + :vartype account_name: str + :ivar department_name: Department name. + :vartype department_name: str + :ivar consumed_service: Consumed service name. + :vartype consumed_service: str + :ivar cost_center: The cost center of this department if it is a + department and a costcenter exists + :vartype cost_center: str + :ivar additional_properties: Additional details of this usage item. By + default this is not populated, unless it's specified in $expand. + :vartype additional_properties: str + :ivar publisher_name: The name of publisher. + :vartype publisher_name: str + :ivar plan_name: The name of plan. + :vartype plan_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'billing_period_id': {'readonly': True}, + 'usage_start': {'readonly': True}, + 'usage_end': {'readonly': True}, + 'resource_rate': {'readonly': True}, + 'offer_name': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'order_number': {'readonly': True}, + 'instance_name': {'readonly': True}, + 'instance_id': {'readonly': True}, + 'currency': {'readonly': True}, + 'consumed_quantity': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + 'pretax_cost': {'readonly': True}, + 'is_estimated': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'subscription_guid': {'readonly': True}, + 'subscription_name': {'readonly': True}, + 'account_name': {'readonly': True}, + 'department_name': {'readonly': True}, + 'consumed_service': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'additional_properties': {'readonly': True}, + 'publisher_name': {'readonly': True}, + 'plan_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, + 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, + 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, + 'resource_rate': {'key': 'properties.resourceRate', 'type': 'decimal'}, + 'offer_name': {'key': 'properties.offerName', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'order_number': {'key': 'properties.orderNumber', 'type': 'str'}, + 'instance_name': {'key': 'properties.instanceName', 'type': 'str'}, + 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'consumed_quantity': {'key': 'properties.consumedQuantity', 'type': 'decimal'}, + 'unit_of_measure': {'key': 'properties.unitOfMeasure', 'type': 'str'}, + 'pretax_cost': {'key': 'properties.pretaxCost', 'type': 'decimal'}, + 'is_estimated': {'key': 'properties.isEstimated', 'type': 'bool'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'subscription_guid': {'key': 'properties.subscriptionGuid', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, + 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'additional_properties': {'key': 'properties.additionalProperties', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'plan_name': {'key': 'properties.planName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Marketplace, self).__init__(**kwargs) + self.billing_period_id = None + self.usage_start = None + self.usage_end = None + self.resource_rate = None + self.offer_name = None + self.resource_group = None + self.order_number = None + self.instance_name = None + self.instance_id = None + self.currency = None + self.consumed_quantity = None + self.unit_of_measure = None + self.pretax_cost = None + self.is_estimated = None + self.meter_id = None + self.subscription_guid = None + self.subscription_name = None + self.account_name = None + self.department_name = None + self.consumed_service = None + self.cost_center = None + self.additional_properties = None + self.publisher_name = None + self.plan_name = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_paged.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_paged.py new file mode 100644 index 000000000000..d360761aca55 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class MarketplacePaged(Paged): + """ + A paging container for iterating over a list of :class:`Marketplace ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Marketplace]'} + } + + def __init__(self, *args, **kwargs): + + super(MarketplacePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_py3.py new file mode 100644 index 000000000000..64b89ab8c7e1 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/marketplace_py3.py @@ -0,0 +1,174 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Marketplace(Resource): + """An marketplace resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar billing_period_id: The id of the billing period resource that the + usage belongs to. + :vartype billing_period_id: str + :ivar usage_start: The start of the date time range covered by the usage + detail. + :vartype usage_start: datetime + :ivar usage_end: The end of the date time range covered by the usage + detail. + :vartype usage_end: datetime + :ivar resource_rate: The marketplace resource rate. + :vartype resource_rate: decimal.Decimal + :ivar offer_name: The type of offer. + :vartype offer_name: str + :ivar resource_group: The name of resource group. + :vartype resource_group: str + :ivar order_number: The order number. + :vartype order_number: str + :ivar instance_name: The name of the resource instance that the usage is + about. + :vartype instance_name: str + :ivar instance_id: The uri of the resource instance that the usage is + about. + :vartype instance_id: str + :ivar currency: The ISO currency in which the meter is charged, for + example, USD. + :vartype currency: str + :ivar consumed_quantity: The quantity of usage. + :vartype consumed_quantity: decimal.Decimal + :ivar unit_of_measure: The unit of measure. + :vartype unit_of_measure: str + :ivar pretax_cost: The amount of cost before tax. + :vartype pretax_cost: decimal.Decimal + :ivar is_estimated: The estimated usage is subject to change. + :vartype is_estimated: bool + :ivar meter_id: The meter id (GUID). + :vartype meter_id: str + :ivar subscription_guid: Subscription guid. + :vartype subscription_guid: str + :ivar subscription_name: Subscription name. + :vartype subscription_name: str + :ivar account_name: Account name. + :vartype account_name: str + :ivar department_name: Department name. + :vartype department_name: str + :ivar consumed_service: Consumed service name. + :vartype consumed_service: str + :ivar cost_center: The cost center of this department if it is a + department and a costcenter exists + :vartype cost_center: str + :ivar additional_properties: Additional details of this usage item. By + default this is not populated, unless it's specified in $expand. + :vartype additional_properties: str + :ivar publisher_name: The name of publisher. + :vartype publisher_name: str + :ivar plan_name: The name of plan. + :vartype plan_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'billing_period_id': {'readonly': True}, + 'usage_start': {'readonly': True}, + 'usage_end': {'readonly': True}, + 'resource_rate': {'readonly': True}, + 'offer_name': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'order_number': {'readonly': True}, + 'instance_name': {'readonly': True}, + 'instance_id': {'readonly': True}, + 'currency': {'readonly': True}, + 'consumed_quantity': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + 'pretax_cost': {'readonly': True}, + 'is_estimated': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'subscription_guid': {'readonly': True}, + 'subscription_name': {'readonly': True}, + 'account_name': {'readonly': True}, + 'department_name': {'readonly': True}, + 'consumed_service': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'additional_properties': {'readonly': True}, + 'publisher_name': {'readonly': True}, + 'plan_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, + 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, + 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, + 'resource_rate': {'key': 'properties.resourceRate', 'type': 'decimal'}, + 'offer_name': {'key': 'properties.offerName', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'order_number': {'key': 'properties.orderNumber', 'type': 'str'}, + 'instance_name': {'key': 'properties.instanceName', 'type': 'str'}, + 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'consumed_quantity': {'key': 'properties.consumedQuantity', 'type': 'decimal'}, + 'unit_of_measure': {'key': 'properties.unitOfMeasure', 'type': 'str'}, + 'pretax_cost': {'key': 'properties.pretaxCost', 'type': 'decimal'}, + 'is_estimated': {'key': 'properties.isEstimated', 'type': 'bool'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'subscription_guid': {'key': 'properties.subscriptionGuid', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, + 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'additional_properties': {'key': 'properties.additionalProperties', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'plan_name': {'key': 'properties.planName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Marketplace, self).__init__(, **kwargs) + self.billing_period_id = None + self.usage_start = None + self.usage_end = None + self.resource_rate = None + self.offer_name = None + self.resource_group = None + self.order_number = None + self.instance_name = None + self.instance_id = None + self.currency = None + self.consumed_quantity = None + self.unit_of_measure = None + self.pretax_cost = None + self.is_estimated = None + self.meter_id = None + self.subscription_guid = None + self.subscription_name = None + self.account_name = None + self.department_name = None + self.consumed_service = None + self.cost_center = None + self.additional_properties = None + self.publisher_name = None + self.plan_name = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details.py index c6806291332d..47c17dd65651 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details.py @@ -59,8 +59,8 @@ class MeterDetails(Model): 'pretax_standard_rate': {'key': 'pretaxStandardRate', 'type': 'decimal'}, } - def __init__(self): - super(MeterDetails, self).__init__() + def __init__(self, **kwargs): + super(MeterDetails, self).__init__(**kwargs) self.meter_name = None self.meter_category = None self.meter_sub_category = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details_py3.py new file mode 100644 index 000000000000..dbb2858bfff4 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/meter_details_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MeterDetails(Model): + """The properties of the meter detail. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar meter_name: The name of the meter, within the given meter category + :vartype meter_name: str + :ivar meter_category: The category of the meter, for example, 'Cloud + services', 'Networking', etc.. + :vartype meter_category: str + :ivar meter_sub_category: The subcategory of the meter, for example, 'A6 + Cloud services', 'ExpressRoute (IXP)', etc.. + :vartype meter_sub_category: str + :ivar unit: The unit in which the meter consumption is charged, for + example, 'Hours', 'GB', etc. + :vartype unit: str + :ivar meter_location: The location in which the Azure service is + available. + :vartype meter_location: str + :ivar total_included_quantity: The total included quantity associated with + the offer. + :vartype total_included_quantity: decimal.Decimal + :ivar pretax_standard_rate: The pretax listing price. + :vartype pretax_standard_rate: decimal.Decimal + """ + + _validation = { + 'meter_name': {'readonly': True}, + 'meter_category': {'readonly': True}, + 'meter_sub_category': {'readonly': True}, + 'unit': {'readonly': True}, + 'meter_location': {'readonly': True}, + 'total_included_quantity': {'readonly': True}, + 'pretax_standard_rate': {'readonly': True}, + } + + _attribute_map = { + 'meter_name': {'key': 'meterName', 'type': 'str'}, + 'meter_category': {'key': 'meterCategory', 'type': 'str'}, + 'meter_sub_category': {'key': 'meterSubCategory', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'meter_location': {'key': 'meterLocation', 'type': 'str'}, + 'total_included_quantity': {'key': 'totalIncludedQuantity', 'type': 'decimal'}, + 'pretax_standard_rate': {'key': 'pretaxStandardRate', 'type': 'decimal'}, + } + + def __init__(self, **kwargs) -> None: + super(MeterDetails, self).__init__(**kwargs) + self.meter_name = None + self.meter_category = None + self.meter_sub_category = None + self.unit = None + self.meter_location = None + self.total_included_quantity = None + self.pretax_standard_rate = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py new file mode 100644 index 000000000000..c50dc6aa4dc2 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/notification.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Notification(Model): + """The notification associated with a budget. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. The notification is enabled or not. + :type enabled: bool + :param operator: Required. The comparison operator. Possible values + include: 'EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo' + :type operator: str or ~azure.mgmt.consumption.models.OperatorType + :param threshold: Required. Threshold value associated with a + notification. Notification is sent when the cost exceeded the threshold. + It is always percent and has to be between 0 and 1000. + :type threshold: decimal.Decimal + :param contact_emails: Required. Email addresses to send the budget + notification to when the threshold is exceeded. + :type contact_emails: list[str] + :param contact_roles: Contact roles to send the budget notification to + when the threshold is exceeded. + :type contact_roles: list[str] + :param contact_groups: Action groups to send the budget notification to + when the threshold is exceeded. + :type contact_groups: list[str] + """ + + _validation = { + 'enabled': {'required': True}, + 'operator': {'required': True}, + 'threshold': {'required': True}, + 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 1}, + 'contact_groups': {'max_items': 50, 'min_items': 0}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'threshold': {'key': 'threshold', 'type': 'decimal'}, + 'contact_emails': {'key': 'contactEmails', 'type': '[str]'}, + 'contact_roles': {'key': 'contactRoles', 'type': '[str]'}, + 'contact_groups': {'key': 'contactGroups', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(Notification, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.operator = kwargs.get('operator', None) + self.threshold = kwargs.get('threshold', None) + self.contact_emails = kwargs.get('contact_emails', None) + self.contact_roles = kwargs.get('contact_roles', None) + self.contact_groups = kwargs.get('contact_groups', None) diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/notification_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/notification_py3.py new file mode 100644 index 000000000000..6dfc794e2477 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/notification_py3.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Notification(Model): + """The notification associated with a budget. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. The notification is enabled or not. + :type enabled: bool + :param operator: Required. The comparison operator. Possible values + include: 'EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo' + :type operator: str or ~azure.mgmt.consumption.models.OperatorType + :param threshold: Required. Threshold value associated with a + notification. Notification is sent when the cost exceeded the threshold. + It is always percent and has to be between 0 and 1000. + :type threshold: decimal.Decimal + :param contact_emails: Required. Email addresses to send the budget + notification to when the threshold is exceeded. + :type contact_emails: list[str] + :param contact_roles: Contact roles to send the budget notification to + when the threshold is exceeded. + :type contact_roles: list[str] + :param contact_groups: Action groups to send the budget notification to + when the threshold is exceeded. + :type contact_groups: list[str] + """ + + _validation = { + 'enabled': {'required': True}, + 'operator': {'required': True}, + 'threshold': {'required': True}, + 'contact_emails': {'required': True, 'max_items': 50, 'min_items': 1}, + 'contact_groups': {'max_items': 50, 'min_items': 0}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'threshold': {'key': 'threshold', 'type': 'decimal'}, + 'contact_emails': {'key': 'contactEmails', 'type': '[str]'}, + 'contact_roles': {'key': 'contactRoles', 'type': '[str]'}, + 'contact_groups': {'key': 'contactGroups', 'type': '[str]'}, + } + + def __init__(self, *, enabled: bool, operator, threshold, contact_emails, contact_roles=None, contact_groups=None, **kwargs) -> None: + super(Notification, self).__init__(**kwargs) + self.enabled = enabled + self.operator = operator + self.threshold = threshold + self.contact_emails = contact_emails + self.contact_roles = contact_roles + self.contact_groups = contact_groups diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/operation.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/operation.py index 5bbbcda6fcef..4c9c35d9d03e 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/operation.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/operation.py @@ -33,7 +33,7 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, display=None): - super(Operation, self).__init__() + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) self.name = None - self.display = display + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_display.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_display.py index acd4f114fc69..5a1143b805e0 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_display.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_display.py @@ -39,8 +39,8 @@ class OperationDisplay(Model): 'operation': {'key': 'operation', 'type': 'str'}, } - def __init__(self): - super(OperationDisplay, self).__init__() + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) self.provider = None self.resource = None self.operation = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_display_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_display_py3.py new file mode 100644 index 000000000000..c5fe954f04a4 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_display_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Service provider: Microsoft.Consumption. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: UsageDetail, + etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_py3.py new file mode 100644 index 000000000000..93b8aa1bebad --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/operation_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """A Consumption REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.consumption.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties.py new file mode 100644 index 000000000000..fbc9dd2d8f23 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PriceSheetProperties(Model): + """The properties of the price sheet. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar billing_period_id: The id of the billing period resource that the + usage belongs to. + :vartype billing_period_id: str + :ivar meter_id: The meter id (GUID) + :vartype meter_id: str + :ivar meter_details: The details about the meter. By default this is not + populated, unless it's specified in $expand. + :vartype meter_details: ~azure.mgmt.consumption.models.MeterDetails + :ivar unit_of_measure: Unit of measure + :vartype unit_of_measure: str + :ivar included_quantity: Included quality for an offer + :vartype included_quantity: decimal.Decimal + :ivar part_number: Part Number + :vartype part_number: str + :ivar unit_price: Unit Price + :vartype unit_price: decimal.Decimal + :ivar currency_code: Currency Code + :vartype currency_code: str + """ + + _validation = { + 'billing_period_id': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_details': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + 'included_quantity': {'readonly': True}, + 'part_number': {'readonly': True}, + 'unit_price': {'readonly': True}, + 'currency_code': {'readonly': True}, + } + + _attribute_map = { + 'billing_period_id': {'key': 'billingPeriodId', 'type': 'str'}, + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'meter_details': {'key': 'meterDetails', 'type': 'MeterDetails'}, + 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, + 'included_quantity': {'key': 'includedQuantity', 'type': 'decimal'}, + 'part_number': {'key': 'partNumber', 'type': 'str'}, + 'unit_price': {'key': 'unitPrice', 'type': 'decimal'}, + 'currency_code': {'key': 'currencyCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PriceSheetProperties, self).__init__(**kwargs) + self.billing_period_id = None + self.meter_id = None + self.meter_details = None + self.unit_of_measure = None + self.included_quantity = None + self.part_number = None + self.unit_price = None + self.currency_code = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties_py3.py new file mode 100644 index 000000000000..e49fff547673 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_properties_py3.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PriceSheetProperties(Model): + """The properties of the price sheet. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar billing_period_id: The id of the billing period resource that the + usage belongs to. + :vartype billing_period_id: str + :ivar meter_id: The meter id (GUID) + :vartype meter_id: str + :ivar meter_details: The details about the meter. By default this is not + populated, unless it's specified in $expand. + :vartype meter_details: ~azure.mgmt.consumption.models.MeterDetails + :ivar unit_of_measure: Unit of measure + :vartype unit_of_measure: str + :ivar included_quantity: Included quality for an offer + :vartype included_quantity: decimal.Decimal + :ivar part_number: Part Number + :vartype part_number: str + :ivar unit_price: Unit Price + :vartype unit_price: decimal.Decimal + :ivar currency_code: Currency Code + :vartype currency_code: str + """ + + _validation = { + 'billing_period_id': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_details': {'readonly': True}, + 'unit_of_measure': {'readonly': True}, + 'included_quantity': {'readonly': True}, + 'part_number': {'readonly': True}, + 'unit_price': {'readonly': True}, + 'currency_code': {'readonly': True}, + } + + _attribute_map = { + 'billing_period_id': {'key': 'billingPeriodId', 'type': 'str'}, + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'meter_details': {'key': 'meterDetails', 'type': 'MeterDetails'}, + 'unit_of_measure': {'key': 'unitOfMeasure', 'type': 'str'}, + 'included_quantity': {'key': 'includedQuantity', 'type': 'decimal'}, + 'part_number': {'key': 'partNumber', 'type': 'str'}, + 'unit_price': {'key': 'unitPrice', 'type': 'decimal'}, + 'currency_code': {'key': 'currencyCode', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PriceSheetProperties, self).__init__(**kwargs) + self.billing_period_id = None + self.meter_id = None + self.meter_details = None + self.unit_of_measure = None + self.included_quantity = None + self.part_number = None + self.unit_price = None + self.currency_code = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_result.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_result.py new file mode 100644 index 000000000000..e4b536b687b7 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_result.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PriceSheetResult(Resource): + """An pricesheet resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar pricesheets: Price sheet + :vartype pricesheets: + list[~azure.mgmt.consumption.models.PriceSheetProperties] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'pricesheets': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'pricesheets': {'key': 'properties.pricesheets', 'type': '[PriceSheetProperties]'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PriceSheetResult, self).__init__(**kwargs) + self.pricesheets = None + self.next_link = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_result_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_result_py3.py new file mode 100644 index 000000000000..68d73980d015 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/price_sheet_result_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PriceSheetResult(Resource): + """An pricesheet resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar pricesheets: Price sheet + :vartype pricesheets: + list[~azure.mgmt.consumption.models.PriceSheetProperties] + :ivar next_link: The link (url) to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'pricesheets': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'pricesheets': {'key': 'properties.pricesheets', 'type': '[PriceSheetProperties]'}, + 'next_link': {'key': 'properties.nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PriceSheetResult, self).__init__(, **kwargs) + self.pricesheets = None + self.next_link = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py new file mode 100644 index 000000000000..015163ea9914 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ProxyResource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param e_tag: eTag of the resource. To handle concurrent update scenarion, + this field will be used to determine whether the user is updating the + latest version or not. + :type e_tag: 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'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.e_tag = kwargs.get('e_tag', None) diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource_py3.py new file mode 100644 index 000000000000..9c55f2452e0f --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/proxy_resource_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ProxyResource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param e_tag: eTag of the resource. To handle concurrent update scenarion, + this field will be used to determine whether the user is updating the + latest version or not. + :type e_tag: 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'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + } + + def __init__(self, *, e_tag: str=None, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.e_tag = e_tag diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_details.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_details.py index 648809ee6d0c..3d466b224ac8 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_details.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_details.py @@ -85,8 +85,8 @@ class ReservationDetails(Resource): 'total_reserved_quantity': {'key': 'properties.totalReservedQuantity', 'type': 'decimal'}, } - def __init__(self): - super(ReservationDetails, self).__init__() + def __init__(self, **kwargs): + super(ReservationDetails, self).__init__(**kwargs) self.reservation_order_id = None self.reservation_id = None self.sku_name = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_details_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_details_py3.py new file mode 100644 index 000000000000..81bb6cd277e6 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_details_py3.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ReservationDetails(Resource): + """reservation details resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar reservation_order_id: The reservation order ID is the identifier for + a reservation purchase. Each reservation order ID represents a single + purchase transaction. A reservation order contains reservations. The + reservation order specifies the VM size and region for the reservations. + :vartype reservation_order_id: str + :ivar reservation_id: The reservation ID is the identifier of a + reservation within a reservation order. Each reservation is the grouping + for applying the benefit scope and also specifies the number of instances + to which the reservation benefit can be applied to. + :vartype reservation_id: str + :ivar sku_name: This is the ARM Sku name. It can be used to join with the + servicetype field in additoinalinfo in usage records. + :vartype sku_name: str + :ivar reserved_hours: This is the total hours reserved for the day. E.g. + if reservation for 1 instance was made on 1 PM, this will be 11 hours for + that day and 24 hours from subsequent days. + :vartype reserved_hours: decimal.Decimal + :ivar usage_date: The date on which consumption occurred. + :vartype usage_date: datetime + :ivar used_hours: This is the total hours used by the instance. + :vartype used_hours: decimal.Decimal + :ivar instance_id: This identifier is the name of the resource or the + fully qualified Resource ID. + :vartype instance_id: str + :ivar total_reserved_quantity: This is the total count of instances that + are reserved for the reservationid. + :vartype total_reserved_quantity: decimal.Decimal + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'reservation_order_id': {'readonly': True}, + 'reservation_id': {'readonly': True}, + 'sku_name': {'readonly': True}, + 'reserved_hours': {'readonly': True}, + 'usage_date': {'readonly': True}, + 'used_hours': {'readonly': True}, + 'instance_id': {'readonly': True}, + 'total_reserved_quantity': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, + 'reserved_hours': {'key': 'properties.reservedHours', 'type': 'decimal'}, + 'usage_date': {'key': 'properties.usageDate', 'type': 'iso-8601'}, + 'used_hours': {'key': 'properties.usedHours', 'type': 'decimal'}, + 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, + 'total_reserved_quantity': {'key': 'properties.totalReservedQuantity', 'type': 'decimal'}, + } + + def __init__(self, **kwargs) -> None: + super(ReservationDetails, self).__init__(, **kwargs) + self.reservation_order_id = None + self.reservation_id = None + self.sku_name = None + self.reserved_hours = None + self.usage_date = None + self.used_hours = None + self.instance_id = None + self.total_reserved_quantity = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summaries.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summaries.py index c7b29ee74ce5..ce4244f3033d 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summaries.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summaries.py @@ -95,8 +95,8 @@ class ReservationSummaries(Resource): 'max_utilization_percentage': {'key': 'properties.maxUtilizationPercentage', 'type': 'decimal'}, } - def __init__(self): - super(ReservationSummaries, self).__init__() + def __init__(self, **kwargs): + super(ReservationSummaries, self).__init__(**kwargs) self.reservation_order_id = None self.reservation_id = None self.sku_name = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summaries_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summaries_py3.py new file mode 100644 index 000000000000..33c7bd18a23f --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/reservation_summaries_py3.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ReservationSummaries(Resource): + """reservation summaries resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar reservation_order_id: The reservation order ID is the identifier for + a reservation purchase. Each reservation order ID represents a single + purchase transaction. A reservation order contains reservations. The + reservation order specifies the VM size and region for the reservations. + :vartype reservation_order_id: str + :ivar reservation_id: The reservation ID is the identifier of a + reservation within a reservation order. Each reservation is the grouping + for applying the benefit scope and also specifies the number of instances + to which the reservation benefit can be applied to. + :vartype reservation_id: str + :ivar sku_name: This is the ARM Sku name. It can be used to join with the + servicetype field in additoinalinfo in usage records. + :vartype sku_name: str + :ivar reserved_hours: This is the total hours reserved. E.g. if + reservation for 1 instance was made on 1 PM, this will be 11 hours for + that day and 24 hours from subsequent days + :vartype reserved_hours: decimal.Decimal + :ivar usage_date: Data corresponding to the utilization record. If the + grain of data is monthly, it will be first day of month. + :vartype usage_date: datetime + :ivar used_hours: Total used hours by the reservation + :vartype used_hours: decimal.Decimal + :ivar min_utilization_percentage: This is the minimum hourly utilization + in the usage time (day or month). E.g. if usage record corresponds to + 12/10/2017 and on that for hour 4 and 5, utilization was 10%, this field + will return 10% for that day + :vartype min_utilization_percentage: decimal.Decimal + :ivar avg_utilization_percentage: This is average utilization for the + entire time range. (day or month depending on the grain) + :vartype avg_utilization_percentage: decimal.Decimal + :ivar max_utilization_percentage: This is the maximum hourly utilization + in the usage time (day or month). E.g. if usage record corresponds to + 12/10/2017 and on that for hour 4 and 5, utilization was 100%, this field + will return 100% for that day. + :vartype max_utilization_percentage: decimal.Decimal + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'reservation_order_id': {'readonly': True}, + 'reservation_id': {'readonly': True}, + 'sku_name': {'readonly': True}, + 'reserved_hours': {'readonly': True}, + 'usage_date': {'readonly': True}, + 'used_hours': {'readonly': True}, + 'min_utilization_percentage': {'readonly': True}, + 'avg_utilization_percentage': {'readonly': True}, + 'max_utilization_percentage': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'reservation_order_id': {'key': 'properties.reservationOrderId', 'type': 'str'}, + 'reservation_id': {'key': 'properties.reservationId', 'type': 'str'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, + 'reserved_hours': {'key': 'properties.reservedHours', 'type': 'decimal'}, + 'usage_date': {'key': 'properties.usageDate', 'type': 'iso-8601'}, + 'used_hours': {'key': 'properties.usedHours', 'type': 'decimal'}, + 'min_utilization_percentage': {'key': 'properties.minUtilizationPercentage', 'type': 'decimal'}, + 'avg_utilization_percentage': {'key': 'properties.avgUtilizationPercentage', 'type': 'decimal'}, + 'max_utilization_percentage': {'key': 'properties.maxUtilizationPercentage', 'type': 'decimal'}, + } + + def __init__(self, **kwargs) -> None: + super(ReservationSummaries, self).__init__(, **kwargs) + self.reservation_order_id = None + self.reservation_id = None + self.sku_name = None + self.reserved_hours = None + self.usage_date = None + self.used_hours = None + self.min_utilization_percentage = None + self.avg_utilization_percentage = None + self.max_utilization_percentage = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/resource.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/resource.py index 4e573a2bc8d9..08e36f3f8091 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/resource.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/resource.py @@ -42,8 +42,8 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/resource_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/resource_py3.py new file mode 100644 index 000000000000..38b4ca3ee6af --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/resource_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail.py index d7f9dfa3e395..4bc750aee807 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail.py @@ -58,7 +58,7 @@ class UsageDetail(Resource): :vartype pretax_cost: decimal.Decimal :ivar is_estimated: The estimated usage is subject to change. :vartype is_estimated: bool - :ivar meter_id: The meter id. + :ivar meter_id: The meter id (GUID). :vartype meter_id: str :ivar meter_details: The details about the meter. By default this is not populated, unless it's specified in $expand. @@ -141,8 +141,8 @@ class UsageDetail(Resource): 'additional_properties': {'key': 'properties.additionalProperties', 'type': 'str'}, } - def __init__(self): - super(UsageDetail, self).__init__() + def __init__(self, **kwargs): + super(UsageDetail, self).__init__(**kwargs) self.billing_period_id = None self.invoice_id = None self.usage_start = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail_py3.py b/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail_py3.py new file mode 100644 index 000000000000..5f1bb1f83ab4 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/models/usage_detail_py3.py @@ -0,0 +1,167 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class UsageDetail(Resource): + """An usage detail resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar billing_period_id: The id of the billing period resource that the + usage belongs to. + :vartype billing_period_id: str + :ivar invoice_id: The id of the invoice resource that the usage belongs + to. + :vartype invoice_id: str + :ivar usage_start: The start of the date time range covered by the usage + detail. + :vartype usage_start: datetime + :ivar usage_end: The end of the date time range covered by the usage + detail. + :vartype usage_end: datetime + :ivar instance_name: The name of the resource instance that the usage is + about. + :vartype instance_name: str + :ivar instance_id: The uri of the resource instance that the usage is + about. + :vartype instance_id: str + :ivar instance_location: The location of the resource instance that the + usage is about. + :vartype instance_location: str + :ivar currency: The ISO currency in which the meter is charged, for + example, USD. + :vartype currency: str + :ivar usage_quantity: The quantity of usage. + :vartype usage_quantity: decimal.Decimal + :ivar billable_quantity: The billable usage quantity. + :vartype billable_quantity: decimal.Decimal + :ivar pretax_cost: The amount of cost before tax. + :vartype pretax_cost: decimal.Decimal + :ivar is_estimated: The estimated usage is subject to change. + :vartype is_estimated: bool + :ivar meter_id: The meter id (GUID). + :vartype meter_id: str + :ivar meter_details: The details about the meter. By default this is not + populated, unless it's specified in $expand. + :vartype meter_details: ~azure.mgmt.consumption.models.MeterDetails + :ivar subscription_guid: Subscription guid. + :vartype subscription_guid: str + :ivar subscription_name: Subscription name. + :vartype subscription_name: str + :ivar account_name: Account name. + :vartype account_name: str + :ivar department_name: Department name. + :vartype department_name: str + :ivar product: Product name. + :vartype product: str + :ivar consumed_service: Consumed service name. + :vartype consumed_service: str + :ivar cost_center: The cost center of this department if it is a + department and a costcenter exists + :vartype cost_center: str + :ivar additional_properties: Additional details of this usage item. By + default this is not populated, unless it's specified in $expand. + :vartype additional_properties: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'readonly': True}, + 'billing_period_id': {'readonly': True}, + 'invoice_id': {'readonly': True}, + 'usage_start': {'readonly': True}, + 'usage_end': {'readonly': True}, + 'instance_name': {'readonly': True}, + 'instance_id': {'readonly': True}, + 'instance_location': {'readonly': True}, + 'currency': {'readonly': True}, + 'usage_quantity': {'readonly': True}, + 'billable_quantity': {'readonly': True}, + 'pretax_cost': {'readonly': True}, + 'is_estimated': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_details': {'readonly': True}, + 'subscription_guid': {'readonly': True}, + 'subscription_name': {'readonly': True}, + 'account_name': {'readonly': True}, + 'department_name': {'readonly': True}, + 'product': {'readonly': True}, + 'consumed_service': {'readonly': True}, + 'cost_center': {'readonly': True}, + 'additional_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'billing_period_id': {'key': 'properties.billingPeriodId', 'type': 'str'}, + 'invoice_id': {'key': 'properties.invoiceId', 'type': 'str'}, + 'usage_start': {'key': 'properties.usageStart', 'type': 'iso-8601'}, + 'usage_end': {'key': 'properties.usageEnd', 'type': 'iso-8601'}, + 'instance_name': {'key': 'properties.instanceName', 'type': 'str'}, + 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, + 'instance_location': {'key': 'properties.instanceLocation', 'type': 'str'}, + 'currency': {'key': 'properties.currency', 'type': 'str'}, + 'usage_quantity': {'key': 'properties.usageQuantity', 'type': 'decimal'}, + 'billable_quantity': {'key': 'properties.billableQuantity', 'type': 'decimal'}, + 'pretax_cost': {'key': 'properties.pretaxCost', 'type': 'decimal'}, + 'is_estimated': {'key': 'properties.isEstimated', 'type': 'bool'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'meter_details': {'key': 'properties.meterDetails', 'type': 'MeterDetails'}, + 'subscription_guid': {'key': 'properties.subscriptionGuid', 'type': 'str'}, + 'subscription_name': {'key': 'properties.subscriptionName', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'department_name': {'key': 'properties.departmentName', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'consumed_service': {'key': 'properties.consumedService', 'type': 'str'}, + 'cost_center': {'key': 'properties.costCenter', 'type': 'str'}, + 'additional_properties': {'key': 'properties.additionalProperties', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageDetail, self).__init__(, **kwargs) + self.billing_period_id = None + self.invoice_id = None + self.usage_start = None + self.usage_end = None + self.instance_name = None + self.instance_id = None + self.instance_location = None + self.currency = None + self.usage_quantity = None + self.billable_quantity = None + self.pretax_cost = None + self.is_estimated = None + self.meter_id = None + self.meter_details = None + self.subscription_guid = None + self.subscription_name = None + self.account_name = None + self.department_name = None + self.product = None + self.consumed_service = None + self.cost_center = None + self.additional_properties = None diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py index 88fe5bcbb6a8..cb1dff45a8f9 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/__init__.py @@ -10,13 +10,19 @@ # -------------------------------------------------------------------------- from .usage_details_operations import UsageDetailsOperations +from .marketplaces_operations import MarketplacesOperations from .reservations_summaries_operations import ReservationsSummariesOperations from .reservations_details_operations import ReservationsDetailsOperations +from .budgets_operations import BudgetsOperations from .operations import Operations +from .price_sheet_operations import PriceSheetOperations __all__ = [ 'UsageDetailsOperations', + 'MarketplacesOperations', 'ReservationsSummariesOperations', 'ReservationsDetailsOperations', + 'BudgetsOperations', 'Operations', + 'PriceSheetOperations', ] diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py new file mode 100644 index 000000000000..66e231becb43 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/budgets_operations.py @@ -0,0 +1,532 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BudgetsOperations(object): + """BudgetsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-03-31" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all budgets for a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Budget + :rtype: + ~azure.mgmt.consumption.models.BudgetPaged[~azure.mgmt.consumption.models.Budget] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.BudgetPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BudgetPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets'} + + def list_by_resource_group_name( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all budgets for a resource group under a subscription. + + :param resource_group_name: Azure Resource Group Name. + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Budget + :rtype: + ~azure.mgmt.consumption.models.BudgetPaged[~azure.mgmt.consumption.models.Budget] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.BudgetPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BudgetPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets'} + + def get( + self, budget_name, custom_headers=None, raw=False, **operation_config): + """Gets the budget for a subscription by budget name. + + :param budget_name: Budget Name. + :type budget_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Budget or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.consumption.models.Budget or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'budgetName': self._serialize.url("budget_name", budget_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Budget', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}'} + + def create_or_update( + self, budget_name, parameters, custom_headers=None, raw=False, **operation_config): + """The operation to create or update a budget. Update operation requires + latest eTag to be set in the request mandatorily. You may obtain the + latest eTag by performing a get operation. Create operation does not + require eTag. + + :param budget_name: Budget Name. + :type budget_name: str + :param parameters: Parameters supplied to the Create Budget operation. + :type parameters: ~azure.mgmt.consumption.models.Budget + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Budget or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.consumption.models.Budget or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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'), + 'budgetName': self._serialize.url("budget_name", budget_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Budget') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Budget', response) + if response.status_code == 201: + deserialized = self._deserialize('Budget', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}'} + + def delete( + self, budget_name, custom_headers=None, raw=False, **operation_config): + """The operation to delete a budget. + + :param budget_name: Budget Name. + :type budget_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'budgetName': self._serialize.url("budget_name", budget_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/budgets/{budgetName}'} + + def get_by_resource_group_name( + self, resource_group_name, budget_name, custom_headers=None, raw=False, **operation_config): + """Gets the budget for a resource group under a subscription by budget + name. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param budget_name: Budget Name. + :type budget_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Budget or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.consumption.models.Budget or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_resource_group_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'budgetName': self._serialize.url("budget_name", budget_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Budget', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}'} + + def create_or_update_by_resource_group_name( + self, resource_group_name, budget_name, parameters, custom_headers=None, raw=False, **operation_config): + """The operation to create or update a budget. Update operation requires + latest eTag to be set in the request mandatorily. You may obtain the + latest eTag by performing a get operation. Create operation does not + require eTag. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param budget_name: Budget Name. + :type budget_name: str + :param parameters: Parameters supplied to the Create Budget operation. + :type parameters: ~azure.mgmt.consumption.models.Budget + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Budget or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.consumption.models.Budget or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update_by_resource_group_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'budgetName': self._serialize.url("budget_name", budget_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Budget') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Budget', response) + if response.status_code == 201: + deserialized = self._deserialize('Budget', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}'} + + def delete_by_resource_group_name( + self, resource_group_name, budget_name, custom_headers=None, raw=False, **operation_config): + """The operation to delete a budget. + + :param resource_group_name: Azure Resource Group Name. + :type resource_group_name: str + :param budget_name: Budget Name. + :type budget_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete_by_resource_group_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'budgetName': self._serialize.url("budget_name", budget_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete_by_resource_group_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Consumption/budgets/{budgetName}'} diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/marketplaces_operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/marketplaces_operations.py new file mode 100644 index 000000000000..a1b597f10be8 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/marketplaces_operations.py @@ -0,0 +1,211 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class MarketplacesOperations(object): + """MarketplacesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-03-31" + + self.config = config + + def list( + self, filter=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """Lists the marketplaces for a scope by subscriptionId. Marketplaces are + available via this API only for May 1, 2014 or later. + + :param filter: May be used to filter marketplaces by + properties/usageEnd (Utc time), properties/usageStart (Utc time), + properties/resourceGroup, properties/instanceName or + properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', + 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + :type filter: str + :param top: May be used to limit the number of results to the most + recent N marketplaces. + :type top: int + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Marketplace + :rtype: + ~azure.mgmt.consumption.models.MarketplacePaged[~azure.mgmt.consumption.models.Marketplace] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.MarketplacePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MarketplacePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/marketplaces'} + + def list_by_billing_period( + self, billing_period_name, filter=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """Lists the marketplaces for a scope by billing period and + subscripotionId. Marketplaces are available via this API only for May + 1, 2014 or later. + + :param billing_period_name: Billing Period Name. + :type billing_period_name: str + :param filter: May be used to filter marketplaces by + properties/usageEnd (Utc time), properties/usageStart (Utc time), + properties/resourceGroup, properties/instanceName or + properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', + 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + :type filter: str + :param top: May be used to limit the number of results to the most + recent N marketplaces. + :type top: int + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Marketplace + :rtype: + ~azure.mgmt.consumption.models.MarketplacePaged[~azure.mgmt.consumption.models.Marketplace] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_billing_period.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.MarketplacePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MarketplacePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_period.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/marketplaces'} diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py index 262abfd4858d..f05f17e1d099 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/operations.py @@ -21,8 +21,8 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2017-11-30. Constant value: "2017-11-30". + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-11-30" + self.api_version = "2018-03-31" self.config = config @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Consumption/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -78,7 +78,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -94,3 +94,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Consumption/operations'} diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py new file mode 100644 index 000000000000..fc3c2d318e15 --- /dev/null +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/price_sheet_operations.py @@ -0,0 +1,188 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PriceSheetOperations(object): + """PriceSheetOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-03-31" + + self.config = config + + def get( + self, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Gets the price sheet for a scope by subscriptionId. Price sheet is + available via this API only for May 1, 2014 or later. + + :param expand: May be used to expand the properties/meterDetails + within a price sheet. By default, these fields are not included when + returning price sheet. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the top N + results. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PriceSheetResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.consumption.models.PriceSheetResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PriceSheetResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default'} + + def get_by_billing_period( + self, billing_period_name, expand=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get the price sheet for a scope by subscriptionId and billing period. + Price sheet is available via this API only for May 1, 2014 or later. + + :param billing_period_name: Billing Period Name. + :type billing_period_name: str + :param expand: May be used to expand the properties/meterDetails + within a price sheet. By default, these fields are not included when + returning price sheet. + :type expand: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the top N + results. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PriceSheetResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.consumption.models.PriceSheetResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_billing_period.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PriceSheetResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_billing_period.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default'} diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py index 8211516a7b18..3eeae8b36e1a 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_details_operations.py @@ -21,8 +21,8 @@ class ReservationsDetailsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2017-11-30. Constant value: "2017-11-30". + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". """ models = models @@ -32,19 +32,16 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-11-30" + self.api_version = "2018-03-31" self.config = config - def list( - self, scope, filter, custom_headers=None, raw=False, **operation_config): + def list_by_reservation_order( + self, reservation_order_id, filter, custom_headers=None, raw=False, **operation_config): """Lists the reservations details for provided date range. - :param scope: The scope of the reservation details. The scope can be - 'providers/Microsoft.Capacity/reservationorders/{ReservationOrderId}' - or - 'providers/Microsoft.Capacity/reservationorders/{ReservationOrderId}/reservations/{ReservationId}' - :type scope: str + :param reservation_order_id: Order Id of the reservation + :type reservation_order_id: str :param filter: Filter reservation details by date range. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' @@ -64,9 +61,9 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/{scope}/providers/Microsoft.Consumption/reservationDetails' + url = self.list_by_reservation_order.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -92,7 +89,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -108,3 +105,78 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_reservation_order.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails'} + + def list_by_reservation_order_and_reservation( + self, reservation_order_id, reservation_id, filter, custom_headers=None, raw=False, **operation_config): + """Lists the reservations details for provided date range. + + :param reservation_order_id: Order Id of the reservation + :type reservation_order_id: str + :param reservation_id: Id of the reservation + :type reservation_id: str + :param filter: Filter reservation details by date range. The + properties/UsageDate for start date and end date. The filter supports + 'le' and 'ge' + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ReservationDetails + :rtype: + ~azure.mgmt.consumption.models.ReservationDetailsPaged[~azure.mgmt.consumption.models.ReservationDetails] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_reservation_order_and_reservation.metadata['url'] + path_format_arguments = { + 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'), + 'reservationId': self._serialize.url("reservation_id", reservation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ReservationDetailsPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ReservationDetailsPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_reservation_order_and_reservation.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails'} diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py index 02bc946e6c0f..70b25308e47e 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/reservations_summaries_operations.py @@ -21,8 +21,8 @@ class ReservationsSummariesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2017-11-30. Constant value: "2017-11-30". + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". """ models = models @@ -32,22 +32,16 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-11-30" + self.api_version = "2018-03-31" self.config = config - def list( - self, scope, grain, filter=None, custom_headers=None, raw=False, **operation_config): + def list_by_reservation_order( + self, reservation_order_id, filter=None, custom_headers=None, raw=False, **operation_config): """Lists the reservations summaries for daily or monthly grain. - :param scope: The scope of the reservation summaries. The scope can be - 'providers/Microsoft.Capacity/reservationorders/{ReservationOrderId}' - or - 'providers/Microsoft.Capacity/reservationorders/{ReservationOrderId}/reservations/{ReservationId}' - :type scope: str - :param grain: Can be daily or monthly. Possible values include: - 'DailyGrain', 'MonthlyGrain' - :type grain: str or ~azure.mgmt.consumption.models.Datagrain + :param reservation_order_id: Order Id of the reservation + :type reservation_order_id: str :param filter: Required only for daily grain. The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge' :type filter: str @@ -66,15 +60,15 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/{scope}/providers/Microsoft.Consumption/reservationSummaries' + url = self.list_by_reservation_order.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['grain'] = self._serialize.query("grain", grain, 'str') + query_parameters['grain'] = self._serialize.query("self.config.grain", self.config.grain, 'str') if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') @@ -96,7 +90,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -112,3 +106,79 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_reservation_order.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries'} + + def list_by_reservation_order_and_reservation( + self, reservation_order_id, reservation_id, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the reservations summaries for daily or monthly grain. + + :param reservation_order_id: Order Id of the reservation + :type reservation_order_id: str + :param reservation_id: Id of the reservation + :type reservation_id: str + :param filter: Required only for daily grain. The properties/UsageDate + for start date and end date. The filter supports 'le' and 'ge' + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ReservationSummaries + :rtype: + ~azure.mgmt.consumption.models.ReservationSummariesPaged[~azure.mgmt.consumption.models.ReservationSummaries] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_reservation_order_and_reservation.metadata['url'] + path_format_arguments = { + 'reservationOrderId': self._serialize.url("reservation_order_id", reservation_order_id, 'str'), + 'reservationId': self._serialize.url("reservation_id", reservation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['grain'] = self._serialize.query("self.config.grain", self.config.grain, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ReservationSummariesPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ReservationSummariesPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_reservation_order_and_reservation.metadata = {'url': '/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries'} diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py b/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py index 02ff0b6711ce..de5ee51b5b77 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/operations/usage_details_operations.py @@ -21,8 +21,8 @@ class UsageDetailsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: Version of the API to be used with the client request. The current version is 2017-11-30. Constant value: "2017-11-30". + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2018-03-31. Constant value: "2018-03-31". """ models = models @@ -32,20 +32,15 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-11-30" + self.api_version = "2018-03-31" self.config = config def list( - self, scope, expand=None, filter=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + self, expand=None, filter=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): """Lists the usage details for a scope by billing period. Usage details are available via this API only for May 1, 2014 or later. - :param scope: The scope of the usage details. The scope can be - '/subscriptions/{subscriptionId}' for a subscription, or - '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - for a billing perdiod. - :type scope: str :param expand: May be used to expand the properties/additionalProperties or properties/meterDetails within a list of usage details. By default, these fields are not included when @@ -80,9 +75,9 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/{scope}/providers/Microsoft.Consumption/usageDetails' + url = self.list.metadata['url'] path_format_arguments = { - 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -115,7 +110,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) @@ -131,3 +126,99 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/usageDetails'} + + def list_by_billing_period( + self, billing_period_name, expand=None, filter=None, skiptoken=None, top=None, custom_headers=None, raw=False, **operation_config): + """Lists the usage details for a scope by billing period. Usage details + are available via this API only for May 1, 2014 or later. + + :param billing_period_name: Billing Period Name. + :type billing_period_name: str + :param expand: May be used to expand the + properties/additionalProperties or properties/meterDetails within a + list of usage details. By default, these fields are not included when + listing usage details. + :type expand: str + :param filter: May be used to filter usageDetails by + properties/usageEnd (Utc time), properties/usageStart (Utc time), + properties/resourceGroup, properties/instanceName or + properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', + 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + :type filter: str + :param skiptoken: Skiptoken is only used if a previous operation + returned a partial result. If a previous response contains a nextLink + element, the value of the nextLink element will include a skiptoken + parameter that specifies a starting point to use for subsequent calls. + :type skiptoken: str + :param top: May be used to limit the number of results to the most + recent N usageDetails. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of UsageDetail + :rtype: + ~azure.mgmt.consumption.models.UsageDetailPaged[~azure.mgmt.consumption.models.UsageDetail] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_billing_period.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'billingPeriodName': self._serialize.url("billing_period_name", billing_period_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.UsageDetailPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.UsageDetailPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_billing_period.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/usageDetails'} diff --git a/azure-mgmt-consumption/azure/mgmt/consumption/version.py b/azure-mgmt-consumption/azure/mgmt/consumption/version.py index 24b9de3384da..9c644827672b 100644 --- a/azure-mgmt-consumption/azure/mgmt/consumption/version.py +++ b/azure-mgmt-consumption/azure/mgmt/consumption/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.1.0" +VERSION = "1.2.0" diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/cosmos_db.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/cosmos_db.py index eeda6bff62de..0cb275d27ed6 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/cosmos_db.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/cosmos_db.py @@ -15,6 +15,17 @@ from .version import VERSION from .operations.database_accounts_operations import DatabaseAccountsOperations from .operations.operations import Operations +from .operations.database_operations import DatabaseOperations +from .operations.collection_operations import CollectionOperations +from .operations.collection_region_operations import CollectionRegionOperations +from .operations.database_account_region_operations import DatabaseAccountRegionOperations +from .operations.percentile_source_target_operations import PercentileSourceTargetOperations +from .operations.percentile_target_operations import PercentileTargetOperations +from .operations.percentile_operations import PercentileOperations +from .operations.collection_partition_region_operations import CollectionPartitionRegionOperations +from .operations.collection_partition_operations import CollectionPartitionOperations +from .operations.partition_key_range_id_operations import PartitionKeyRangeIdOperations +from .operations.partition_key_range_id_region_operations import PartitionKeyRangeIdRegionOperations from . import models @@ -43,7 +54,7 @@ def __init__( super(CosmosDBConfiguration, self).__init__(base_url) - self.add_user_agent('cosmosdb/{}'.format(VERSION)) + self.add_user_agent('azure-mgmt-cosmosdb/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials @@ -60,6 +71,28 @@ class CosmosDB(object): :vartype database_accounts: azure.mgmt.cosmosdb.operations.DatabaseAccountsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.cosmosdb.operations.Operations + :ivar database: Database operations + :vartype database: azure.mgmt.cosmosdb.operations.DatabaseOperations + :ivar collection: Collection operations + :vartype collection: azure.mgmt.cosmosdb.operations.CollectionOperations + :ivar collection_region: CollectionRegion operations + :vartype collection_region: azure.mgmt.cosmosdb.operations.CollectionRegionOperations + :ivar database_account_region: DatabaseAccountRegion operations + :vartype database_account_region: azure.mgmt.cosmosdb.operations.DatabaseAccountRegionOperations + :ivar percentile_source_target: PercentileSourceTarget operations + :vartype percentile_source_target: azure.mgmt.cosmosdb.operations.PercentileSourceTargetOperations + :ivar percentile_target: PercentileTarget operations + :vartype percentile_target: azure.mgmt.cosmosdb.operations.PercentileTargetOperations + :ivar percentile: Percentile operations + :vartype percentile: azure.mgmt.cosmosdb.operations.PercentileOperations + :ivar collection_partition_region: CollectionPartitionRegion operations + :vartype collection_partition_region: azure.mgmt.cosmosdb.operations.CollectionPartitionRegionOperations + :ivar collection_partition: CollectionPartition operations + :vartype collection_partition: azure.mgmt.cosmosdb.operations.CollectionPartitionOperations + :ivar partition_key_range_id: PartitionKeyRangeId operations + :vartype partition_key_range_id: azure.mgmt.cosmosdb.operations.PartitionKeyRangeIdOperations + :ivar partition_key_range_id_region: PartitionKeyRangeIdRegion operations + :vartype partition_key_range_id_region: azure.mgmt.cosmosdb.operations.PartitionKeyRangeIdRegionOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -84,3 +117,25 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.database = DatabaseOperations( + self._client, self.config, self._serialize, self._deserialize) + self.collection = CollectionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.collection_region = CollectionRegionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.database_account_region = DatabaseAccountRegionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.percentile_source_target = PercentileSourceTargetOperations( + self._client, self.config, self._serialize, self._deserialize) + self.percentile_target = PercentileTargetOperations( + self._client, self.config, self._serialize, self._deserialize) + self.percentile = PercentileOperations( + self._client, self.config, self._serialize, self._deserialize) + self.collection_partition_region = CollectionPartitionRegionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.collection_partition = CollectionPartitionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.partition_key_range_id = PartitionKeyRangeIdOperations( + self._client, self.config, self._serialize, self._deserialize) + self.partition_key_range_id_region = PartitionKeyRangeIdRegionOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py index fe74116b4fa6..072a567f3913 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py @@ -9,32 +9,80 @@ # regenerated. # -------------------------------------------------------------------------- -from .consistency_policy import ConsistencyPolicy -from .location import Location -from .failover_policy import FailoverPolicy -from .database_account import DatabaseAccount -from .failover_policies import FailoverPolicies -from .resource import Resource -from .database_account_create_update_parameters import DatabaseAccountCreateUpdateParameters -from .database_account_patch_parameters import DatabaseAccountPatchParameters -from .database_account_list_read_only_keys_result import DatabaseAccountListReadOnlyKeysResult -from .database_account_list_keys_result import DatabaseAccountListKeysResult -from .database_account_connection_string import DatabaseAccountConnectionString -from .database_account_list_connection_strings_result import DatabaseAccountListConnectionStringsResult -from .database_account_regenerate_key_parameters import DatabaseAccountRegenerateKeyParameters -from .operation_display import OperationDisplay -from .operation import Operation +try: + from .consistency_policy_py3 import ConsistencyPolicy + from .capability_py3 import Capability + from .location_py3 import Location + from .failover_policy_py3 import FailoverPolicy + from .database_account_py3 import DatabaseAccount + from .failover_policies_py3 import FailoverPolicies + from .resource_py3 import Resource + from .database_account_create_update_parameters_py3 import DatabaseAccountCreateUpdateParameters + from .database_account_patch_parameters_py3 import DatabaseAccountPatchParameters + from .database_account_list_read_only_keys_result_py3 import DatabaseAccountListReadOnlyKeysResult + from .database_account_list_keys_result_py3 import DatabaseAccountListKeysResult + from .database_account_connection_string_py3 import DatabaseAccountConnectionString + from .database_account_list_connection_strings_result_py3 import DatabaseAccountListConnectionStringsResult + from .database_account_regenerate_key_parameters_py3 import DatabaseAccountRegenerateKeyParameters + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .metric_name_py3 import MetricName + from .usage_py3 import Usage + from .partition_usage_py3 import PartitionUsage + from .metric_availability_py3 import MetricAvailability + from .metric_definition_py3 import MetricDefinition + from .metric_value_py3 import MetricValue + from .metric_py3 import Metric + from .percentile_metric_value_py3 import PercentileMetricValue + from .percentile_metric_py3 import PercentileMetric + from .partition_metric_py3 import PartitionMetric +except (SyntaxError, ImportError): + from .consistency_policy import ConsistencyPolicy + from .capability import Capability + from .location import Location + from .failover_policy import FailoverPolicy + from .database_account import DatabaseAccount + from .failover_policies import FailoverPolicies + from .resource import Resource + from .database_account_create_update_parameters import DatabaseAccountCreateUpdateParameters + from .database_account_patch_parameters import DatabaseAccountPatchParameters + from .database_account_list_read_only_keys_result import DatabaseAccountListReadOnlyKeysResult + from .database_account_list_keys_result import DatabaseAccountListKeysResult + from .database_account_connection_string import DatabaseAccountConnectionString + from .database_account_list_connection_strings_result import DatabaseAccountListConnectionStringsResult + from .database_account_regenerate_key_parameters import DatabaseAccountRegenerateKeyParameters + from .operation_display import OperationDisplay + from .operation import Operation + from .metric_name import MetricName + from .usage import Usage + from .partition_usage import PartitionUsage + from .metric_availability import MetricAvailability + from .metric_definition import MetricDefinition + from .metric_value import MetricValue + from .metric import Metric + from .percentile_metric_value import PercentileMetricValue + from .percentile_metric import PercentileMetric + from .partition_metric import PartitionMetric from .database_account_paged import DatabaseAccountPaged +from .metric_paged import MetricPaged +from .usage_paged import UsagePaged +from .metric_definition_paged import MetricDefinitionPaged from .operation_paged import OperationPaged +from .percentile_metric_paged import PercentileMetricPaged +from .partition_metric_paged import PartitionMetricPaged +from .partition_usage_paged import PartitionUsagePaged from .cosmos_db_enums import ( DatabaseAccountKind, DatabaseAccountOfferType, DefaultConsistencyLevel, KeyKind, + UnitType, + PrimaryAggregationType, ) __all__ = [ 'ConsistencyPolicy', + 'Capability', 'Location', 'FailoverPolicy', 'DatabaseAccount', @@ -49,10 +97,28 @@ 'DatabaseAccountRegenerateKeyParameters', 'OperationDisplay', 'Operation', + 'MetricName', + 'Usage', + 'PartitionUsage', + 'MetricAvailability', + 'MetricDefinition', + 'MetricValue', + 'Metric', + 'PercentileMetricValue', + 'PercentileMetric', + 'PartitionMetric', 'DatabaseAccountPaged', + 'MetricPaged', + 'UsagePaged', + 'MetricDefinitionPaged', 'OperationPaged', + 'PercentileMetricPaged', + 'PartitionMetricPaged', + 'PartitionUsagePaged', 'DatabaseAccountKind', 'DatabaseAccountOfferType', 'DefaultConsistencyLevel', 'KeyKind', + 'UnitType', + 'PrimaryAggregationType', ] diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/capability.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/capability.py new file mode 100644 index 000000000000..48558f2af852 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/capability.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Capability(Model): + """Cosmos DB capability object. + + :param name: Name of the Cosmos DB capability + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Capability, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/capability_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/capability_py3.py new file mode 100644 index 000000000000..6869abb6a6d3 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/capability_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Capability(Model): + """Cosmos DB capability object. + + :param name: Name of the Cosmos DB capability + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(Capability, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy.py index 73dd2ec0469f..10e57668fd9d 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy.py @@ -15,9 +15,12 @@ class ConsistencyPolicy(Model): """The consistency policy for the Cosmos DB database account. - :param default_consistency_level: The default consistency level and - configuration settings of the Cosmos DB account. Possible values include: - 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix' + All required parameters must be populated in order to send to Azure. + + :param default_consistency_level: Required. The default consistency level + and configuration settings of the Cosmos DB account. Possible values + include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', + 'ConsistentPrefix' :type default_consistency_level: str or ~azure.mgmt.cosmosdb.models.DefaultConsistencyLevel :param max_staleness_prefix: When used with the Bounded Staleness @@ -44,7 +47,8 @@ class ConsistencyPolicy(Model): 'max_interval_in_seconds': {'key': 'maxIntervalInSeconds', 'type': 'int'}, } - def __init__(self, default_consistency_level, max_staleness_prefix=None, max_interval_in_seconds=None): - self.default_consistency_level = default_consistency_level - self.max_staleness_prefix = max_staleness_prefix - self.max_interval_in_seconds = max_interval_in_seconds + def __init__(self, **kwargs): + super(ConsistencyPolicy, self).__init__(**kwargs) + self.default_consistency_level = kwargs.get('default_consistency_level', None) + self.max_staleness_prefix = kwargs.get('max_staleness_prefix', None) + self.max_interval_in_seconds = kwargs.get('max_interval_in_seconds', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy_py3.py new file mode 100644 index 000000000000..a544558dbc23 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConsistencyPolicy(Model): + """The consistency policy for the Cosmos DB database account. + + All required parameters must be populated in order to send to Azure. + + :param default_consistency_level: Required. The default consistency level + and configuration settings of the Cosmos DB account. Possible values + include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', + 'ConsistentPrefix' + :type default_consistency_level: str or + ~azure.mgmt.cosmosdb.models.DefaultConsistencyLevel + :param max_staleness_prefix: When used with the Bounded Staleness + consistency level, this value represents the number of stale requests + tolerated. Accepted range for this value is 1 – 2,147,483,647. Required + when defaultConsistencyPolicy is set to 'BoundedStaleness'. + :type max_staleness_prefix: long + :param max_interval_in_seconds: When used with the Bounded Staleness + consistency level, this value represents the time amount of staleness (in + seconds) tolerated. Accepted range for this value is 5 - 86400. Required + when defaultConsistencyPolicy is set to 'BoundedStaleness'. + :type max_interval_in_seconds: int + """ + + _validation = { + 'default_consistency_level': {'required': True}, + 'max_staleness_prefix': {'maximum': 2147483647, 'minimum': 1}, + 'max_interval_in_seconds': {'maximum': 86400, 'minimum': 5}, + } + + _attribute_map = { + 'default_consistency_level': {'key': 'defaultConsistencyLevel', 'type': 'DefaultConsistencyLevel'}, + 'max_staleness_prefix': {'key': 'maxStalenessPrefix', 'type': 'long'}, + 'max_interval_in_seconds': {'key': 'maxIntervalInSeconds', 'type': 'int'}, + } + + def __init__(self, *, default_consistency_level, max_staleness_prefix: int=None, max_interval_in_seconds: int=None, **kwargs) -> None: + super(ConsistencyPolicy, self).__init__(**kwargs) + self.default_consistency_level = default_consistency_level + self.max_staleness_prefix = max_staleness_prefix + self.max_interval_in_seconds = max_interval_in_seconds diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/cosmos_db_enums.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/cosmos_db_enums.py index 1e87cecaeb2a..73dfa4fad8fa 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/cosmos_db_enums.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/cosmos_db_enums.py @@ -12,19 +12,19 @@ from enum import Enum -class DatabaseAccountKind(Enum): +class DatabaseAccountKind(str, Enum): global_document_db = "GlobalDocumentDB" mongo_db = "MongoDB" parse = "Parse" -class DatabaseAccountOfferType(Enum): +class DatabaseAccountOfferType(str, Enum): standard = "Standard" -class DefaultConsistencyLevel(Enum): +class DefaultConsistencyLevel(str, Enum): eventual = "Eventual" session = "Session" @@ -33,9 +33,30 @@ class DefaultConsistencyLevel(Enum): consistent_prefix = "ConsistentPrefix" -class KeyKind(Enum): +class KeyKind(str, Enum): primary = "primary" secondary = "secondary" primary_readonly = "primaryReadonly" secondary_readonly = "secondaryReadonly" + + +class UnitType(str, Enum): + + count = "Count" + bytes = "Bytes" + seconds = "Seconds" + percent = "Percent" + count_per_second = "CountPerSecond" + bytes_per_second = "BytesPerSecond" + milliseconds = "Milliseconds" + + +class PrimaryAggregationType(str, Enum): + + none = "None" + average = "Average" + total = "Total" + minimimum = "Minimimum" + maximum = "Maximum" + last = "Last" diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py index 6db44ab34a45..99bd0e3d9401 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py @@ -18,14 +18,16 @@ class DatabaseAccount(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The unique resource identifier of the database account. :vartype id: str :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :param location: The location of the resource group to which the resource - belongs. + :param location: Required. The location of the resource group to which the + resource belongs. :type location: str :param tags: :type tags: dict[str, str] @@ -56,6 +58,8 @@ class DatabaseAccount(Resource): :param consistency_policy: The consistency policy for the Cosmos DB database account. :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param capabilities: List of Cosmos DB capabilities for the account + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] :ivar write_locations: An array that contains the write location for the Cosmos DB account. :vartype write_locations: list[~azure.mgmt.cosmosdb.models.Location] @@ -93,20 +97,22 @@ class DatabaseAccount(Resource): 'ip_range_filter': {'key': 'properties.ipRangeFilter', 'type': 'str'}, 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, 'write_locations': {'key': 'properties.writeLocations', 'type': '[Location]'}, 'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'}, 'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'}, } - def __init__(self, location, tags=None, kind="GlobalDocumentDB", provisioning_state=None, ip_range_filter=None, enable_automatic_failover=None, consistency_policy=None): - super(DatabaseAccount, self).__init__(location=location, tags=tags) - self.kind = kind - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(DatabaseAccount, self).__init__(**kwargs) + self.kind = kwargs.get('kind', "GlobalDocumentDB") + self.provisioning_state = kwargs.get('provisioning_state', None) self.document_endpoint = None self.database_account_offer_type = None - self.ip_range_filter = ip_range_filter - self.enable_automatic_failover = enable_automatic_failover - self.consistency_policy = consistency_policy + self.ip_range_filter = kwargs.get('ip_range_filter', None) + self.enable_automatic_failover = kwargs.get('enable_automatic_failover', None) + self.consistency_policy = kwargs.get('consistency_policy', None) + self.capabilities = kwargs.get('capabilities', None) self.write_locations = None self.read_locations = None self.failover_policies = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string.py index 589074884166..113617832a67 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string.py @@ -34,6 +34,7 @@ class DatabaseAccountConnectionString(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self): + def __init__(self, **kwargs): + super(DatabaseAccountConnectionString, self).__init__(**kwargs) self.connection_string = None self.description = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string_py3.py new file mode 100644 index 000000000000..d2c8d2671007 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DatabaseAccountConnectionString(Model): + """Connection string for the Cosmos DB account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar connection_string: Value of the connection string + :vartype connection_string: str + :ivar description: Description of the connection string + :vartype description: str + """ + + _validation = { + 'connection_string': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DatabaseAccountConnectionString, self).__init__(**kwargs) + self.connection_string = None + self.description = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters.py index a80f8cc5cc95..bab009244c85 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters.py @@ -18,14 +18,16 @@ class DatabaseAccountCreateUpdateParameters(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The unique resource identifier of the database account. :vartype id: str :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :param location: The location of the resource group to which the resource - belongs. + :param location: Required. The location of the resource group to which the + resource belongs. :type location: str :param tags: :type tags: dict[str, str] @@ -36,10 +38,10 @@ class DatabaseAccountCreateUpdateParameters(Resource): :param consistency_policy: The consistency policy for the Cosmos DB account. :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy - :param locations: An array that contains the georeplication locations - enabled for the Cosmos DB account. + :param locations: Required. An array that contains the georeplication + locations enabled for the Cosmos DB account. :type locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar database_account_offer_type: Default value: "Standard" . + :ivar database_account_offer_type: Required. Default value: "Standard" . :vartype database_account_offer_type: str :param ip_range_filter: Cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included @@ -51,6 +53,8 @@ class DatabaseAccountCreateUpdateParameters(Resource): Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. :type enable_automatic_failover: bool + :param capabilities: List of Cosmos DB capabilities for the account + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] """ _validation = { @@ -74,14 +78,16 @@ class DatabaseAccountCreateUpdateParameters(Resource): 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'str'}, 'ip_range_filter': {'key': 'properties.ipRangeFilter', 'type': 'str'}, 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, } database_account_offer_type = "Standard" - def __init__(self, location, locations, tags=None, kind="GlobalDocumentDB", consistency_policy=None, ip_range_filter=None, enable_automatic_failover=None): - super(DatabaseAccountCreateUpdateParameters, self).__init__(location=location, tags=tags) - self.kind = kind - self.consistency_policy = consistency_policy - self.locations = locations - self.ip_range_filter = ip_range_filter - self.enable_automatic_failover = enable_automatic_failover + def __init__(self, **kwargs): + super(DatabaseAccountCreateUpdateParameters, self).__init__(**kwargs) + self.kind = kwargs.get('kind', "GlobalDocumentDB") + self.consistency_policy = kwargs.get('consistency_policy', None) + self.locations = kwargs.get('locations', None) + self.ip_range_filter = kwargs.get('ip_range_filter', None) + self.enable_automatic_failover = kwargs.get('enable_automatic_failover', None) + self.capabilities = kwargs.get('capabilities', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters_py3.py new file mode 100644 index 000000000000..51e13e4613a7 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class DatabaseAccountCreateUpdateParameters(Resource): + """Parameters to create and update Cosmos DB database accounts. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The unique resource identifier of the database account. + :vartype id: str + :ivar name: The name of the database account. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: Required. The location of the resource group to which the + resource belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param kind: Indicates the type of database account. This can only be set + at database account creation. Possible values include: 'GlobalDocumentDB', + 'MongoDB', 'Parse'. Default value: "GlobalDocumentDB" . + :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind + :param consistency_policy: The consistency policy for the Cosmos DB + account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param locations: Required. An array that contains the georeplication + locations enabled for the Cosmos DB account. + :type locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar database_account_offer_type: Required. Default value: "Standard" . + :vartype database_account_offer_type: str + :param ip_range_filter: Cosmos DB Firewall Support: This value specifies + the set of IP addresses or IP address ranges in CIDR form to be included + as the allowed list of client IPs for a given database account. IP + addresses/ranges must be comma separated and must not contain any spaces. + :type ip_range_filter: str + :param enable_automatic_failover: Enables automatic failover of the write + region in the rare event that the region is unavailable due to an outage. + Automatic failover will result in a new write region for the account and + is chosen based on the failover priorities configured for the account. + :type enable_automatic_failover: bool + :param capabilities: List of Cosmos DB capabilities for the account + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'locations': {'required': True}, + 'database_account_offer_type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'locations': {'key': 'properties.locations', 'type': '[Location]'}, + 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'str'}, + 'ip_range_filter': {'key': 'properties.ipRangeFilter', 'type': 'str'}, + 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + } + + database_account_offer_type = "Standard" + + def __init__(self, *, location: str, locations, tags=None, kind="GlobalDocumentDB", consistency_policy=None, ip_range_filter: str=None, enable_automatic_failover: bool=None, capabilities=None, **kwargs) -> None: + super(DatabaseAccountCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.consistency_policy = consistency_policy + self.locations = locations + self.ip_range_filter = ip_range_filter + self.enable_automatic_failover = enable_automatic_failover + self.capabilities = capabilities diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result.py index 85ea5648c9f2..4238c1c68bd5 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result.py @@ -25,5 +25,6 @@ class DatabaseAccountListConnectionStringsResult(Model): 'connection_strings': {'key': 'connectionStrings', 'type': '[DatabaseAccountConnectionString]'}, } - def __init__(self, connection_strings=None): - self.connection_strings = connection_strings + def __init__(self, **kwargs): + super(DatabaseAccountListConnectionStringsResult, self).__init__(**kwargs) + self.connection_strings = kwargs.get('connection_strings', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result_py3.py new file mode 100644 index 000000000000..dcf39d62634b --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DatabaseAccountListConnectionStringsResult(Model): + """The connection strings for the given database account. + + :param connection_strings: An array that contains the connection strings + for the Cosmos DB account. + :type connection_strings: + list[~azure.mgmt.cosmosdb.models.DatabaseAccountConnectionString] + """ + + _attribute_map = { + 'connection_strings': {'key': 'connectionStrings', 'type': '[DatabaseAccountConnectionString]'}, + } + + def __init__(self, *, connection_strings=None, **kwargs) -> None: + super(DatabaseAccountListConnectionStringsResult, self).__init__(**kwargs) + self.connection_strings = connection_strings diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result.py index 4d775054ac14..8da636886258 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result.py @@ -46,7 +46,8 @@ class DatabaseAccountListKeysResult(Model): 'secondary_readonly_master_key': {'key': 'properties.secondaryReadonlyMasterKey', 'type': 'str'}, } - def __init__(self): + def __init__(self, **kwargs): + super(DatabaseAccountListKeysResult, self).__init__(**kwargs) self.primary_master_key = None self.secondary_master_key = None self.primary_readonly_master_key = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result_py3.py new file mode 100644 index 000000000000..3b060e748026 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DatabaseAccountListKeysResult(Model): + """The access keys for the given database account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar primary_master_key: Base 64 encoded value of the primary read-write + key. + :vartype primary_master_key: str + :ivar secondary_master_key: Base 64 encoded value of the secondary + read-write key. + :vartype secondary_master_key: str + :ivar primary_readonly_master_key: Base 64 encoded value of the primary + read-only key. + :vartype primary_readonly_master_key: str + :ivar secondary_readonly_master_key: Base 64 encoded value of the + secondary read-only key. + :vartype secondary_readonly_master_key: str + """ + + _validation = { + 'primary_master_key': {'readonly': True}, + 'secondary_master_key': {'readonly': True}, + 'primary_readonly_master_key': {'readonly': True}, + 'secondary_readonly_master_key': {'readonly': True}, + } + + _attribute_map = { + 'primary_master_key': {'key': 'primaryMasterKey', 'type': 'str'}, + 'secondary_master_key': {'key': 'secondaryMasterKey', 'type': 'str'}, + 'primary_readonly_master_key': {'key': 'properties.primaryReadonlyMasterKey', 'type': 'str'}, + 'secondary_readonly_master_key': {'key': 'properties.secondaryReadonlyMasterKey', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DatabaseAccountListKeysResult, self).__init__(**kwargs) + self.primary_master_key = None + self.secondary_master_key = None + self.primary_readonly_master_key = None + self.secondary_readonly_master_key = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result.py index 3330353950c6..806ef75fa732 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result.py @@ -36,6 +36,7 @@ class DatabaseAccountListReadOnlyKeysResult(Model): 'secondary_readonly_master_key': {'key': 'secondaryReadonlyMasterKey', 'type': 'str'}, } - def __init__(self): + def __init__(self, **kwargs): + super(DatabaseAccountListReadOnlyKeysResult, self).__init__(**kwargs) self.primary_readonly_master_key = None self.secondary_readonly_master_key = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result_py3.py new file mode 100644 index 000000000000..fc4b99fadd90 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DatabaseAccountListReadOnlyKeysResult(Model): + """The read-only access keys for the given database account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar primary_readonly_master_key: Base 64 encoded value of the primary + read-only key. + :vartype primary_readonly_master_key: str + :ivar secondary_readonly_master_key: Base 64 encoded value of the + secondary read-only key. + :vartype secondary_readonly_master_key: str + """ + + _validation = { + 'primary_readonly_master_key': {'readonly': True}, + 'secondary_readonly_master_key': {'readonly': True}, + } + + _attribute_map = { + 'primary_readonly_master_key': {'key': 'primaryReadonlyMasterKey', 'type': 'str'}, + 'secondary_readonly_master_key': {'key': 'secondaryReadonlyMasterKey', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DatabaseAccountListReadOnlyKeysResult, self).__init__(**kwargs) + self.primary_readonly_master_key = None + self.secondary_readonly_master_key = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters.py index e5102749d50e..c6ce68f18224 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters.py @@ -17,11 +17,16 @@ class DatabaseAccountPatchParameters(Model): :param tags: :type tags: dict[str, str] + :param capabilities: List of Cosmos DB capabilities for the account + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, } - def __init__(self, tags=None): - self.tags = tags + def __init__(self, **kwargs): + super(DatabaseAccountPatchParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.capabilities = kwargs.get('capabilities', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters_py3.py new file mode 100644 index 000000000000..3554c8922fe2 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DatabaseAccountPatchParameters(Model): + """Parameters for patching Azure Cosmos DB database account properties. + + :param tags: + :type tags: dict[str, str] + :param capabilities: List of Cosmos DB capabilities for the account + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + } + + def __init__(self, *, tags=None, capabilities=None, **kwargs) -> None: + super(DatabaseAccountPatchParameters, self).__init__(**kwargs) + self.tags = tags + self.capabilities = capabilities diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_py3.py new file mode 100644 index 000000000000..12bf4fc7b82e --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_py3.py @@ -0,0 +1,118 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class DatabaseAccount(Resource): + """An Azure Cosmos DB database account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The unique resource identifier of the database account. + :vartype id: str + :ivar name: The name of the database account. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: Required. The location of the resource group to which the + resource belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param kind: Indicates the type of database account. This can only be set + at database account creation. Possible values include: 'GlobalDocumentDB', + 'MongoDB', 'Parse'. Default value: "GlobalDocumentDB" . + :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind + :param provisioning_state: + :type provisioning_state: str + :ivar document_endpoint: The connection endpoint for the Cosmos DB + database account. + :vartype document_endpoint: str + :ivar database_account_offer_type: The offer type for the Cosmos DB + database account. Default value: Standard. Possible values include: + 'Standard' + :vartype database_account_offer_type: str or + ~azure.mgmt.cosmosdb.models.DatabaseAccountOfferType + :param ip_range_filter: Cosmos DB Firewall Support: This value specifies + the set of IP addresses or IP address ranges in CIDR form to be included + as the allowed list of client IPs for a given database account. IP + addresses/ranges must be comma separated and must not contain any spaces. + :type ip_range_filter: str + :param enable_automatic_failover: Enables automatic failover of the write + region in the rare event that the region is unavailable due to an outage. + Automatic failover will result in a new write region for the account and + is chosen based on the failover priorities configured for the account. + :type enable_automatic_failover: bool + :param consistency_policy: The consistency policy for the Cosmos DB + database account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param capabilities: List of Cosmos DB capabilities for the account + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :ivar write_locations: An array that contains the write location for the + Cosmos DB account. + :vartype write_locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar read_locations: An array that contains of the read locations enabled + for the Cosmos DB account. + :vartype read_locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar failover_policies: An array that contains the regions ordered by + their failover priorities. + :vartype failover_policies: + list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'document_endpoint': {'readonly': True}, + 'database_account_offer_type': {'readonly': True}, + 'write_locations': {'readonly': True}, + 'read_locations': {'readonly': True}, + 'failover_policies': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'document_endpoint': {'key': 'properties.documentEndpoint', 'type': 'str'}, + 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'DatabaseAccountOfferType'}, + 'ip_range_filter': {'key': 'properties.ipRangeFilter', 'type': 'str'}, + 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, + 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + 'write_locations': {'key': 'properties.writeLocations', 'type': '[Location]'}, + 'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'}, + 'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'}, + } + + def __init__(self, *, location: str, tags=None, kind="GlobalDocumentDB", provisioning_state: str=None, ip_range_filter: str=None, enable_automatic_failover: bool=None, consistency_policy=None, capabilities=None, **kwargs) -> None: + super(DatabaseAccount, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.provisioning_state = provisioning_state + self.document_endpoint = None + self.database_account_offer_type = None + self.ip_range_filter = ip_range_filter + self.enable_automatic_failover = enable_automatic_failover + self.consistency_policy = consistency_policy + self.capabilities = capabilities + self.write_locations = None + self.read_locations = None + self.failover_policies = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters.py index ead004b96057..c122b82647ce 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters.py @@ -15,8 +15,10 @@ class DatabaseAccountRegenerateKeyParameters(Model): """Parameters to regenerate the keys within the database account. - :param key_kind: The access key to regenerate. Possible values include: - 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + All required parameters must be populated in order to send to Azure. + + :param key_kind: Required. The access key to regenerate. Possible values + include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' :type key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind """ @@ -28,5 +30,6 @@ class DatabaseAccountRegenerateKeyParameters(Model): 'key_kind': {'key': 'keyKind', 'type': 'str'}, } - def __init__(self, key_kind): - self.key_kind = key_kind + def __init__(self, **kwargs): + super(DatabaseAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_kind = kwargs.get('key_kind', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..0ab59e91d274 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DatabaseAccountRegenerateKeyParameters(Model): + """Parameters to regenerate the keys within the database account. + + All required parameters must be populated in order to send to Azure. + + :param key_kind: Required. The access key to regenerate. Possible values + include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + :type key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind + """ + + _validation = { + 'key_kind': {'required': True}, + } + + _attribute_map = { + 'key_kind': {'key': 'keyKind', 'type': 'str'}, + } + + def __init__(self, *, key_kind, **kwargs) -> None: + super(DatabaseAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_kind = key_kind diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies.py index a9e8e3ce23c0..465593e38b6e 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies.py @@ -15,13 +15,20 @@ class FailoverPolicies(Model): """The list of new failover policies for the failover priority change. - :param failover_policies: List of failover policies. + All required parameters must be populated in order to send to Azure. + + :param failover_policies: Required. List of failover policies. :type failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] """ + _validation = { + 'failover_policies': {'required': True}, + } + _attribute_map = { 'failover_policies': {'key': 'failoverPolicies', 'type': '[FailoverPolicy]'}, } - def __init__(self, failover_policies=None): - self.failover_policies = failover_policies + def __init__(self, **kwargs): + super(FailoverPolicies, self).__init__(**kwargs) + self.failover_policies = kwargs.get('failover_policies', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies_py3.py new file mode 100644 index 000000000000..ef0230b30f7d --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FailoverPolicies(Model): + """The list of new failover policies for the failover priority change. + + All required parameters must be populated in order to send to Azure. + + :param failover_policies: Required. List of failover policies. + :type failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + """ + + _validation = { + 'failover_policies': {'required': True}, + } + + _attribute_map = { + 'failover_policies': {'key': 'failoverPolicies', 'type': '[FailoverPolicy]'}, + } + + def __init__(self, *, failover_policies, **kwargs) -> None: + super(FailoverPolicies, self).__init__(**kwargs) + self.failover_policies = failover_policies diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy.py index 99cc2769403b..032a8850ec6a 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy.py @@ -42,7 +42,8 @@ class FailoverPolicy(Model): 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, } - def __init__(self, location_name=None, failover_priority=None): + def __init__(self, **kwargs): + super(FailoverPolicy, self).__init__(**kwargs) self.id = None - self.location_name = location_name - self.failover_priority = failover_priority + self.location_name = kwargs.get('location_name', None) + self.failover_priority = kwargs.get('failover_priority', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy_py3.py new file mode 100644 index 000000000000..94451fd116d8 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FailoverPolicy(Model): + """The failover policy for a given region of a database account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique identifier of the region in which the database + account replicates to. Example: <accountName>-<locationName>. + :vartype id: str + :param location_name: The name of the region in which the database account + exists. + :type location_name: str + :param failover_priority: The failover priority of the region. A failover + priority of 0 indicates a write region. The maximum value for a failover + priority = (total number of regions - 1). Failover priority values must be + unique for each of the regions in which the database account exists. + :type failover_priority: int + """ + + _validation = { + 'id': {'readonly': True}, + 'failover_priority': {'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location_name': {'key': 'locationName', 'type': 'str'}, + 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, + } + + def __init__(self, *, location_name: str=None, failover_priority: int=None, **kwargs) -> None: + super(FailoverPolicy, self).__init__(**kwargs) + self.id = None + self.location_name = location_name + self.failover_priority = failover_priority diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location.py index 23fae3cbd515..220c9a4128c0 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location.py @@ -50,9 +50,10 @@ class Location(Model): 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, } - def __init__(self, location_name=None, provisioning_state=None, failover_priority=None): + def __init__(self, **kwargs): + super(Location, self).__init__(**kwargs) self.id = None - self.location_name = location_name + self.location_name = kwargs.get('location_name', None) self.document_endpoint = None - self.provisioning_state = provisioning_state - self.failover_priority = failover_priority + self.provisioning_state = kwargs.get('provisioning_state', None) + self.failover_priority = kwargs.get('failover_priority', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location_py3.py new file mode 100644 index 000000000000..5ef5bbf16998 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Location(Model): + """A region in which the Azure Cosmos DB database account is deployed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique identifier of the region within the database account. + Example: <accountName>-<locationName>. + :vartype id: str + :param location_name: The name of the region. + :type location_name: str + :ivar document_endpoint: The connection endpoint for the specific region. + Example: + https://<accountName>-<locationName>.documents.azure.com:443/ + :vartype document_endpoint: str + :param provisioning_state: + :type provisioning_state: str + :param failover_priority: The failover priority of the region. A failover + priority of 0 indicates a write region. The maximum value for a failover + priority = (total number of regions - 1). Failover priority values must be + unique for each of the regions in which the database account exists. + :type failover_priority: int + """ + + _validation = { + 'id': {'readonly': True}, + 'document_endpoint': {'readonly': True}, + 'failover_priority': {'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location_name': {'key': 'locationName', 'type': 'str'}, + 'document_endpoint': {'key': 'documentEndpoint', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, + } + + def __init__(self, *, location_name: str=None, provisioning_state: str=None, failover_priority: int=None, **kwargs) -> None: + super(Location, self).__init__(**kwargs) + self.id = None + self.location_name = location_name + self.document_endpoint = None + self.provisioning_state = provisioning_state + self.failover_priority = failover_priority diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric.py new file mode 100644 index 000000000000..ab7b78168c72 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Metric(Model): + """Metric data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: datetime + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: datetime + :ivar time_grain: The time grain to be used to summarize the metric + values. + :vartype time_grain: str + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar metric_values: The metric values for the specified time window and + timestep. + :vartype metric_values: list[~azure.mgmt.cosmosdb.models.MetricValue] + """ + + _validation = { + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'time_grain': {'readonly': True}, + 'name': {'readonly': True}, + 'metric_values': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'metric_values': {'key': 'metricValues', 'type': '[MetricValue]'}, + } + + def __init__(self, **kwargs): + super(Metric, self).__init__(**kwargs) + self.start_time = None + self.end_time = None + self.time_grain = None + self.unit = kwargs.get('unit', None) + self.name = None + self.metric_values = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_availability.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_availability.py new file mode 100644 index 000000000000..3158a74ce99a --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_availability.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricAvailability(Model): + """The availability of the metric. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar time_grain: The time grain to be used to summarize the metric + values. + :vartype time_grain: str + :ivar retention: The retention for the metric values. + :vartype retention: str + """ + + _validation = { + 'time_grain': {'readonly': True}, + 'retention': {'readonly': True}, + } + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = None + self.retention = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_availability_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_availability_py3.py new file mode 100644 index 000000000000..0da15e806cb7 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_availability_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricAvailability(Model): + """The availability of the metric. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar time_grain: The time grain to be used to summarize the metric + values. + :vartype time_grain: str + :ivar retention: The retention for the metric values. + :vartype retention: str + """ + + _validation = { + 'time_grain': {'readonly': True}, + 'retention': {'readonly': True}, + } + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = None + self.retention = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition.py new file mode 100644 index 000000000000..7cbbbe13aafb --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricDefinition(Model): + """The definition of a metric. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar metric_availabilities: The list of metric availabilities for the + account. + :vartype metric_availabilities: + list[~azure.mgmt.cosmosdb.models.MetricAvailability] + :ivar primary_aggregation_type: The primary aggregation type of the + metric. Possible values include: 'None', 'Average', 'Total', 'Minimimum', + 'Maximum', 'Last' + :vartype primary_aggregation_type: str or + ~azure.mgmt.cosmosdb.models.PrimaryAggregationType + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar resource_uri: The resource uri of the database. + :vartype resource_uri: str + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + """ + + _validation = { + 'metric_availabilities': {'readonly': True}, + 'primary_aggregation_type': {'readonly': True}, + 'resource_uri': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'metric_availabilities': {'key': 'metricAvailabilities', 'type': '[MetricAvailability]'}, + 'primary_aggregation_type': {'key': 'primaryAggregationType', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + } + + def __init__(self, **kwargs): + super(MetricDefinition, self).__init__(**kwargs) + self.metric_availabilities = None + self.primary_aggregation_type = None + self.unit = kwargs.get('unit', None) + self.resource_uri = None + self.name = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition_paged.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition_paged.py new file mode 100644 index 000000000000..19880602a471 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class MetricDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`MetricDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MetricDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(MetricDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition_py3.py new file mode 100644 index 000000000000..23100a92f942 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricDefinition(Model): + """The definition of a metric. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar metric_availabilities: The list of metric availabilities for the + account. + :vartype metric_availabilities: + list[~azure.mgmt.cosmosdb.models.MetricAvailability] + :ivar primary_aggregation_type: The primary aggregation type of the + metric. Possible values include: 'None', 'Average', 'Total', 'Minimimum', + 'Maximum', 'Last' + :vartype primary_aggregation_type: str or + ~azure.mgmt.cosmosdb.models.PrimaryAggregationType + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar resource_uri: The resource uri of the database. + :vartype resource_uri: str + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + """ + + _validation = { + 'metric_availabilities': {'readonly': True}, + 'primary_aggregation_type': {'readonly': True}, + 'resource_uri': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'metric_availabilities': {'key': 'metricAvailabilities', 'type': '[MetricAvailability]'}, + 'primary_aggregation_type': {'key': 'primaryAggregationType', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + } + + def __init__(self, *, unit=None, **kwargs) -> None: + super(MetricDefinition, self).__init__(**kwargs) + self.metric_availabilities = None + self.primary_aggregation_type = None + self.unit = unit + self.resource_uri = None + self.name = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_name.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_name.py new file mode 100644 index 000000000000..fd3e3d504c9d --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_name.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricName(Model): + """A metric name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The name of the metric. + :vartype value: str + :ivar localized_value: The friendly name of the metric. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_name_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_name_py3.py new file mode 100644 index 000000000000..811d94729969 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_name_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricName(Model): + """A metric name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The name of the metric. + :vartype value: str + :ivar localized_value: The friendly name of the metric. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(MetricName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_paged.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_paged.py new file mode 100644 index 000000000000..a4ad91ebb38e --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class MetricPaged(Paged): + """ + A paging container for iterating over a list of :class:`Metric ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Metric]'} + } + + def __init__(self, *args, **kwargs): + + super(MetricPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_py3.py new file mode 100644 index 000000000000..61f368c2e7a4 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Metric(Model): + """Metric data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: datetime + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: datetime + :ivar time_grain: The time grain to be used to summarize the metric + values. + :vartype time_grain: str + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar metric_values: The metric values for the specified time window and + timestep. + :vartype metric_values: list[~azure.mgmt.cosmosdb.models.MetricValue] + """ + + _validation = { + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'time_grain': {'readonly': True}, + 'name': {'readonly': True}, + 'metric_values': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'metric_values': {'key': 'metricValues', 'type': '[MetricValue]'}, + } + + def __init__(self, *, unit=None, **kwargs) -> None: + super(Metric, self).__init__(**kwargs) + self.start_time = None + self.end_time = None + self.time_grain = None + self.unit = unit + self.name = None + self.metric_values = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_value.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_value.py new file mode 100644 index 000000000000..ba9585752ce4 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_value.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricValue(Model): + """Represents metrics values. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar _count: The number of values for the metric. + :vartype _count: float + :ivar average: The average value of the metric. + :vartype average: float + :ivar maximum: The max value of the metric. + :vartype maximum: float + :ivar minimum: The min value of the metric. + :vartype minimum: float + :ivar timestamp: The metric timestamp (ISO-8601 format). + :vartype timestamp: datetime + :ivar total: The total value of the metric. + :vartype total: float + """ + + _validation = { + '_count': {'readonly': True}, + 'average': {'readonly': True}, + 'maximum': {'readonly': True}, + 'minimum': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'total': {'readonly': True}, + } + + _attribute_map = { + '_count': {'key': '_count', 'type': 'float'}, + 'average': {'key': 'average', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'total': {'key': 'total', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(MetricValue, self).__init__(**kwargs) + self._count = None + self.average = None + self.maximum = None + self.minimum = None + self.timestamp = None + self.total = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_value_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_value_py3.py new file mode 100644 index 000000000000..bbe471459725 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_value_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricValue(Model): + """Represents metrics values. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar _count: The number of values for the metric. + :vartype _count: float + :ivar average: The average value of the metric. + :vartype average: float + :ivar maximum: The max value of the metric. + :vartype maximum: float + :ivar minimum: The min value of the metric. + :vartype minimum: float + :ivar timestamp: The metric timestamp (ISO-8601 format). + :vartype timestamp: datetime + :ivar total: The total value of the metric. + :vartype total: float + """ + + _validation = { + '_count': {'readonly': True}, + 'average': {'readonly': True}, + 'maximum': {'readonly': True}, + 'minimum': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'total': {'readonly': True}, + } + + _attribute_map = { + '_count': {'key': '_count', 'type': 'float'}, + 'average': {'key': 'average', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'total': {'key': 'total', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(MetricValue, self).__init__(**kwargs) + self._count = None + self.average = None + self.maximum = None + self.minimum = None + self.timestamp = None + self.total = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation.py index 38884f313b77..e0445c09f516 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation.py @@ -26,6 +26,7 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, name=None, display=None): - self.name = name - self.display = display + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display.py index e7df666e0e94..3fc650540a64 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display.py @@ -33,8 +33,9 @@ class OperationDisplay(Model): 'description': {'key': 'Description', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None): - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display_py3.py new file mode 100644 index 000000000000..7a2edcb7cd56 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.ResourceProvider + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'Provider', 'type': 'str'}, + 'resource': {'key': 'Resource', 'type': 'str'}, + 'operation': {'key': 'Operation', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_py3.py new file mode 100644 index 000000000000..06e896c83984 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.cosmosdb.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric.py new file mode 100644 index 000000000000..b00c2462067d --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .metric import Metric + + +class PartitionMetric(Metric): + """The metric values for a single partition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: datetime + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: datetime + :ivar time_grain: The time grain to be used to summarize the metric + values. + :vartype time_grain: str + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar metric_values: The metric values for the specified time window and + timestep. + :vartype metric_values: list[~azure.mgmt.cosmosdb.models.MetricValue] + :ivar partition_id: The parition id (GUID identifier) of the metric + values. + :vartype partition_id: str + :ivar partition_key_range_id: The partition key range id (integer + identifier) of the metric values. + :vartype partition_key_range_id: str + """ + + _validation = { + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'time_grain': {'readonly': True}, + 'name': {'readonly': True}, + 'metric_values': {'readonly': True}, + 'partition_id': {'readonly': True}, + 'partition_key_range_id': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'metric_values': {'key': 'metricValues', 'type': '[MetricValue]'}, + 'partition_id': {'key': 'partitionId', 'type': 'str'}, + 'partition_key_range_id': {'key': 'partitionKeyRangeId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PartitionMetric, self).__init__(**kwargs) + self.partition_id = None + self.partition_key_range_id = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric_paged.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric_paged.py new file mode 100644 index 000000000000..edce53740319 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class PartitionMetricPaged(Paged): + """ + A paging container for iterating over a list of :class:`PartitionMetric ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PartitionMetric]'} + } + + def __init__(self, *args, **kwargs): + + super(PartitionMetricPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric_py3.py new file mode 100644 index 000000000000..ef6c7b39306b --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .metric import Metric + + +class PartitionMetric(Metric): + """The metric values for a single partition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: datetime + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: datetime + :ivar time_grain: The time grain to be used to summarize the metric + values. + :vartype time_grain: str + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar metric_values: The metric values for the specified time window and + timestep. + :vartype metric_values: list[~azure.mgmt.cosmosdb.models.MetricValue] + :ivar partition_id: The parition id (GUID identifier) of the metric + values. + :vartype partition_id: str + :ivar partition_key_range_id: The partition key range id (integer + identifier) of the metric values. + :vartype partition_key_range_id: str + """ + + _validation = { + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'time_grain': {'readonly': True}, + 'name': {'readonly': True}, + 'metric_values': {'readonly': True}, + 'partition_id': {'readonly': True}, + 'partition_key_range_id': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'metric_values': {'key': 'metricValues', 'type': '[MetricValue]'}, + 'partition_id': {'key': 'partitionId', 'type': 'str'}, + 'partition_key_range_id': {'key': 'partitionKeyRangeId', 'type': 'str'}, + } + + def __init__(self, *, unit=None, **kwargs) -> None: + super(PartitionMetric, self).__init__(unit=unit, **kwargs) + self.partition_id = None + self.partition_key_range_id = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage.py new file mode 100644 index 000000000000..e19c3f5d49ad --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .usage import Usage + + +class PartitionUsage(Usage): + """The partition level usage data for a usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar quota_period: The quota period used to summarize the usage values. + :vartype quota_period: str + :ivar limit: Maximum value for this metric + :vartype limit: int + :ivar current_value: Current value for this metric + :vartype current_value: int + :ivar partition_id: The parition id (GUID identifier) of the usages. + :vartype partition_id: str + :ivar partition_key_range_id: The partition key range id (integer + identifier) of the usages. + :vartype partition_key_range_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'limit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'partition_id': {'readonly': True}, + 'partition_key_range_id': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'partition_id': {'key': 'partitionId', 'type': 'str'}, + 'partition_key_range_id': {'key': 'partitionKeyRangeId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PartitionUsage, self).__init__(**kwargs) + self.partition_id = None + self.partition_key_range_id = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage_paged.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage_paged.py new file mode 100644 index 000000000000..2fbbc8eb4ac7 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class PartitionUsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`PartitionUsage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PartitionUsage]'} + } + + def __init__(self, *args, **kwargs): + + super(PartitionUsagePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage_py3.py new file mode 100644 index 000000000000..e0e9603a3113 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .usage import Usage + + +class PartitionUsage(Usage): + """The partition level usage data for a usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar quota_period: The quota period used to summarize the usage values. + :vartype quota_period: str + :ivar limit: Maximum value for this metric + :vartype limit: int + :ivar current_value: Current value for this metric + :vartype current_value: int + :ivar partition_id: The parition id (GUID identifier) of the usages. + :vartype partition_id: str + :ivar partition_key_range_id: The partition key range id (integer + identifier) of the usages. + :vartype partition_key_range_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'limit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'partition_id': {'readonly': True}, + 'partition_key_range_id': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'partition_id': {'key': 'partitionId', 'type': 'str'}, + 'partition_key_range_id': {'key': 'partitionKeyRangeId', 'type': 'str'}, + } + + def __init__(self, *, unit=None, **kwargs) -> None: + super(PartitionUsage, self).__init__(unit=unit, **kwargs) + self.partition_id = None + self.partition_key_range_id = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric.py new file mode 100644 index 000000000000..183b1cedab90 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PercentileMetric(Model): + """Percentile Metric data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: datetime + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: datetime + :ivar time_grain: The time grain to be used to summarize the metric + values. + :vartype time_grain: str + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar metric_values: The percentile metric values for the specified time + window and timestep. + :vartype metric_values: + list[~azure.mgmt.cosmosdb.models.PercentileMetricValue] + """ + + _validation = { + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'time_grain': {'readonly': True}, + 'name': {'readonly': True}, + 'metric_values': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'metric_values': {'key': 'metricValues', 'type': '[PercentileMetricValue]'}, + } + + def __init__(self, **kwargs): + super(PercentileMetric, self).__init__(**kwargs) + self.start_time = None + self.end_time = None + self.time_grain = None + self.unit = kwargs.get('unit', None) + self.name = None + self.metric_values = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_paged.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_paged.py new file mode 100644 index 000000000000..4cd146af973e --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class PercentileMetricPaged(Paged): + """ + A paging container for iterating over a list of :class:`PercentileMetric ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PercentileMetric]'} + } + + def __init__(self, *args, **kwargs): + + super(PercentileMetricPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_py3.py new file mode 100644 index 000000000000..665dad9c9a04 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_py3.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PercentileMetric(Model): + """Percentile Metric data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: datetime + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: datetime + :ivar time_grain: The time grain to be used to summarize the metric + values. + :vartype time_grain: str + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar metric_values: The percentile metric values for the specified time + window and timestep. + :vartype metric_values: + list[~azure.mgmt.cosmosdb.models.PercentileMetricValue] + """ + + _validation = { + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'time_grain': {'readonly': True}, + 'name': {'readonly': True}, + 'metric_values': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'metric_values': {'key': 'metricValues', 'type': '[PercentileMetricValue]'}, + } + + def __init__(self, *, unit=None, **kwargs) -> None: + super(PercentileMetric, self).__init__(**kwargs) + self.start_time = None + self.end_time = None + self.time_grain = None + self.unit = unit + self.name = None + self.metric_values = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_value.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_value.py new file mode 100644 index 000000000000..5e11e347b3c5 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_value.py @@ -0,0 +1,89 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .metric_value import MetricValue + + +class PercentileMetricValue(MetricValue): + """Represents percentile metrics values. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar _count: The number of values for the metric. + :vartype _count: float + :ivar average: The average value of the metric. + :vartype average: float + :ivar maximum: The max value of the metric. + :vartype maximum: float + :ivar minimum: The min value of the metric. + :vartype minimum: float + :ivar timestamp: The metric timestamp (ISO-8601 format). + :vartype timestamp: datetime + :ivar total: The total value of the metric. + :vartype total: float + :ivar p10: The 10th percentile value for the metric. + :vartype p10: float + :ivar p25: The 25th percentile value for the metric. + :vartype p25: float + :ivar p50: The 50th percentile value for the metric. + :vartype p50: float + :ivar p75: The 75th percentile value for the metric. + :vartype p75: float + :ivar p90: The 90th percentile value for the metric. + :vartype p90: float + :ivar p95: The 95th percentile value for the metric. + :vartype p95: float + :ivar p99: The 99th percentile value for the metric. + :vartype p99: float + """ + + _validation = { + '_count': {'readonly': True}, + 'average': {'readonly': True}, + 'maximum': {'readonly': True}, + 'minimum': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'total': {'readonly': True}, + 'p10': {'readonly': True}, + 'p25': {'readonly': True}, + 'p50': {'readonly': True}, + 'p75': {'readonly': True}, + 'p90': {'readonly': True}, + 'p95': {'readonly': True}, + 'p99': {'readonly': True}, + } + + _attribute_map = { + '_count': {'key': '_count', 'type': 'float'}, + 'average': {'key': 'average', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'total': {'key': 'total', 'type': 'float'}, + 'p10': {'key': 'P10', 'type': 'float'}, + 'p25': {'key': 'P25', 'type': 'float'}, + 'p50': {'key': 'P50', 'type': 'float'}, + 'p75': {'key': 'P75', 'type': 'float'}, + 'p90': {'key': 'P90', 'type': 'float'}, + 'p95': {'key': 'P95', 'type': 'float'}, + 'p99': {'key': 'P99', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(PercentileMetricValue, self).__init__(**kwargs) + self.p10 = None + self.p25 = None + self.p50 = None + self.p75 = None + self.p90 = None + self.p95 = None + self.p99 = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_value_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_value_py3.py new file mode 100644 index 000000000000..a4e2b9cd87c0 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_value_py3.py @@ -0,0 +1,89 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .metric_value import MetricValue + + +class PercentileMetricValue(MetricValue): + """Represents percentile metrics values. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar _count: The number of values for the metric. + :vartype _count: float + :ivar average: The average value of the metric. + :vartype average: float + :ivar maximum: The max value of the metric. + :vartype maximum: float + :ivar minimum: The min value of the metric. + :vartype minimum: float + :ivar timestamp: The metric timestamp (ISO-8601 format). + :vartype timestamp: datetime + :ivar total: The total value of the metric. + :vartype total: float + :ivar p10: The 10th percentile value for the metric. + :vartype p10: float + :ivar p25: The 25th percentile value for the metric. + :vartype p25: float + :ivar p50: The 50th percentile value for the metric. + :vartype p50: float + :ivar p75: The 75th percentile value for the metric. + :vartype p75: float + :ivar p90: The 90th percentile value for the metric. + :vartype p90: float + :ivar p95: The 95th percentile value for the metric. + :vartype p95: float + :ivar p99: The 99th percentile value for the metric. + :vartype p99: float + """ + + _validation = { + '_count': {'readonly': True}, + 'average': {'readonly': True}, + 'maximum': {'readonly': True}, + 'minimum': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'total': {'readonly': True}, + 'p10': {'readonly': True}, + 'p25': {'readonly': True}, + 'p50': {'readonly': True}, + 'p75': {'readonly': True}, + 'p90': {'readonly': True}, + 'p95': {'readonly': True}, + 'p99': {'readonly': True}, + } + + _attribute_map = { + '_count': {'key': '_count', 'type': 'float'}, + 'average': {'key': 'average', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'total': {'key': 'total', 'type': 'float'}, + 'p10': {'key': 'P10', 'type': 'float'}, + 'p25': {'key': 'P25', 'type': 'float'}, + 'p50': {'key': 'P50', 'type': 'float'}, + 'p75': {'key': 'P75', 'type': 'float'}, + 'p90': {'key': 'P90', 'type': 'float'}, + 'p95': {'key': 'P95', 'type': 'float'}, + 'p99': {'key': 'P99', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(PercentileMetricValue, self).__init__(, **kwargs) + self.p10 = None + self.p25 = None + self.p50 = None + self.p75 = None + self.p90 = None + self.p95 = None + self.p99 = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource.py index 282c2554d6fe..2301bf320b7a 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource.py @@ -18,14 +18,16 @@ class Resource(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The unique resource identifier of the database account. :vartype id: str :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :param location: The location of the resource group to which the resource - belongs. + :param location: Required. The location of the resource group to which the + resource belongs. :type location: str :param tags: :type tags: dict[str, str] @@ -46,9 +48,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource_py3.py new file mode 100644 index 000000000000..58f36e19ff13 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """A database account resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The unique resource identifier of the database account. + :vartype id: str + :ivar name: The name of the database account. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: Required. The location of the resource group to which the + resource belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage.py new file mode 100644 index 000000000000..1564bd6ad3b8 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """The usage data for a usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar quota_period: The quota period used to summarize the usage values. + :vartype quota_period: str + :ivar limit: Maximum value for this metric + :vartype limit: int + :ivar current_value: Current value for this metric + :vartype current_value: int + """ + + _validation = { + 'name': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'limit': {'readonly': True}, + 'current_value': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = kwargs.get('unit', None) + self.name = None + self.quota_period = None + self.limit = None + self.current_value = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage_paged.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage_paged.py new file mode 100644 index 000000000000..dba4e1cb4ecd --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage_py3.py new file mode 100644 index 000000000000..287f0d9dc038 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """The usage data for a usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar quota_period: The quota period used to summarize the usage values. + :vartype quota_period: str + :ivar limit: Maximum value for this metric + :vartype limit: int + :ivar current_value: Current value for this metric + :vartype current_value: int + """ + + _validation = { + 'name': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'limit': {'readonly': True}, + 'current_value': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + } + + def __init__(self, *, unit=None, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = unit + self.name = None + self.quota_period = None + self.limit = None + self.current_value = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py index e113a15d6250..880f85de97b8 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py @@ -11,8 +11,30 @@ from .database_accounts_operations import DatabaseAccountsOperations from .operations import Operations +from .database_operations import DatabaseOperations +from .collection_operations import CollectionOperations +from .collection_region_operations import CollectionRegionOperations +from .database_account_region_operations import DatabaseAccountRegionOperations +from .percentile_source_target_operations import PercentileSourceTargetOperations +from .percentile_target_operations import PercentileTargetOperations +from .percentile_operations import PercentileOperations +from .collection_partition_region_operations import CollectionPartitionRegionOperations +from .collection_partition_operations import CollectionPartitionOperations +from .partition_key_range_id_operations import PartitionKeyRangeIdOperations +from .partition_key_range_id_region_operations import PartitionKeyRangeIdRegionOperations __all__ = [ 'DatabaseAccountsOperations', 'Operations', + 'DatabaseOperations', + 'CollectionOperations', + 'CollectionRegionOperations', + 'DatabaseAccountRegionOperations', + 'PercentileSourceTargetOperations', + 'PercentileTargetOperations', + 'PercentileOperations', + 'CollectionPartitionRegionOperations', + 'CollectionPartitionOperations', + 'PartitionKeyRangeIdOperations', + 'PartitionKeyRangeIdRegionOperations', ] diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_operations.py new file mode 100644 index 000000000000..b5dc016df775 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_operations.py @@ -0,0 +1,283 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class CollectionOperations(object): + """CollectionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-08" + + self.config = config + + def list_metrics( + self, resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers=None, raw=False, **operation_config): + """Retrieves the metrics determined by the given filter for the given + database account and collection. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_rid: Cosmos DB database rid. + :type database_rid: str + :param collection_rid: Cosmos DB collection rid. + :type collection_rid: str + :param filter: An OData filter expression that describes a subset of + metrics to return. The parameters that can be filtered are name.value + (name of the metric, can have an or of multiple names), startTime, + endTime, and timeGrain. The supported operator is eq. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Metric + :rtype: + ~azure.mgmt.cosmosdb.models.MetricPaged[~azure.mgmt.cosmosdb.models.Metric] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metrics.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseRid': self._serialize.url("database_rid", database_rid, 'str'), + 'collectionRid': self._serialize.url("collection_rid", collection_rid, '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') + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.MetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics'} + + def list_usages( + self, resource_group_name, account_name, database_rid, collection_rid, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieves the usages (most recent storage data) for the given + collection. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_rid: Cosmos DB database rid. + :type database_rid: str + :param collection_rid: Cosmos DB collection rid. + :type collection_rid: str + :param filter: An OData filter expression that describes a subset of + usages to return. The supported parameter is name.value (name of the + metric, can have an or of multiple names). + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Usage + :rtype: + ~azure.mgmt.cosmosdb.models.UsagePaged[~azure.mgmt.cosmosdb.models.Usage] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseRid': self._serialize.url("database_rid", database_rid, 'str'), + 'collectionRid': self._serialize.url("collection_rid", collection_rid, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages'} + + def list_metric_definitions( + self, resource_group_name, account_name, database_rid, collection_rid, custom_headers=None, raw=False, **operation_config): + """Retrieves metric defintions for the given collection. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_rid: Cosmos DB database rid. + :type database_rid: str + :param collection_rid: Cosmos DB collection rid. + :type collection_rid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of MetricDefinition + :rtype: + ~azure.mgmt.cosmosdb.models.MetricDefinitionPaged[~azure.mgmt.cosmosdb.models.MetricDefinition] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metric_definitions.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseRid': self._serialize.url("database_rid", database_rid, 'str'), + 'collectionRid': self._serialize.url("collection_rid", collection_rid, '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_operations.py new file mode 100644 index 000000000000..7161a7d94b99 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_operations.py @@ -0,0 +1,206 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class CollectionPartitionOperations(object): + """CollectionPartitionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-08" + + self.config = config + + def list_metrics( + self, resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers=None, raw=False, **operation_config): + """Retrieves the metrics determined by the given filter for the given + collection, split by partition. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_rid: Cosmos DB database rid. + :type database_rid: str + :param collection_rid: Cosmos DB collection rid. + :type collection_rid: str + :param filter: An OData filter expression that describes a subset of + metrics to return. The parameters that can be filtered are name.value + (name of the metric, can have an or of multiple names), startTime, + endTime, and timeGrain. The supported operator is eq. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PartitionMetric + :rtype: + ~azure.mgmt.cosmosdb.models.PartitionMetricPaged[~azure.mgmt.cosmosdb.models.PartitionMetric] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metrics.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseRid': self._serialize.url("database_rid", database_rid, 'str'), + 'collectionRid': self._serialize.url("collection_rid", collection_rid, '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') + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PartitionMetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PartitionMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics'} + + def list_usages( + self, resource_group_name, account_name, database_rid, collection_rid, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieves the usages (most recent storage data) for the given + collection, split by partition. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_rid: Cosmos DB database rid. + :type database_rid: str + :param collection_rid: Cosmos DB collection rid. + :type collection_rid: str + :param filter: An OData filter expression that describes a subset of + usages to return. The supported parameter is name.value (name of the + metric, can have an or of multiple names). + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PartitionUsage + :rtype: + ~azure.mgmt.cosmosdb.models.PartitionUsagePaged[~azure.mgmt.cosmosdb.models.PartitionUsage] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseRid': self._serialize.url("database_rid", database_rid, 'str'), + 'collectionRid': self._serialize.url("collection_rid", collection_rid, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PartitionUsagePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PartitionUsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_region_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_region_operations.py new file mode 100644 index 000000000000..6e0db4e6a432 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_region_operations.py @@ -0,0 +1,126 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class CollectionPartitionRegionOperations(object): + """CollectionPartitionRegionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-08" + + self.config = config + + def list_metrics( + self, resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers=None, raw=False, **operation_config): + """Retrieves the metrics determined by the given filter for the given + collection and region, split by partition. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param region: Cosmos DB region, with spaces between words and each + word capitalized. + :type region: str + :param database_rid: Cosmos DB database rid. + :type database_rid: str + :param collection_rid: Cosmos DB collection rid. + :type collection_rid: str + :param filter: An OData filter expression that describes a subset of + metrics to return. The parameters that can be filtered are name.value + (name of the metric, can have an or of multiple names), startTime, + endTime, and timeGrain. The supported operator is eq. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PartitionMetric + :rtype: + ~azure.mgmt.cosmosdb.models.PartitionMetricPaged[~azure.mgmt.cosmosdb.models.PartitionMetric] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metrics.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'region': self._serialize.url("region", region, 'str'), + 'databaseRid': self._serialize.url("database_rid", database_rid, 'str'), + 'collectionRid': self._serialize.url("collection_rid", collection_rid, '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') + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PartitionMetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PartitionMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_region_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_region_operations.py new file mode 100644 index 000000000000..de907ce6479b --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_region_operations.py @@ -0,0 +1,126 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class CollectionRegionOperations(object): + """CollectionRegionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-08" + + self.config = config + + def list_metrics( + self, resource_group_name, account_name, region, database_rid, collection_rid, filter, custom_headers=None, raw=False, **operation_config): + """Retrieves the metrics determined by the given filter for the given + database account, collection and region. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param region: Cosmos DB region, with spaces between words and each + word capitalized. + :type region: str + :param database_rid: Cosmos DB database rid. + :type database_rid: str + :param collection_rid: Cosmos DB collection rid. + :type collection_rid: str + :param filter: An OData filter expression that describes a subset of + metrics to return. The parameters that can be filtered are name.value + (name of the metric, can have an or of multiple names), startTime, + endTime, and timeGrain. The supported operator is eq. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Metric + :rtype: + ~azure.mgmt.cosmosdb.models.MetricPaged[~azure.mgmt.cosmosdb.models.Metric] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metrics.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'region': self._serialize.url("region", region, 'str'), + 'databaseRid': self._serialize.url("database_rid", database_rid, 'str'), + 'collectionRid': self._serialize.url("collection_rid", collection_rid, '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') + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.MetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_account_region_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_account_region_operations.py new file mode 100644 index 000000000000..787b0bae785b --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_account_region_operations.py @@ -0,0 +1,120 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DatabaseAccountRegionOperations(object): + """DatabaseAccountRegionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-08" + + self.config = config + + def list_metrics( + self, resource_group_name, account_name, region, filter, custom_headers=None, raw=False, **operation_config): + """Retrieves the metrics determined by the given filter for the given + database account and region. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param region: Cosmos DB region, with spaces between words and each + word capitalized. + :type region: str + :param filter: An OData filter expression that describes a subset of + metrics to return. The parameters that can be filtered are name.value + (name of the metric, can have an or of multiple names), startTime, + endTime, and timeGrain. The supported operator is eq. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Metric + :rtype: + ~azure.mgmt.cosmosdb.models.MetricPaged[~azure.mgmt.cosmosdb.models.Metric] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metrics.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'region': self._serialize.url("region", region, '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') + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.MetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_accounts_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_accounts_operations.py index b918ac54df0f..c6bfb6636de9 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_accounts_operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_accounts_operations.py @@ -12,7 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -23,10 +24,12 @@ class DatabaseAccountsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -56,7 +59,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + url = self.get.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -80,7 +83,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -97,31 +100,15 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'} - def patch( - self, resource_group_name, account_name, tags=None, custom_headers=None, raw=False, **operation_config): - """Patches the properties of an existing Azure Cosmos DB database account. - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. - :type account_name: str - :param tags: - :type tags: dict[str, str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - DatabaseAccount or ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.DatabaseAccount] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - update_parameters = models.DatabaseAccountPatchParameters(tags=tags) + def _patch_initial( + self, resource_group_name, account_name, tags=None, capabilities=None, custom_headers=None, raw=False, **operation_config): + update_parameters = models.DatabaseAccountPatchParameters(tags=tags, capabilities=capabilities) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + url = self.patch.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -147,31 +134,63 @@ def patch( body_content = self._serialize.body(update_parameters, 'DatabaseAccountPatchParameters') # Construct and send request - def long_running_send(): + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.patch(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - def get_long_running_status(status_link, headers=None): + deserialized = None - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if response.status_code == 200: + deserialized = self._deserialize('DatabaseAccount', response) - def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + return deserialized - deserialized = None + def patch( + self, resource_group_name, account_name, tags=None, capabilities=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Patches the properties of an existing Azure Cosmos DB database account. - if response.status_code == 200: - deserialized = self._deserialize('DatabaseAccount', response) + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param tags: + :type tags: dict[str, str] + :param capabilities: List of Cosmos DB capabilities for the account + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DatabaseAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.DatabaseAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.DatabaseAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._patch_initial( + resource_group_name=resource_group_name, + account_name=account_name, + tags=tags, + capabilities=capabilities, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DatabaseAccount', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -179,41 +198,20 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'} - def create_or_update( - self, resource_group_name, account_name, create_update_parameters, custom_headers=None, raw=False, **operation_config): - """Creates or updates an Azure Cosmos DB database account. - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. - :type account_name: str - :param create_update_parameters: The parameters to provide for the - current database account. - :type create_update_parameters: - ~azure.mgmt.cosmosdb.models.DatabaseAccountCreateUpdateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - DatabaseAccount or ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.DatabaseAccount] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_or_update_initial( + self, resource_group_name, account_name, create_update_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -239,31 +237,62 @@ def create_or_update( body_content = self._serialize.body(create_update_parameters, 'DatabaseAccountCreateUpdateParameters') # Construct and send request - def long_running_send(): + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - def get_long_running_status(status_link, headers=None): + deserialized = None - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if response.status_code == 200: + deserialized = self._deserialize('DatabaseAccount', response) - def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + return deserialized - deserialized = None + def create_or_update( + self, resource_group_name, account_name, create_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates an Azure Cosmos DB database account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param create_update_parameters: The parameters to provide for the + current database account. + :type create_update_parameters: + ~azure.mgmt.cosmosdb.models.DatabaseAccountCreateUpdateParameters + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DatabaseAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.DatabaseAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.DatabaseAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + create_update_parameters=create_update_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) - if response.status_code == 200: - deserialized = self._deserialize('DatabaseAccount', response) + def get_long_running_output(response): + deserialized = self._deserialize('DatabaseAccount', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -271,36 +300,20 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'} - def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Deletes an existing Azure Cosmos DB database account. - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. - :type account_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _delete_initial( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + url = self.delete.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -323,69 +336,66 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): - - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) - - def get_long_running_output(response): + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + client_raw_response = ClientRawResponse(None, response) + return client_raw_response - def failover_priority_change( - self, resource_group_name, account_name, failover_policies=None, custom_headers=None, raw=False, **operation_config): - """Changes the failover priority for the Azure Cosmos DB database account. - A failover priority of 0 indicates a write region. The maximum value - for a failover priority = (total number of regions - 1). Failover - priority values must be unique for each of the regions in which the - database account exists. + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing Azure Cosmos DB database account. :param resource_group_name: Name of an Azure resource group. :type resource_group_name: str :param account_name: Cosmos DB database account name. :type account_name: str - :param failover_policies: List of failover policies. - :type failover_policies: - list[~azure.mgmt.cosmosdb.models.FailoverPolicy] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'} + + + def _failover_priority_change_initial( + self, resource_group_name, account_name, failover_policies, custom_headers=None, raw=False, **operation_config): failover_parameters = models.FailoverPolicies(failover_policies=failover_policies) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange' + url = self.failover_priority_change.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -411,41 +421,67 @@ def failover_priority_change( body_content = self._serialize.body(failover_parameters, 'FailoverPolicies') # Construct and send request - def long_running_send(): - - request = self._client.post(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - def get_long_running_status(status_link, headers=None): + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response - def get_long_running_output(response): + def failover_priority_change( + self, resource_group_name, account_name, failover_policies, custom_headers=None, raw=False, polling=True, **operation_config): + """Changes the failover priority for the Azure Cosmos DB database account. + A failover priority of 0 indicates a write region. The maximum value + for a failover priority = (total number of regions - 1). Failover + priority values must be unique for each of the regions in which the + database account exists. - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param failover_policies: List of failover policies. + :type failover_policies: + list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._failover_priority_change_initial( + resource_group_name=resource_group_name, + account_name=account_name, + failover_policies=failover_policies, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + def get_long_running_output(response): if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + failover_priority_change.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -466,7 +502,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -493,7 +529,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -511,6 +547,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -533,7 +570,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts' + 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') @@ -561,7 +598,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -579,6 +616,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts'} def list_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -601,7 +639,7 @@ def list_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -625,7 +663,7 @@ def list_keys( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -642,6 +680,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys'} def list_connection_strings( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -665,7 +704,7 @@ def list_connection_strings( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings' + url = self.list_connection_strings.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -689,7 +728,7 @@ def list_connection_strings( # Construct and send request request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -706,6 +745,7 @@ def list_connection_strings( return client_raw_response return deserialized + list_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings'} def list_read_only_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -729,7 +769,7 @@ def list_read_only_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys' + url = self.list_read_only_keys.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -753,7 +793,7 @@ def list_read_only_keys( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -770,33 +810,15 @@ def list_read_only_keys( return client_raw_response return deserialized + list_read_only_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys'} - def regenerate_key( - self, resource_group_name, account_name, key_kind, custom_headers=None, raw=False, **operation_config): - """Regenerates an access key for the specified Azure Cosmos DB database - account. - :param resource_group_name: Name of an Azure resource group. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. - :type account_name: str - :param key_kind: The access key to regenerate. Possible values - include: 'primary', 'secondary', 'primaryReadonly', - 'secondaryReadonly' - :type key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _regenerate_key_initial( + self, resource_group_name, account_name, key_kind, custom_headers=None, raw=False, **operation_config): key_to_regenerate = models.DatabaseAccountRegenerateKeyParameters(key_kind=key_kind) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -822,41 +844,65 @@ def regenerate_key( body_content = self._serialize.body(key_to_regenerate, 'DatabaseAccountRegenerateKeyParameters') # Construct and send request - def long_running_send(): - - request = self._client.post(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - def get_long_running_status(status_link, headers=None): + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response - def get_long_running_output(response): + def regenerate_key( + self, resource_group_name, account_name, key_kind, custom_headers=None, raw=False, polling=True, **operation_config): + """Regenerates an access key for the specified Azure Cosmos DB database + account. - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param key_kind: The access key to regenerate. Possible values + include: 'primary', 'secondary', 'primaryReadonly', + 'secondaryReadonly' + :type key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._regenerate_key_initial( + resource_group_name=resource_group_name, + account_name=account_name, + key_kind=key_kind, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + def get_long_running_output(response): if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey'} def check_name_exists( self, account_name, custom_headers=None, raw=False, **operation_config): @@ -876,7 +922,7 @@ def check_name_exists( :raises: :class:`CloudError` """ # Construct URL - url = '/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}' + url = self.check_name_exists.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) } @@ -898,7 +944,7 @@ def check_name_exists( # Construct and send request request = self._client.head(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200, 404]: exp = CloudError(response) @@ -910,3 +956,230 @@ def check_name_exists( client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + check_name_exists.metadata = {'url': '/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}'} + + def list_metrics( + self, resource_group_name, account_name, filter, custom_headers=None, raw=False, **operation_config): + """Retrieves the metrics determined by the given filter for the given + database account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param filter: An OData filter expression that describes a subset of + metrics to return. The parameters that can be filtered are name.value + (name of the metric, can have an or of multiple names), startTime, + endTime, and timeGrain. The supported operator is eq. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Metric + :rtype: + ~azure.mgmt.cosmosdb.models.MetricPaged[~azure.mgmt.cosmosdb.models.Metric] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metrics.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) + } + 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') + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.MetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics'} + + def list_usages( + self, resource_group_name, account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieves the usages (most recent data) for the given database account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param filter: An OData filter expression that describes a subset of + usages to return. The supported parameter is name.value (name of the + metric, can have an or of multiple names). + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Usage + :rtype: + ~azure.mgmt.cosmosdb.models.UsagePaged[~azure.mgmt.cosmosdb.models.Usage] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages'} + + def list_metric_definitions( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Retrieves metric defintions for the given database account. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of MetricDefinition + :rtype: + ~azure.mgmt.cosmosdb.models.MetricDefinitionPaged[~azure.mgmt.cosmosdb.models.MetricDefinition] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metric_definitions.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_operations.py new file mode 100644 index 000000000000..c9cb0713069b --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_operations.py @@ -0,0 +1,273 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DatabaseOperations(object): + """DatabaseOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-08" + + self.config = config + + def list_metrics( + self, resource_group_name, account_name, database_rid, filter, custom_headers=None, raw=False, **operation_config): + """Retrieves the metrics determined by the given filter for the given + database account and database. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_rid: Cosmos DB database rid. + :type database_rid: str + :param filter: An OData filter expression that describes a subset of + metrics to return. The parameters that can be filtered are name.value + (name of the metric, can have an or of multiple names), startTime, + endTime, and timeGrain. The supported operator is eq. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Metric + :rtype: + ~azure.mgmt.cosmosdb.models.MetricPaged[~azure.mgmt.cosmosdb.models.Metric] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metrics.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseRid': self._serialize.url("database_rid", database_rid, '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') + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.MetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics'} + + def list_usages( + self, resource_group_name, account_name, database_rid, filter=None, custom_headers=None, raw=False, **operation_config): + """Retrieves the usages (most recent data) for the given database. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_rid: Cosmos DB database rid. + :type database_rid: str + :param filter: An OData filter expression that describes a subset of + usages to return. The supported parameter is name.value (name of the + metric, can have an or of multiple names). + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Usage + :rtype: + ~azure.mgmt.cosmosdb.models.UsagePaged[~azure.mgmt.cosmosdb.models.Usage] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseRid': self._serialize.url("database_rid", database_rid, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages'} + + def list_metric_definitions( + self, resource_group_name, account_name, database_rid, custom_headers=None, raw=False, **operation_config): + """Retrieves metric defintions for the given database. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_rid: Cosmos DB database rid. + :type database_rid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of MetricDefinition + :rtype: + ~azure.mgmt.cosmosdb.models.MetricDefinitionPaged[~azure.mgmt.cosmosdb.models.MetricDefinition] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metric_definitions.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseRid': self._serialize.url("database_rid", database_rid, '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/operations.py index d35e4bac2e90..245c7d5749b6 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/operations.py @@ -22,10 +22,12 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.DocumentDB/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -76,7 +78,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -94,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.DocumentDB/operations'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_operations.py new file mode 100644 index 000000000000..ae0f9366a7ba --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_operations.py @@ -0,0 +1,126 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PartitionKeyRangeIdOperations(object): + """PartitionKeyRangeIdOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-08" + + self.config = config + + def list_metrics( + self, resource_group_name, account_name, database_rid, collection_rid, partition_key_range_id, filter, custom_headers=None, raw=False, **operation_config): + """Retrieves the metrics determined by the given filter for the given + partition key range id. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_rid: Cosmos DB database rid. + :type database_rid: str + :param collection_rid: Cosmos DB collection rid. + :type collection_rid: str + :param partition_key_range_id: Partition Key Range Id for which to get + data. + :type partition_key_range_id: str + :param filter: An OData filter expression that describes a subset of + metrics to return. The parameters that can be filtered are name.value + (name of the metric, can have an or of multiple names), startTime, + endTime, and timeGrain. The supported operator is eq. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PartitionMetric + :rtype: + ~azure.mgmt.cosmosdb.models.PartitionMetricPaged[~azure.mgmt.cosmosdb.models.PartitionMetric] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metrics.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'databaseRid': self._serialize.url("database_rid", database_rid, 'str'), + 'collectionRid': self._serialize.url("collection_rid", collection_rid, 'str'), + 'partitionKeyRangeId': self._serialize.url("partition_key_range_id", partition_key_range_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') + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PartitionMetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PartitionMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_region_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_region_operations.py new file mode 100644 index 000000000000..d8299349f17a --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_region_operations.py @@ -0,0 +1,130 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PartitionKeyRangeIdRegionOperations(object): + """PartitionKeyRangeIdRegionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-08" + + self.config = config + + def list_metrics( + self, resource_group_name, account_name, region, database_rid, collection_rid, partition_key_range_id, filter, custom_headers=None, raw=False, **operation_config): + """Retrieves the metrics determined by the given filter for the given + partition key range id and region. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param region: Cosmos DB region, with spaces between words and each + word capitalized. + :type region: str + :param database_rid: Cosmos DB database rid. + :type database_rid: str + :param collection_rid: Cosmos DB collection rid. + :type collection_rid: str + :param partition_key_range_id: Partition Key Range Id for which to get + data. + :type partition_key_range_id: str + :param filter: An OData filter expression that describes a subset of + metrics to return. The parameters that can be filtered are name.value + (name of the metric, can have an or of multiple names), startTime, + endTime, and timeGrain. The supported operator is eq. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PartitionMetric + :rtype: + ~azure.mgmt.cosmosdb.models.PartitionMetricPaged[~azure.mgmt.cosmosdb.models.PartitionMetric] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metrics.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'region': self._serialize.url("region", region, 'str'), + 'databaseRid': self._serialize.url("database_rid", database_rid, 'str'), + 'collectionRid': self._serialize.url("collection_rid", collection_rid, 'str'), + 'partitionKeyRangeId': self._serialize.url("partition_key_range_id", partition_key_range_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') + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PartitionMetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PartitionMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_operations.py new file mode 100644 index 000000000000..adf7d5313b57 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_operations.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PercentileOperations(object): + """PercentileOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-08" + + self.config = config + + def list_metrics( + self, resource_group_name, account_name, filter, custom_headers=None, raw=False, **operation_config): + """Retrieves the metrics determined by the given filter for the given + database account. This url is only for PBS and Replication Latency + data. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param filter: An OData filter expression that describes a subset of + metrics to return. The parameters that can be filtered are name.value + (name of the metric, can have an or of multiple names), startTime, + endTime, and timeGrain. The supported operator is eq. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PercentileMetric + :rtype: + ~azure.mgmt.cosmosdb.models.PercentileMetricPaged[~azure.mgmt.cosmosdb.models.PercentileMetric] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metrics.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) + } + 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') + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PercentileMetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PercentileMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_source_target_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_source_target_operations.py new file mode 100644 index 000000000000..45c02b4bba49 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_source_target_operations.py @@ -0,0 +1,125 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PercentileSourceTargetOperations(object): + """PercentileSourceTargetOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-08" + + self.config = config + + def list_metrics( + self, resource_group_name, account_name, source_region, target_region, filter, custom_headers=None, raw=False, **operation_config): + """Retrieves the metrics determined by the given filter for the given + account, source and target region. This url is only for PBS and + Replication Latency data. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param source_region: Source region from which data is written. Cosmos + DB region, with spaces between words and each word capitalized. + :type source_region: str + :param target_region: Target region to which data is written. Cosmos + DB region, with spaces between words and each word capitalized. + :type target_region: str + :param filter: An OData filter expression that describes a subset of + metrics to return. The parameters that can be filtered are name.value + (name of the metric, can have an or of multiple names), startTime, + endTime, and timeGrain. The supported operator is eq. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PercentileMetric + :rtype: + ~azure.mgmt.cosmosdb.models.PercentileMetricPaged[~azure.mgmt.cosmosdb.models.PercentileMetric] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metrics.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'sourceRegion': self._serialize.url("source_region", source_region, 'str'), + 'targetRegion': self._serialize.url("target_region", target_region, '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') + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PercentileMetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PercentileMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_target_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_target_operations.py new file mode 100644 index 000000000000..06395707cc59 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_target_operations.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PercentileTargetOperations(object): + """PercentileTargetOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-04-08" + + self.config = config + + def list_metrics( + self, resource_group_name, account_name, target_region, filter, custom_headers=None, raw=False, **operation_config): + """Retrieves the metrics determined by the given filter for the given + account target region. This url is only for PBS and Replication Latency + data. + + :param resource_group_name: Name of an Azure resource group. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param target_region: Target region to which data is written. Cosmos + DB region, with spaces between words and each word capitalized. + :type target_region: str + :param filter: An OData filter expression that describes a subset of + metrics to return. The parameters that can be filtered are name.value + (name of the metric, can have an or of multiple names), startTime, + endTime, and timeGrain. The supported operator is eq. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PercentileMetric + :rtype: + ~azure.mgmt.cosmosdb.models.PercentileMetricPaged[~azure.mgmt.cosmosdb.models.PercentileMetric] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_metrics.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3), + 'targetRegion': self._serialize.url("target_region", target_region, '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') + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PercentileMetricPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PercentileMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/version.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/version.py index 3da0f49f071f..3e682bbd5fb1 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/version.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.2.1" +VERSION = "0.3.0" diff --git a/azure-mgmt-network/azure/mgmt/network/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/network_management_client.py index d01647d62bd2..51cbc40eabaa 100644 --- a/azure-mgmt-network/azure/mgmt/network/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/network_management_client.py @@ -160,6 +160,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2017-09-01: :mod:`v2017_09_01.models` * 2017-10-01: :mod:`v2017_10_01.models` * 2017-11-01: :mod:`v2017_11_01.models` + * 2018-01-01: :mod:`v2018_01_01.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -188,6 +189,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2017-11-01': from .v2017_11_01 import models return models + elif api_version == '2018-01-01': + from .v2018_01_01 import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) @property @@ -203,6 +207,7 @@ def application_gateways(self): * 2017-09-01: :class:`ApplicationGatewaysOperations` * 2017-10-01: :class:`ApplicationGatewaysOperations` * 2017-11-01: :class:`ApplicationGatewaysOperations` + * 2018-01-01: :class:`ApplicationGatewaysOperations` """ api_version = self.profile.get('application_gateways', self.api_version) if api_version == '2015-06-15': @@ -223,6 +228,8 @@ def application_gateways(self): from .v2017_10_01.operations import ApplicationGatewaysOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import ApplicationGatewaysOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ApplicationGatewaysOperations 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))) @@ -234,6 +241,7 @@ def application_security_groups(self): * 2017-09-01: :class:`ApplicationSecurityGroupsOperations` * 2017-10-01: :class:`ApplicationSecurityGroupsOperations` * 2017-11-01: :class:`ApplicationSecurityGroupsOperations` + * 2018-01-01: :class:`ApplicationSecurityGroupsOperations` """ api_version = self.profile.get('application_security_groups', self.api_version) if api_version == '2017-09-01': @@ -242,6 +250,8 @@ def application_security_groups(self): from .v2017_10_01.operations import ApplicationSecurityGroupsOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import ApplicationSecurityGroupsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ApplicationSecurityGroupsOperations 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))) @@ -255,6 +265,7 @@ def available_endpoint_services(self): * 2017-09-01: :class:`AvailableEndpointServicesOperations` * 2017-10-01: :class:`AvailableEndpointServicesOperations` * 2017-11-01: :class:`AvailableEndpointServicesOperations` + * 2018-01-01: :class:`AvailableEndpointServicesOperations` """ api_version = self.profile.get('available_endpoint_services', self.api_version) if api_version == '2017-06-01': @@ -267,6 +278,8 @@ def available_endpoint_services(self): from .v2017_10_01.operations import AvailableEndpointServicesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import AvailableEndpointServicesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import AvailableEndpointServicesOperations 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))) @@ -282,6 +295,7 @@ def bgp_service_communities(self): * 2017-09-01: :class:`BgpServiceCommunitiesOperations` * 2017-10-01: :class:`BgpServiceCommunitiesOperations` * 2017-11-01: :class:`BgpServiceCommunitiesOperations` + * 2018-01-01: :class:`BgpServiceCommunitiesOperations` """ api_version = self.profile.get('bgp_service_communities', self.api_version) if api_version == '2016-12-01': @@ -298,6 +312,8 @@ def bgp_service_communities(self): from .v2017_10_01.operations import BgpServiceCommunitiesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import BgpServiceCommunitiesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import BgpServiceCommunitiesOperations 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))) @@ -308,12 +324,15 @@ def connection_monitors(self): * 2017-10-01: :class:`ConnectionMonitorsOperations` * 2017-11-01: :class:`ConnectionMonitorsOperations` + * 2018-01-01: :class:`ConnectionMonitorsOperations` """ api_version = self.profile.get('connection_monitors', self.api_version) if api_version == '2017-10-01': from .v2017_10_01.operations import ConnectionMonitorsOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import ConnectionMonitorsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ConnectionMonitorsOperations 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))) @@ -327,6 +346,7 @@ def default_security_rules(self): * 2017-09-01: :class:`DefaultSecurityRulesOperations` * 2017-10-01: :class:`DefaultSecurityRulesOperations` * 2017-11-01: :class:`DefaultSecurityRulesOperations` + * 2018-01-01: :class:`DefaultSecurityRulesOperations` """ api_version = self.profile.get('default_security_rules', self.api_version) if api_version == '2017-06-01': @@ -339,6 +359,8 @@ def default_security_rules(self): from .v2017_10_01.operations import DefaultSecurityRulesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import DefaultSecurityRulesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import DefaultSecurityRulesOperations 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))) @@ -356,6 +378,7 @@ def express_route_circuit_authorizations(self): * 2017-09-01: :class:`ExpressRouteCircuitAuthorizationsOperations` * 2017-10-01: :class:`ExpressRouteCircuitAuthorizationsOperations` * 2017-11-01: :class:`ExpressRouteCircuitAuthorizationsOperations` + * 2018-01-01: :class:`ExpressRouteCircuitAuthorizationsOperations` """ api_version = self.profile.get('express_route_circuit_authorizations', self.api_version) if api_version == '2015-06-15': @@ -376,6 +399,8 @@ def express_route_circuit_authorizations(self): from .v2017_10_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ExpressRouteCircuitAuthorizationsOperations 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))) @@ -393,6 +418,7 @@ def express_route_circuit_peerings(self): * 2017-09-01: :class:`ExpressRouteCircuitPeeringsOperations` * 2017-10-01: :class:`ExpressRouteCircuitPeeringsOperations` * 2017-11-01: :class:`ExpressRouteCircuitPeeringsOperations` + * 2018-01-01: :class:`ExpressRouteCircuitPeeringsOperations` """ api_version = self.profile.get('express_route_circuit_peerings', self.api_version) if api_version == '2015-06-15': @@ -413,6 +439,8 @@ def express_route_circuit_peerings(self): from .v2017_10_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ExpressRouteCircuitPeeringsOperations 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))) @@ -430,6 +458,7 @@ def express_route_circuits(self): * 2017-09-01: :class:`ExpressRouteCircuitsOperations` * 2017-10-01: :class:`ExpressRouteCircuitsOperations` * 2017-11-01: :class:`ExpressRouteCircuitsOperations` + * 2018-01-01: :class:`ExpressRouteCircuitsOperations` """ api_version = self.profile.get('express_route_circuits', self.api_version) if api_version == '2015-06-15': @@ -450,6 +479,8 @@ def express_route_circuits(self): from .v2017_10_01.operations import ExpressRouteCircuitsOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import ExpressRouteCircuitsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ExpressRouteCircuitsOperations 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))) @@ -467,6 +498,7 @@ def express_route_service_providers(self): * 2017-09-01: :class:`ExpressRouteServiceProvidersOperations` * 2017-10-01: :class:`ExpressRouteServiceProvidersOperations` * 2017-11-01: :class:`ExpressRouteServiceProvidersOperations` + * 2018-01-01: :class:`ExpressRouteServiceProvidersOperations` """ api_version = self.profile.get('express_route_service_providers', self.api_version) if api_version == '2015-06-15': @@ -487,6 +519,8 @@ def express_route_service_providers(self): from .v2017_10_01.operations import ExpressRouteServiceProvidersOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import ExpressRouteServiceProvidersOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import ExpressRouteServiceProvidersOperations 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))) @@ -500,6 +534,7 @@ def inbound_nat_rules(self): * 2017-09-01: :class:`InboundNatRulesOperations` * 2017-10-01: :class:`InboundNatRulesOperations` * 2017-11-01: :class:`InboundNatRulesOperations` + * 2018-01-01: :class:`InboundNatRulesOperations` """ api_version = self.profile.get('inbound_nat_rules', self.api_version) if api_version == '2017-06-01': @@ -512,6 +547,8 @@ def inbound_nat_rules(self): from .v2017_10_01.operations import InboundNatRulesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import InboundNatRulesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import InboundNatRulesOperations 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))) @@ -525,6 +562,7 @@ def load_balancer_backend_address_pools(self): * 2017-09-01: :class:`LoadBalancerBackendAddressPoolsOperations` * 2017-10-01: :class:`LoadBalancerBackendAddressPoolsOperations` * 2017-11-01: :class:`LoadBalancerBackendAddressPoolsOperations` + * 2018-01-01: :class:`LoadBalancerBackendAddressPoolsOperations` """ api_version = self.profile.get('load_balancer_backend_address_pools', self.api_version) if api_version == '2017-06-01': @@ -537,6 +575,8 @@ def load_balancer_backend_address_pools(self): from .v2017_10_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LoadBalancerBackendAddressPoolsOperations 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))) @@ -550,6 +590,7 @@ def load_balancer_frontend_ip_configurations(self): * 2017-09-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` * 2017-10-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` * 2017-11-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` + * 2018-01-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` """ api_version = self.profile.get('load_balancer_frontend_ip_configurations', self.api_version) if api_version == '2017-06-01': @@ -562,6 +603,8 @@ def load_balancer_frontend_ip_configurations(self): from .v2017_10_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LoadBalancerFrontendIPConfigurationsOperations 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))) @@ -575,6 +618,7 @@ def load_balancer_load_balancing_rules(self): * 2017-09-01: :class:`LoadBalancerLoadBalancingRulesOperations` * 2017-10-01: :class:`LoadBalancerLoadBalancingRulesOperations` * 2017-11-01: :class:`LoadBalancerLoadBalancingRulesOperations` + * 2018-01-01: :class:`LoadBalancerLoadBalancingRulesOperations` """ api_version = self.profile.get('load_balancer_load_balancing_rules', self.api_version) if api_version == '2017-06-01': @@ -587,6 +631,8 @@ def load_balancer_load_balancing_rules(self): from .v2017_10_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LoadBalancerLoadBalancingRulesOperations 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))) @@ -600,6 +646,7 @@ def load_balancer_network_interfaces(self): * 2017-09-01: :class:`LoadBalancerNetworkInterfacesOperations` * 2017-10-01: :class:`LoadBalancerNetworkInterfacesOperations` * 2017-11-01: :class:`LoadBalancerNetworkInterfacesOperations` + * 2018-01-01: :class:`LoadBalancerNetworkInterfacesOperations` """ api_version = self.profile.get('load_balancer_network_interfaces', self.api_version) if api_version == '2017-06-01': @@ -612,6 +659,8 @@ def load_balancer_network_interfaces(self): from .v2017_10_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LoadBalancerNetworkInterfacesOperations 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))) @@ -625,6 +674,7 @@ def load_balancer_probes(self): * 2017-09-01: :class:`LoadBalancerProbesOperations` * 2017-10-01: :class:`LoadBalancerProbesOperations` * 2017-11-01: :class:`LoadBalancerProbesOperations` + * 2018-01-01: :class:`LoadBalancerProbesOperations` """ api_version = self.profile.get('load_balancer_probes', self.api_version) if api_version == '2017-06-01': @@ -637,6 +687,8 @@ def load_balancer_probes(self): from .v2017_10_01.operations import LoadBalancerProbesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import LoadBalancerProbesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LoadBalancerProbesOperations 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))) @@ -654,6 +706,7 @@ def load_balancers(self): * 2017-09-01: :class:`LoadBalancersOperations` * 2017-10-01: :class:`LoadBalancersOperations` * 2017-11-01: :class:`LoadBalancersOperations` + * 2018-01-01: :class:`LoadBalancersOperations` """ api_version = self.profile.get('load_balancers', self.api_version) if api_version == '2015-06-15': @@ -674,6 +727,8 @@ def load_balancers(self): from .v2017_10_01.operations import LoadBalancersOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import LoadBalancersOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LoadBalancersOperations 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))) @@ -691,6 +746,7 @@ def local_network_gateways(self): * 2017-09-01: :class:`LocalNetworkGatewaysOperations` * 2017-10-01: :class:`LocalNetworkGatewaysOperations` * 2017-11-01: :class:`LocalNetworkGatewaysOperations` + * 2018-01-01: :class:`LocalNetworkGatewaysOperations` """ api_version = self.profile.get('local_network_gateways', self.api_version) if api_version == '2015-06-15': @@ -711,6 +767,8 @@ def local_network_gateways(self): from .v2017_10_01.operations import LocalNetworkGatewaysOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import LocalNetworkGatewaysOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import LocalNetworkGatewaysOperations 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))) @@ -724,6 +782,7 @@ def network_interface_ip_configurations(self): * 2017-09-01: :class:`NetworkInterfaceIPConfigurationsOperations` * 2017-10-01: :class:`NetworkInterfaceIPConfigurationsOperations` * 2017-11-01: :class:`NetworkInterfaceIPConfigurationsOperations` + * 2018-01-01: :class:`NetworkInterfaceIPConfigurationsOperations` """ api_version = self.profile.get('network_interface_ip_configurations', self.api_version) if api_version == '2017-06-01': @@ -736,6 +795,8 @@ def network_interface_ip_configurations(self): from .v2017_10_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import NetworkInterfaceIPConfigurationsOperations 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))) @@ -749,6 +810,7 @@ def network_interface_load_balancers(self): * 2017-09-01: :class:`NetworkInterfaceLoadBalancersOperations` * 2017-10-01: :class:`NetworkInterfaceLoadBalancersOperations` * 2017-11-01: :class:`NetworkInterfaceLoadBalancersOperations` + * 2018-01-01: :class:`NetworkInterfaceLoadBalancersOperations` """ api_version = self.profile.get('network_interface_load_balancers', self.api_version) if api_version == '2017-06-01': @@ -761,6 +823,8 @@ def network_interface_load_balancers(self): from .v2017_10_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import NetworkInterfaceLoadBalancersOperations 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))) @@ -778,6 +842,7 @@ def network_interfaces(self): * 2017-09-01: :class:`NetworkInterfacesOperations` * 2017-10-01: :class:`NetworkInterfacesOperations` * 2017-11-01: :class:`NetworkInterfacesOperations` + * 2018-01-01: :class:`NetworkInterfacesOperations` """ api_version = self.profile.get('network_interfaces', self.api_version) if api_version == '2015-06-15': @@ -798,6 +863,8 @@ def network_interfaces(self): from .v2017_10_01.operations import NetworkInterfacesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import NetworkInterfacesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import NetworkInterfacesOperations 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))) @@ -815,6 +882,7 @@ def network_security_groups(self): * 2017-09-01: :class:`NetworkSecurityGroupsOperations` * 2017-10-01: :class:`NetworkSecurityGroupsOperations` * 2017-11-01: :class:`NetworkSecurityGroupsOperations` + * 2018-01-01: :class:`NetworkSecurityGroupsOperations` """ api_version = self.profile.get('network_security_groups', self.api_version) if api_version == '2015-06-15': @@ -835,6 +903,8 @@ def network_security_groups(self): from .v2017_10_01.operations import NetworkSecurityGroupsOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import NetworkSecurityGroupsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import NetworkSecurityGroupsOperations 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))) @@ -851,6 +921,7 @@ def network_watchers(self): * 2017-09-01: :class:`NetworkWatchersOperations` * 2017-10-01: :class:`NetworkWatchersOperations` * 2017-11-01: :class:`NetworkWatchersOperations` + * 2018-01-01: :class:`NetworkWatchersOperations` """ api_version = self.profile.get('network_watchers', self.api_version) if api_version == '2016-09-01': @@ -869,6 +940,8 @@ def network_watchers(self): from .v2017_10_01.operations import NetworkWatchersOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import NetworkWatchersOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import NetworkWatchersOperations 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))) @@ -880,6 +953,7 @@ def operations(self): * 2017-09-01: :class:`Operations` * 2017-10-01: :class:`Operations` * 2017-11-01: :class:`Operations` + * 2018-01-01: :class:`Operations` """ api_version = self.profile.get('operations', self.api_version) if api_version == '2017-09-01': @@ -888,6 +962,8 @@ def operations(self): from .v2017_10_01.operations import Operations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import Operations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import Operations 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))) @@ -904,6 +980,7 @@ def packet_captures(self): * 2017-09-01: :class:`PacketCapturesOperations` * 2017-10-01: :class:`PacketCapturesOperations` * 2017-11-01: :class:`PacketCapturesOperations` + * 2018-01-01: :class:`PacketCapturesOperations` """ api_version = self.profile.get('packet_captures', self.api_version) if api_version == '2016-09-01': @@ -922,6 +999,8 @@ def packet_captures(self): from .v2017_10_01.operations import PacketCapturesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import PacketCapturesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import PacketCapturesOperations 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))) @@ -939,6 +1018,7 @@ def public_ip_addresses(self): * 2017-09-01: :class:`PublicIPAddressesOperations` * 2017-10-01: :class:`PublicIPAddressesOperations` * 2017-11-01: :class:`PublicIPAddressesOperations` + * 2018-01-01: :class:`PublicIPAddressesOperations` """ api_version = self.profile.get('public_ip_addresses', self.api_version) if api_version == '2015-06-15': @@ -959,6 +1039,8 @@ def public_ip_addresses(self): from .v2017_10_01.operations import PublicIPAddressesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import PublicIPAddressesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import PublicIPAddressesOperations 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))) @@ -974,6 +1056,7 @@ def route_filter_rules(self): * 2017-09-01: :class:`RouteFilterRulesOperations` * 2017-10-01: :class:`RouteFilterRulesOperations` * 2017-11-01: :class:`RouteFilterRulesOperations` + * 2018-01-01: :class:`RouteFilterRulesOperations` """ api_version = self.profile.get('route_filter_rules', self.api_version) if api_version == '2016-12-01': @@ -990,6 +1073,8 @@ def route_filter_rules(self): from .v2017_10_01.operations import RouteFilterRulesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import RouteFilterRulesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import RouteFilterRulesOperations 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))) @@ -1005,6 +1090,7 @@ def route_filters(self): * 2017-09-01: :class:`RouteFiltersOperations` * 2017-10-01: :class:`RouteFiltersOperations` * 2017-11-01: :class:`RouteFiltersOperations` + * 2018-01-01: :class:`RouteFiltersOperations` """ api_version = self.profile.get('route_filters', self.api_version) if api_version == '2016-12-01': @@ -1021,6 +1107,8 @@ def route_filters(self): from .v2017_10_01.operations import RouteFiltersOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import RouteFiltersOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import RouteFiltersOperations 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))) @@ -1038,6 +1126,7 @@ def route_tables(self): * 2017-09-01: :class:`RouteTablesOperations` * 2017-10-01: :class:`RouteTablesOperations` * 2017-11-01: :class:`RouteTablesOperations` + * 2018-01-01: :class:`RouteTablesOperations` """ api_version = self.profile.get('route_tables', self.api_version) if api_version == '2015-06-15': @@ -1058,6 +1147,8 @@ def route_tables(self): from .v2017_10_01.operations import RouteTablesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import RouteTablesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import RouteTablesOperations 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))) @@ -1075,6 +1166,7 @@ def routes(self): * 2017-09-01: :class:`RoutesOperations` * 2017-10-01: :class:`RoutesOperations` * 2017-11-01: :class:`RoutesOperations` + * 2018-01-01: :class:`RoutesOperations` """ api_version = self.profile.get('routes', self.api_version) if api_version == '2015-06-15': @@ -1095,6 +1187,8 @@ def routes(self): from .v2017_10_01.operations import RoutesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import RoutesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import RoutesOperations 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))) @@ -1112,6 +1206,7 @@ def security_rules(self): * 2017-09-01: :class:`SecurityRulesOperations` * 2017-10-01: :class:`SecurityRulesOperations` * 2017-11-01: :class:`SecurityRulesOperations` + * 2018-01-01: :class:`SecurityRulesOperations` """ api_version = self.profile.get('security_rules', self.api_version) if api_version == '2015-06-15': @@ -1132,6 +1227,8 @@ def security_rules(self): from .v2017_10_01.operations import SecurityRulesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import SecurityRulesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import SecurityRulesOperations 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))) @@ -1149,6 +1246,7 @@ def subnets(self): * 2017-09-01: :class:`SubnetsOperations` * 2017-10-01: :class:`SubnetsOperations` * 2017-11-01: :class:`SubnetsOperations` + * 2018-01-01: :class:`SubnetsOperations` """ api_version = self.profile.get('subnets', self.api_version) if api_version == '2015-06-15': @@ -1169,6 +1267,8 @@ def subnets(self): from .v2017_10_01.operations import SubnetsOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import SubnetsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import SubnetsOperations 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))) @@ -1186,6 +1286,7 @@ def usages(self): * 2017-09-01: :class:`UsagesOperations` * 2017-10-01: :class:`UsagesOperations` * 2017-11-01: :class:`UsagesOperations` + * 2018-01-01: :class:`UsagesOperations` """ api_version = self.profile.get('usages', self.api_version) if api_version == '2015-06-15': @@ -1206,6 +1307,8 @@ def usages(self): from .v2017_10_01.operations import UsagesOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import UsagesOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import UsagesOperations 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))) @@ -1223,6 +1326,7 @@ def virtual_network_gateway_connections(self): * 2017-09-01: :class:`VirtualNetworkGatewayConnectionsOperations` * 2017-10-01: :class:`VirtualNetworkGatewayConnectionsOperations` * 2017-11-01: :class:`VirtualNetworkGatewayConnectionsOperations` + * 2018-01-01: :class:`VirtualNetworkGatewayConnectionsOperations` """ api_version = self.profile.get('virtual_network_gateway_connections', self.api_version) if api_version == '2015-06-15': @@ -1243,6 +1347,8 @@ def virtual_network_gateway_connections(self): from .v2017_10_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import VirtualNetworkGatewayConnectionsOperations 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))) @@ -1260,6 +1366,7 @@ def virtual_network_gateways(self): * 2017-09-01: :class:`VirtualNetworkGatewaysOperations` * 2017-10-01: :class:`VirtualNetworkGatewaysOperations` * 2017-11-01: :class:`VirtualNetworkGatewaysOperations` + * 2018-01-01: :class:`VirtualNetworkGatewaysOperations` """ api_version = self.profile.get('virtual_network_gateways', self.api_version) if api_version == '2015-06-15': @@ -1280,6 +1387,8 @@ def virtual_network_gateways(self): from .v2017_10_01.operations import VirtualNetworkGatewaysOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import VirtualNetworkGatewaysOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import VirtualNetworkGatewaysOperations 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))) @@ -1296,6 +1405,7 @@ def virtual_network_peerings(self): * 2017-09-01: :class:`VirtualNetworkPeeringsOperations` * 2017-10-01: :class:`VirtualNetworkPeeringsOperations` * 2017-11-01: :class:`VirtualNetworkPeeringsOperations` + * 2018-01-01: :class:`VirtualNetworkPeeringsOperations` """ api_version = self.profile.get('virtual_network_peerings', self.api_version) if api_version == '2016-09-01': @@ -1314,6 +1424,8 @@ def virtual_network_peerings(self): from .v2017_10_01.operations import VirtualNetworkPeeringsOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import VirtualNetworkPeeringsOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import VirtualNetworkPeeringsOperations 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))) @@ -1331,6 +1443,7 @@ def virtual_networks(self): * 2017-09-01: :class:`VirtualNetworksOperations` * 2017-10-01: :class:`VirtualNetworksOperations` * 2017-11-01: :class:`VirtualNetworksOperations` + * 2018-01-01: :class:`VirtualNetworksOperations` """ api_version = self.profile.get('virtual_networks', self.api_version) if api_version == '2015-06-15': @@ -1351,6 +1464,8 @@ def virtual_networks(self): from .v2017_10_01.operations import VirtualNetworksOperations as OperationClass elif api_version == '2017-11-01': from .v2017_11_01.operations import VirtualNetworksOperations as OperationClass + elif api_version == '2018-01-01': + from .v2018_01_01.operations import VirtualNetworksOperations 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))) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/__init__.py index 63c6b0129a43..0c388b94076e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/__init__.py @@ -9,74 +9,144 @@ # regenerated. # -------------------------------------------------------------------------- -from .application_gateway_sku import ApplicationGatewaySku -from .sub_resource import SubResource -from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration -from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate -from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration -from .application_gateway_frontend_port import ApplicationGatewayFrontendPort -from .application_gateway_backend_address import ApplicationGatewayBackendAddress -from .backend_address_pool import BackendAddressPool -from .inbound_nat_rule import InboundNatRule -from .security_rule import SecurityRule -from .network_interface_dns_settings import NetworkInterfaceDnsSettings -from .network_interface import NetworkInterface -from .network_security_group import NetworkSecurityGroup -from .route import Route -from .route_table import RouteTable -from .public_ip_address_dns_settings import PublicIPAddressDnsSettings -from .public_ip_address import PublicIPAddress -from .ip_configuration import IPConfiguration -from .subnet import Subnet -from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration -from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool -from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings -from .application_gateway_http_listener import ApplicationGatewayHttpListener -from .application_gateway_path_rule import ApplicationGatewayPathRule -from .application_gateway_probe import ApplicationGatewayProbe -from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule -from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap -from .application_gateway import ApplicationGateway -from .resource import Resource -from .dns_name_availability_result import DnsNameAvailabilityResult -from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization -from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig -from .express_route_circuit_stats import ExpressRouteCircuitStats -from .express_route_circuit_peering import ExpressRouteCircuitPeering -from .express_route_circuit_sku import ExpressRouteCircuitSku -from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties -from .express_route_circuit import ExpressRouteCircuit -from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable -from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable -from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered -from .express_route_service_provider import ExpressRouteServiceProvider -from .frontend_ip_configuration import FrontendIPConfiguration -from .load_balancing_rule import LoadBalancingRule -from .probe import Probe -from .inbound_nat_pool import InboundNatPool -from .outbound_nat_rule import OutboundNatRule -from .load_balancer import LoadBalancer -from .error_details import ErrorDetails -from .error import Error -from .azure_async_operation_result import AzureAsyncOperationResult -from .usage_name import UsageName -from .usage import Usage -from .address_space import AddressSpace -from .dhcp_options import DhcpOptions -from .virtual_network import VirtualNetwork -from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration -from .virtual_network_gateway_sku import VirtualNetworkGatewaySku -from .vpn_client_root_certificate import VpnClientRootCertificate -from .vpn_client_revoked_certificate import VpnClientRevokedCertificate -from .vpn_client_configuration import VpnClientConfiguration -from .bgp_settings import BgpSettings -from .virtual_network_gateway import VirtualNetworkGateway -from .vpn_client_parameters import VpnClientParameters -from .local_network_gateway import LocalNetworkGateway -from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection -from .connection_shared_key_result import ConnectionSharedKeyResult -from .connection_reset_shared_key import ConnectionResetSharedKey -from .connection_shared_key import ConnectionSharedKey +try: + from .application_gateway_sku_py3 import ApplicationGatewaySku + from .sub_resource_py3 import SubResource + from .application_gateway_ip_configuration_py3 import ApplicationGatewayIPConfiguration + from .application_gateway_ssl_certificate_py3 import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration_py3 import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port_py3 import ApplicationGatewayFrontendPort + from .application_gateway_backend_address_py3 import ApplicationGatewayBackendAddress + from .backend_address_pool_py3 import BackendAddressPool + from .inbound_nat_rule_py3 import InboundNatRule + from .security_rule_py3 import SecurityRule + from .network_interface_dns_settings_py3 import NetworkInterfaceDnsSettings + from .network_interface_py3 import NetworkInterface + from .network_security_group_py3 import NetworkSecurityGroup + from .route_py3 import Route + from .route_table_py3 import RouteTable + from .public_ip_address_dns_settings_py3 import PublicIPAddressDnsSettings + from .public_ip_address_py3 import PublicIPAddress + from .ip_configuration_py3 import IPConfiguration + from .subnet_py3 import Subnet + from .network_interface_ip_configuration_py3 import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address_pool_py3 import ApplicationGatewayBackendAddressPool + from .application_gateway_backend_http_settings_py3 import ApplicationGatewayBackendHttpSettings + from .application_gateway_http_listener_py3 import ApplicationGatewayHttpListener + from .application_gateway_path_rule_py3 import ApplicationGatewayPathRule + from .application_gateway_probe_py3 import ApplicationGatewayProbe + from .application_gateway_request_routing_rule_py3 import ApplicationGatewayRequestRoutingRule + from .application_gateway_url_path_map_py3 import ApplicationGatewayUrlPathMap + from .application_gateway_py3 import ApplicationGateway + from .resource_py3 import Resource + from .dns_name_availability_result_py3 import DnsNameAvailabilityResult + from .express_route_circuit_authorization_py3 import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config_py3 import ExpressRouteCircuitPeeringConfig + from .express_route_circuit_stats_py3 import ExpressRouteCircuitStats + from .express_route_circuit_peering_py3 import ExpressRouteCircuitPeering + from .express_route_circuit_sku_py3 import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties_py3 import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit_py3 import ExpressRouteCircuit + from .express_route_circuit_arp_table_py3 import ExpressRouteCircuitArpTable + from .express_route_circuit_routes_table_py3 import ExpressRouteCircuitRoutesTable + from .express_route_service_provider_bandwidths_offered_py3 import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider_py3 import ExpressRouteServiceProvider + from .frontend_ip_configuration_py3 import FrontendIPConfiguration + from .load_balancing_rule_py3 import LoadBalancingRule + from .probe_py3 import Probe + from .inbound_nat_pool_py3 import InboundNatPool + from .outbound_nat_rule_py3 import OutboundNatRule + from .load_balancer_py3 import LoadBalancer + from .error_details_py3 import ErrorDetails + from .error_py3 import Error + from .azure_async_operation_result_py3 import AzureAsyncOperationResult + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .address_space_py3 import AddressSpace + from .dhcp_options_py3 import DhcpOptions + from .virtual_network_py3 import VirtualNetwork + from .virtual_network_gateway_ip_configuration_py3 import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku_py3 import VirtualNetworkGatewaySku + from .vpn_client_root_certificate_py3 import VpnClientRootCertificate + from .vpn_client_revoked_certificate_py3 import VpnClientRevokedCertificate + from .vpn_client_configuration_py3 import VpnClientConfiguration + from .bgp_settings_py3 import BgpSettings + from .virtual_network_gateway_py3 import VirtualNetworkGateway + from .vpn_client_parameters_py3 import VpnClientParameters + from .local_network_gateway_py3 import LocalNetworkGateway + from .virtual_network_gateway_connection_py3 import VirtualNetworkGatewayConnection + from .connection_shared_key_result_py3 import ConnectionSharedKeyResult + from .connection_reset_shared_key_py3 import ConnectionResetSharedKey + from .connection_shared_key_py3 import ConnectionSharedKey +except (SyntaxError, ImportError): + from .application_gateway_sku import ApplicationGatewaySku + from .sub_resource import SubResource + from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration + from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port import ApplicationGatewayFrontendPort + from .application_gateway_backend_address import ApplicationGatewayBackendAddress + from .backend_address_pool import BackendAddressPool + from .inbound_nat_rule import InboundNatRule + from .security_rule import SecurityRule + from .network_interface_dns_settings import NetworkInterfaceDnsSettings + from .network_interface import NetworkInterface + from .network_security_group import NetworkSecurityGroup + from .route import Route + from .route_table import RouteTable + from .public_ip_address_dns_settings import PublicIPAddressDnsSettings + from .public_ip_address import PublicIPAddress + from .ip_configuration import IPConfiguration + from .subnet import Subnet + from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool + from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings + from .application_gateway_http_listener import ApplicationGatewayHttpListener + from .application_gateway_path_rule import ApplicationGatewayPathRule + from .application_gateway_probe import ApplicationGatewayProbe + from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule + from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap + from .application_gateway import ApplicationGateway + from .resource import Resource + from .dns_name_availability_result import DnsNameAvailabilityResult + from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig + from .express_route_circuit_stats import ExpressRouteCircuitStats + from .express_route_circuit_peering import ExpressRouteCircuitPeering + from .express_route_circuit_sku import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit import ExpressRouteCircuit + from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable + from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable + from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider import ExpressRouteServiceProvider + from .frontend_ip_configuration import FrontendIPConfiguration + from .load_balancing_rule import LoadBalancingRule + from .probe import Probe + from .inbound_nat_pool import InboundNatPool + from .outbound_nat_rule import OutboundNatRule + from .load_balancer import LoadBalancer + from .error_details import ErrorDetails + from .error import Error + from .azure_async_operation_result import AzureAsyncOperationResult + from .usage_name import UsageName + from .usage import Usage + from .address_space import AddressSpace + from .dhcp_options import DhcpOptions + from .virtual_network import VirtualNetwork + from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku import VirtualNetworkGatewaySku + from .vpn_client_root_certificate import VpnClientRootCertificate + from .vpn_client_revoked_certificate import VpnClientRevokedCertificate + from .vpn_client_configuration import VpnClientConfiguration + from .bgp_settings import BgpSettings + from .virtual_network_gateway import VirtualNetworkGateway + from .vpn_client_parameters import VpnClientParameters + from .local_network_gateway import LocalNetworkGateway + from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection + from .connection_shared_key_result import ConnectionSharedKeyResult + from .connection_reset_shared_key import ConnectionResetSharedKey + from .connection_shared_key import ConnectionSharedKey from .application_gateway_paged import ApplicationGatewayPaged from .express_route_circuit_authorization_paged import ExpressRouteCircuitAuthorizationPaged from .express_route_circuit_peering_paged import ExpressRouteCircuitPeeringPaged diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/address_space.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/address_space.py index d7050c78a457..fbf42c9e0ade 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/address_space.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/address_space.py @@ -25,6 +25,6 @@ class AddressSpace(Model): 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, } - def __init__(self, address_prefixes=None): - super(AddressSpace, self).__init__() - self.address_prefixes = address_prefixes + def __init__(self, **kwargs): + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = kwargs.get('address_prefixes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/address_space_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/address_space_py3.py new file mode 100644 index 000000000000..9794cc805efa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/address_space_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AddressSpace(Model): + """AddressSpace contains an array of IP address ranges that can be used by + subnets of the virtual network. + + :param address_prefixes: A list of address blocks reserved for this + virtual network in CIDR notation. + :type address_prefixes: list[str] + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__(self, *, address_prefixes=None, **kwargs) -> None: + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = address_prefixes diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway.py index a88791107348..9032a8a88974 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway.py @@ -112,20 +112,20 @@ class ApplicationGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, gateway_ip_configurations=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags) - self.sku = sku + def __init__(self, **kwargs): + super(ApplicationGateway, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) self.operational_state = None - self.gateway_ip_configurations = gateway_ip_configurations - self.ssl_certificates = ssl_certificates - self.frontend_ip_configurations = frontend_ip_configurations - self.frontend_ports = frontend_ports - self.probes = probes - self.backend_address_pools = backend_address_pools - self.backend_http_settings_collection = backend_http_settings_collection - self.http_listeners = http_listeners - self.url_path_maps = url_path_maps - self.request_routing_rules = request_routing_rules - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.gateway_ip_configurations = kwargs.get('gateway_ip_configurations', None) + self.ssl_certificates = kwargs.get('ssl_certificates', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.frontend_ports = kwargs.get('frontend_ports', None) + self.probes = kwargs.get('probes', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) + self.http_listeners = kwargs.get('http_listeners', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address.py index 6005027d0845..e7a61fe1705c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address.py @@ -26,7 +26,7 @@ class ApplicationGatewayBackendAddress(Model): 'ip_address': {'key': 'ipAddress', 'type': 'str'}, } - def __init__(self, fqdn=None, ip_address=None): - super(ApplicationGatewayBackendAddress, self).__init__() - self.fqdn = fqdn - self.ip_address = ip_address + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = kwargs.get('fqdn', None) + self.ip_address = kwargs.get('ip_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address_pool.py index 5e172fbdc4d7..0b41a5b9582d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address_pool.py @@ -44,10 +44,10 @@ class ApplicationGatewayBackendAddressPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayBackendAddressPool, self).__init__(id=id) - self.backend_ip_configurations = backend_ip_configurations - self.backend_addresses = backend_addresses - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddressPool, self).__init__(**kwargs) + self.backend_ip_configurations = kwargs.get('backend_ip_configurations', None) + self.backend_addresses = kwargs.get('backend_addresses', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address_pool_py3.py new file mode 100644 index 000000000000..884e76f58834 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address_pool_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + :param id: Resource Identifier. + :type id: str + :param backend_ip_configurations: Collection of references to IPs defined + in network interfaces. + :type backend_ip_configurations: + list[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses + :type backend_addresses: + list[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayBackendAddress] + :param provisioning_state: Provisioning state of the backend address pool + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Resource that is unique within a resource group. This name + can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = backend_ip_configurations + self.backend_addresses = backend_addresses + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address_py3.py new file mode 100644 index 000000000000..d18e476244d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_address_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendAddress(Model): + """Backend address of an application gateway. + + :param fqdn: Fully qualified domain name (FQDN). + :type fqdn: str + :param ip_address: IP address + :type ip_address: str + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__(self, *, fqdn: str=None, ip_address: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = fqdn + self.ip_address = ip_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_http_settings.py index 5c5fb92a3e4c..dbc04149c721 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_http_settings.py @@ -56,13 +56,13 @@ class ApplicationGatewayBackendHttpSettings(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, port=None, protocol=None, cookie_based_affinity=None, request_timeout=None, probe=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id) - self.port = port - self.protocol = protocol - self.cookie_based_affinity = cookie_based_affinity - self.request_timeout = request_timeout - self.probe = probe - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHttpSettings, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.protocol = kwargs.get('protocol', None) + self.cookie_based_affinity = kwargs.get('cookie_based_affinity', None) + self.request_timeout = kwargs.get('request_timeout', None) + self.probe = kwargs.get('probe', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_http_settings_py3.py new file mode 100644 index 000000000000..0465d7b00634 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_backend_http_settings_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendHttpSettings(SubResource): + """Backend address pool settings of an application gateway. + + :param id: Resource Identifier. + :type id: str + :param port: Port + :type port: int + :param protocol: Protocol. Possible values are: 'Http' and 'Https'. + Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayProtocol + :param cookie_based_affinity: Cookie based affinity. Possible values are: + 'Enabled' and 'Disabled'. Possible values include: 'Enabled', 'Disabled' + :type cookie_based_affinity: str or + ~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayCookieBasedAffinity + :param request_timeout: Request timeout in seconds. Application Gateway + will fail the request if response is not received within RequestTimeout. + Acceptable values are from 1 second to 86400 seconds. + :type request_timeout: int + :param probe: Probe resource of an application gateway. + :type probe: ~azure.mgmt.network.v2015_06_15.models.SubResource + :param provisioning_state: Gets or sets Provisioning state of the backend + http settings resource Updating/Deleting/Failed + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, + 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, protocol=None, cookie_based_affinity=None, request_timeout: int=None, probe=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id, **kwargs) + self.port = port + self.protocol = protocol + self.cookie_based_affinity = cookie_based_affinity + self.request_timeout = request_timeout + self.probe = probe + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_ip_configuration.py index 9fcb0f8382f6..dc741e1b2180 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_ip_configuration.py @@ -52,12 +52,12 @@ class ApplicationGatewayFrontendIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..ab2bf9c37600 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_ip_configuration_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): + """Frontend IP configuration of an application gateway. + + :param id: Resource Identifier. + :type id: str + :param private_ip_address: PrivateIPAddress of the network interface IP + Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: PrivateIP allocation method. Possible + values are: 'Static' and 'Dynamic'. Possible values include: 'Static', + 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2015_06_15.models.IPAllocationMethod + :param subnet: Reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2015_06_15.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param provisioning_state: Provisioning state of the public IP resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_port.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_port.py index 1bab17667629..6803e8785c6c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_port.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_port.py @@ -38,9 +38,9 @@ class ApplicationGatewayFrontendPort(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, port=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayFrontendPort, self).__init__(id=id) - self.port = port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendPort, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_port_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_port_py3.py new file mode 100644 index 000000000000..bae4945cb588 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_frontend_port_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + :param id: Resource Identifier. + :type id: str + :param port: Frontend port + :type port: int + :param provisioning_state: Provisioning state of the frontend port + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendPort, self).__init__(id=id, **kwargs) + self.port = port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_http_listener.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_http_listener.py index f861809f1a3a..01690bbc0a0b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_http_listener.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_http_listener.py @@ -59,14 +59,14 @@ class ApplicationGatewayHttpListener(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name=None, ssl_certificate=None, require_server_name_indication=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayHttpListener, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.frontend_port = frontend_port - self.protocol = protocol - self.host_name = host_name - self.ssl_certificate = ssl_certificate - self.require_server_name_indication = require_server_name_indication - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayHttpListener, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.protocol = kwargs.get('protocol', None) + self.host_name = kwargs.get('host_name', None) + self.ssl_certificate = kwargs.get('ssl_certificate', None) + self.require_server_name_indication = kwargs.get('require_server_name_indication', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_http_listener_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_http_listener_py3.py new file mode 100644 index 000000000000..03bdbae70fb9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_http_listener_py3.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayHttpListener(SubResource): + """Http listener of an application gateway. + + :param id: Resource Identifier. + :type id: str + :param frontend_ip_configuration: Frontend IP configuration resource of an + application gateway. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2015_06_15.models.SubResource + :param protocol: Protocol. Possible values are: 'Http' and 'Https'. + Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayProtocol + :param host_name: Host name of HTTP listener. + :type host_name: str + :param ssl_certificate: SSL certificate resource of an application + gateway. + :type ssl_certificate: ~azure.mgmt.network.v2015_06_15.models.SubResource + :param require_server_name_indication: Applicable only if protocol is + https. Enables SNI for multi-hosting. + :type require_server_name_indication: bool + :param provisioning_state: Provisioning state of the HTTP listener + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, + 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name: str=None, ssl_certificate=None, require_server_name_indication: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayHttpListener, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.frontend_port = frontend_port + self.protocol = protocol + self.host_name = host_name + self.ssl_certificate = ssl_certificate + self.require_server_name_indication = require_server_name_indication + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ip_configuration.py index 2abe410f4492..6c4dee4dc45d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ip_configuration.py @@ -41,9 +41,9 @@ class ApplicationGatewayIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, subnet=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayIPConfiguration, self).__init__(id=id) - self.subnet = subnet - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayIPConfiguration, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..1d52eeb46b7b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ip_configuration_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 + private IP configuration is allowed. + + :param id: Resource Identifier. + :type id: str + :param subnet: Reference of the subnet resource. A subnet from where + application gateway gets its private address. + :type subnet: ~azure.mgmt.network.v2015_06_15.models.SubResource + :param provisioning_state: Provisioning state of the application gateway + subnet resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, subnet=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.subnet = subnet + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_path_rule.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_path_rule.py index 5d62e0649238..941685e837e9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_path_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_path_rule.py @@ -48,11 +48,11 @@ class ApplicationGatewayPathRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, paths=None, backend_address_pool=None, backend_http_settings=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayPathRule, self).__init__(id=id) - self.paths = paths - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayPathRule, self).__init__(**kwargs) + self.paths = kwargs.get('paths', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_path_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_path_rule_py3.py new file mode 100644 index 000000000000..74ac94fad5bb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_path_rule_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayPathRule(SubResource): + """Path rule of URL path map of an application gateway. + + :param id: Resource Identifier. + :type id: str + :param paths: Path rules of URL path map. + :type paths: list[str] + :param backend_address_pool: Backend address pool resource of URL path + map. + :type backend_address_pool: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param backend_http_settings: Backend http settings resource of URL path + map. + :type backend_http_settings: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param provisioning_state: Path rule of URL path map resource. Possible + values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'paths': {'key': 'properties.paths', 'type': '[str]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, paths=None, backend_address_pool=None, backend_http_settings=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayPathRule, self).__init__(id=id, **kwargs) + self.paths = paths + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_probe.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_probe.py index 8f03421d4ded..10dc66281413 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_probe.py @@ -62,14 +62,14 @@ class ApplicationGatewayProbe(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, protocol=None, host=None, path=None, interval=None, timeout=None, unhealthy_threshold=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayProbe, self).__init__(id=id) - self.protocol = protocol - self.host = host - self.path = path - self.interval = interval - self.timeout = timeout - self.unhealthy_threshold = unhealthy_threshold - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayProbe, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.host = kwargs.get('host', None) + self.path = kwargs.get('path', None) + self.interval = kwargs.get('interval', None) + self.timeout = kwargs.get('timeout', None) + self.unhealthy_threshold = kwargs.get('unhealthy_threshold', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_probe_py3.py new file mode 100644 index 000000000000..2450a10bcc6d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_probe_py3.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayProbe(SubResource): + """Probe of the application gateway. + + :param id: Resource Identifier. + :type id: str + :param protocol: Protocol. Possible values are: 'Http' and 'Https'. + Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is + sent to ://: + :type path: str + :param interval: The probing interval in seconds. This is the time + interval between two consecutive probes. Acceptable values are from 1 + second to 86400 seconds. + :type interval: int + :param timeout: the probe timeout in seconds. Probe marked as failed if + valid response is not received with this timeout period. Acceptable values + are from 1 second to 86400 seconds. + :type timeout: int + :param unhealthy_threshold: The probe retry count. Backend server is + marked down after consecutive probe failure count reaches + UnhealthyThreshold. Acceptable values are from 1 second to 20. + :type unhealthy_threshold: int + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host': {'key': 'properties.host', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, protocol=None, host: str=None, path: str=None, interval: int=None, timeout: int=None, unhealthy_threshold: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayProbe, self).__init__(id=id, **kwargs) + self.protocol = protocol + self.host = host + self.path = path + self.interval = interval + self.timeout = timeout + self.unhealthy_threshold = unhealthy_threshold + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_py3.py new file mode 100644 index 000000000000..c34e2b7d6e3e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_py3.py @@ -0,0 +1,131 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGateway(Resource): + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2015_06_15.models.ApplicationGatewaySku + :ivar operational_state: Operational state of the application gateway + resource. Possible values are: 'Stopped', 'Started', 'Running', and + 'Stopping'. Possible values include: 'Stopped', 'Starting', 'Running', + 'Stopping' + :vartype operational_state: str or + ~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayOperationalState + :param gateway_ip_configurations: Gets or sets subnets of application + gateway resource + :type gateway_ip_configurations: + list[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayIPConfiguration] + :param ssl_certificates: SSL certificates of the application gateway + resource. + :type ssl_certificates: + list[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewaySslCertificate] + :param frontend_ip_configurations: Frontend IP addresses of the + application gateway resource. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayFrontendIPConfiguration] + :param frontend_ports: Frontend ports of the application gateway resource. + :type frontend_ports: + list[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: + list[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayProbe] + :param backend_address_pools: Backend address pool of the application + gateway resource. + :type backend_address_pools: + list[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayBackendAddressPool] + :param backend_http_settings_collection: Backend http settings of the + application gateway resource. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayBackendHttpSettings] + :param http_listeners: Http listeners of the application gateway resource. + :type http_listeners: + list[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayHttpListener] + :param url_path_maps: URL path map of the application gateway resource. + :type url_path_maps: + list[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application + gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayRequestRoutingRule] + :param resource_guid: Resource GUID property of the application gateway + resource. + :type resource_guid: str + :param provisioning_state: Provisioning state of the application gateway + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operational_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, + 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, + 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, + 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, + 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, + 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, gateway_ip_configurations=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.operational_state = None + self.gateway_ip_configurations = gateway_ip_configurations + self.ssl_certificates = ssl_certificates + self.frontend_ip_configurations = frontend_ip_configurations + self.frontend_ports = frontend_ports + self.probes = probes + self.backend_address_pools = backend_address_pools + self.backend_http_settings_collection = backend_http_settings_collection + self.http_listeners = http_listeners + self.url_path_maps = url_path_maps + self.request_routing_rules = request_routing_rules + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_request_routing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_request_routing_rule.py index 8c70c365027d..4034feef4297 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_request_routing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_request_routing_rule.py @@ -56,13 +56,13 @@ class ApplicationGatewayRequestRoutingRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id) - self.rule_type = rule_type - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.http_listener = http_listener - self.url_path_map = url_path_map - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayRequestRoutingRule, self).__init__(**kwargs) + self.rule_type = kwargs.get('rule_type', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.http_listener = kwargs.get('http_listener', None) + self.url_path_map = kwargs.get('url_path_map', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_request_routing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_request_routing_rule_py3.py new file mode 100644 index 000000000000..35ce9527b972 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_request_routing_rule_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRequestRoutingRule(SubResource): + """Request routing rule of an application gateway. + + :param id: Resource Identifier. + :type id: str + :param rule_type: Rule type. Possible values are: 'Basic' and + 'PathBasedRouting'. Possible values include: 'Basic', 'PathBasedRouting' + :type rule_type: str or + ~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayRequestRoutingRuleType + :param backend_address_pool: Backend address pool resource of the + application gateway. + :type backend_address_pool: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param backend_http_settings: Frontend port resource of the application + gateway. + :type backend_http_settings: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2015_06_15.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2015_06_15.models.SubResource + :param provisioning_state: Provisioning state of the request routing rule + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, + 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id, **kwargs) + self.rule_type = rule_type + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.http_listener = http_listener + self.url_path_map = url_path_map + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_sku.py index 1e646a414c9d..7e62a1db42a1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_sku.py @@ -35,8 +35,8 @@ class ApplicationGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(ApplicationGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_sku_py3.py new file mode 100644 index 000000000000..5f6725e605d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_sku_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySku(Model): + """SKU of application gateway. + + :param name: Name of an application gateway SKU. Possible values are: + 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', and + 'WAF_Large'. Possible values include: 'Standard_Small', 'Standard_Medium', + 'Standard_Large' + :type name: str or + ~azure.mgmt.network.v2015_06_15.models.ApplicationGatewaySkuName + :param tier: Tier of an application gateway. Possible values include: + 'Standard' + :type tier: str or + ~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayTier + :param capacity: Capacity (instance count) of an application gateway. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ssl_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ssl_certificate.py index e4a987087218..ed57b0be931e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ssl_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ssl_certificate.py @@ -47,11 +47,11 @@ class ApplicationGatewaySslCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, data=None, password=None, public_cert_data=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewaySslCertificate, self).__init__(id=id) - self.data = data - self.password = password - self.public_cert_data = public_cert_data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewaySslCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.password = kwargs.get('password', None) + self.public_cert_data = kwargs.get('public_cert_data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ssl_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ssl_certificate_py3.py new file mode 100644 index 000000000000..4b4f57f0e3b5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_ssl_certificate_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + :param id: Resource Identifier. + :type id: str + :param data: Base-64 encoded pfx certificate. Only applicable in PUT + Request. + :type data: str + :param password: Password for the pfx file specified in data. Only + applicable in PUT request. + :type password: str + :param public_cert_data: Base-64 encoded Public cert data corresponding to + pfx specified in data. Only applicable in GET request. + :type public_cert_data: str + :param provisioning_state: Provisioning state of the SSL certificate + resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, password: str=None, public_cert_data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewaySslCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.password = password + self.public_cert_data = public_cert_data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_url_path_map.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_url_path_map.py index 350934c3bc09..0e445e219bf5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_url_path_map.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_url_path_map.py @@ -50,11 +50,11 @@ class ApplicationGatewayUrlPathMap(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, default_backend_address_pool=None, default_backend_http_settings=None, path_rules=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayUrlPathMap, self).__init__(id=id) - self.default_backend_address_pool = default_backend_address_pool - self.default_backend_http_settings = default_backend_http_settings - self.path_rules = path_rules - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayUrlPathMap, self).__init__(**kwargs) + self.default_backend_address_pool = kwargs.get('default_backend_address_pool', None) + self.default_backend_http_settings = kwargs.get('default_backend_http_settings', None) + self.path_rules = kwargs.get('path_rules', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_url_path_map_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_url_path_map_py3.py new file mode 100644 index 000000000000..3ea18edddb8a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/application_gateway_url_path_map_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayUrlPathMap(SubResource): + """UrlPathMaps give a url path to the backend mapping information for + PathBasedRouting. + + :param id: Resource Identifier. + :type id: str + :param default_backend_address_pool: Default backend address pool resource + of URL path map. + :type default_backend_address_pool: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param default_backend_http_settings: Default backend http settings + resource of URL path map. + :type default_backend_http_settings: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: + list[~azure.mgmt.network.v2015_06_15.models.ApplicationGatewayPathRule] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, + 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, default_backend_address_pool=None, default_backend_http_settings=None, path_rules=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayUrlPathMap, self).__init__(id=id, **kwargs) + self.default_backend_address_pool = default_backend_address_pool + self.default_backend_http_settings = default_backend_http_settings + self.path_rules = path_rules + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/azure_async_operation_result.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/azure_async_operation_result.py index a234024931a0..1e6b374b351b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/azure_async_operation_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/azure_async_operation_result.py @@ -36,7 +36,7 @@ class AzureAsyncOperationResult(Model): 'error': {'key': 'error', 'type': 'Error'}, } - def __init__(self, status=None, error=None): - super(AzureAsyncOperationResult, self).__init__() - self.status = status - self.error = error + def __init__(self, **kwargs): + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/azure_async_operation_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/azure_async_operation_result_py3.py new file mode 100644 index 000000000000..65a99ae43277 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/azure_async_operation_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureAsyncOperationResult(Model): + """The response body contains the status of the specified asynchronous + operation, indicating whether it has succeeded, is in progress, or has + failed. Note that this status is distinct from the HTTP status code + returned for the Get Operation Status operation itself. If the asynchronous + operation succeeded, the response body includes the HTTP status code for + the successful request. If the asynchronous operation failed, the response + body includes the HTTP status code for the failed request and error + information regarding the failure. + + :param status: Status of the Azure async operation. Possible values are: + 'InProgress', 'Succeeded', and 'Failed'. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or + ~azure.mgmt.network.v2015_06_15.models.NetworkOperationStatus + :param error: + :type error: ~azure.mgmt.network.v2015_06_15.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, status=None, error=None, **kwargs) -> None: + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/backend_address_pool.py index 42a85a77322d..c1fe98b3cff0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/backend_address_pool.py @@ -57,11 +57,11 @@ class BackendAddressPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, backend_ip_configurations=None, outbound_nat_rule=None, provisioning_state=None, name=None, etag=None): - super(BackendAddressPool, self).__init__(id=id) - self.backend_ip_configurations = backend_ip_configurations + def __init__(self, **kwargs): + super(BackendAddressPool, self).__init__(**kwargs) + self.backend_ip_configurations = kwargs.get('backend_ip_configurations', None) self.load_balancing_rules = None - self.outbound_nat_rule = outbound_nat_rule - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.outbound_nat_rule = kwargs.get('outbound_nat_rule', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/backend_address_pool_py3.py new file mode 100644 index 000000000000..a880f735861f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/backend_address_pool_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class BackendAddressPool(SubResource): + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :param backend_ip_configurations: Gets collection of references to IP + addresses defined in network interfaces. + :type backend_ip_configurations: + list[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: Gets load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2015_06_15.models.SubResource] + :param outbound_nat_rule: Gets outbound rules that use this backend + address pool. + :type outbound_nat_rule: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param provisioning_state: Get provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'load_balancing_rules': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'outbound_nat_rule': {'key': 'properties.outboundNatRule', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, backend_ip_configurations=None, outbound_nat_rule=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(BackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = backend_ip_configurations + self.load_balancing_rules = None + self.outbound_nat_rule = outbound_nat_rule + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/bgp_settings.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/bgp_settings.py index ecfc9b46feda..bf31fb23480e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/bgp_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/bgp_settings.py @@ -31,8 +31,8 @@ class BgpSettings(Model): 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, } - def __init__(self, asn=None, bgp_peering_address=None, peer_weight=None): - super(BgpSettings, self).__init__() - self.asn = asn - self.bgp_peering_address = bgp_peering_address - self.peer_weight = peer_weight + def __init__(self, **kwargs): + super(BgpSettings, self).__init__(**kwargs) + self.asn = kwargs.get('asn', None) + self.bgp_peering_address = kwargs.get('bgp_peering_address', None) + self.peer_weight = kwargs.get('peer_weight', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/bgp_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/bgp_settings_py3.py new file mode 100644 index 000000000000..9726a06249c1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/bgp_settings_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpSettings(Model): + """BgpSettings. + + :param asn: Gets or sets this BGP speaker's ASN + :type asn: long + :param bgp_peering_address: Gets or sets the BGP peering address and BGP + identifier of this BGP speaker + :type bgp_peering_address: str + :param peer_weight: Gets or sets the weight added to routes learned from + this BGP speaker + :type peer_weight: int + """ + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, + } + + def __init__(self, *, asn: int=None, bgp_peering_address: str=None, peer_weight: int=None, **kwargs) -> None: + super(BgpSettings, self).__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + self.peer_weight = peer_weight diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_reset_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_reset_shared_key.py index b59ba480d6c1..251ec78a0757 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_reset_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_reset_shared_key.py @@ -23,6 +23,6 @@ class ConnectionResetSharedKey(Model): 'key_length': {'key': 'keyLength', 'type': 'long'}, } - def __init__(self, key_length=None): - super(ConnectionResetSharedKey, self).__init__() - self.key_length = key_length + def __init__(self, **kwargs): + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = kwargs.get('key_length', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_reset_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_reset_shared_key_py3.py new file mode 100644 index 000000000000..ebf9a9f82063 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_reset_shared_key_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionResetSharedKey(Model): + """ConnectionResetSharedKey. + + :param key_length: The virtual network connection reset shared key length + :type key_length: long + """ + + _attribute_map = { + 'key_length': {'key': 'keyLength', 'type': 'long'}, + } + + def __init__(self, *, key_length: int=None, **kwargs) -> None: + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = key_length diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key.py index ac9b02ae25c4..45202be128cb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key.py @@ -23,6 +23,6 @@ class ConnectionSharedKey(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, value=None): - super(ConnectionSharedKey, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key_py3.py new file mode 100644 index 000000000000..afbb94373021 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionSharedKey(Model): + """Response for GetConnectionSharedKey Api servive call. + + :param value: The virtual network connection shared key value + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, **kwargs) -> None: + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key_result.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key_result.py index dad934a10b4a..7e085b5370fc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key_result.py @@ -23,6 +23,6 @@ class ConnectionSharedKeyResult(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, value=None): - super(ConnectionSharedKeyResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ConnectionSharedKeyResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key_result_py3.py new file mode 100644 index 000000000000..d79810a02bbf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/connection_shared_key_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionSharedKeyResult(Model): + """Response for CheckConnectionSharedKey Api servive call. + + :param value: The virtual network connection shared key value + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, **kwargs) -> None: + super(ConnectionSharedKeyResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dhcp_options.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dhcp_options.py index 8744ba6fc9b1..93b68a7f037c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dhcp_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dhcp_options.py @@ -25,6 +25,6 @@ class DhcpOptions(Model): 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, } - def __init__(self, dns_servers=None): - super(DhcpOptions, self).__init__() - self.dns_servers = dns_servers + def __init__(self, **kwargs): + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dhcp_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dhcp_options_py3.py new file mode 100644 index 000000000000..7dc4651973a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dhcp_options_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DhcpOptions(Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in + the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + options. + + :param dns_servers: The list of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = dns_servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dns_name_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dns_name_availability_result.py index 15a0238e49a7..86ba19eb407b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dns_name_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dns_name_availability_result.py @@ -23,6 +23,6 @@ class DnsNameAvailabilityResult(Model): 'available': {'key': 'available', 'type': 'bool'}, } - def __init__(self, available=None): - super(DnsNameAvailabilityResult, self).__init__() - self.available = available + def __init__(self, **kwargs): + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dns_name_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dns_name_availability_result_py3.py new file mode 100644 index 000000000000..de0117c27715 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/dns_name_availability_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DnsNameAvailabilityResult(Model): + """Response for the CheckDnsNameAvailability API service call. + + :param available: Domain availability (True/False). + :type available: bool + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + } + + def __init__(self, *, available: bool=None, **kwargs) -> None: + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = available diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error.py index 5bebec6c5cad..98fb2644d66a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error.py @@ -35,10 +35,10 @@ class Error(Model): 'inner_error': {'key': 'innerError', 'type': 'str'}, } - def __init__(self, code=None, message=None, target=None, details=None, inner_error=None): - super(Error, self).__init__() - self.code = code - self.message = message - self.target = target - self.details = details - self.inner_error = inner_error + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error_details.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error_details.py index 0fd95b8f5cad..79b5e5adff57 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error_details.py @@ -29,8 +29,8 @@ class ErrorDetails(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ErrorDetails, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error_details_py3.py new file mode 100644 index 000000000000..54fa1d0965f3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error_details_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """Error details properties. + + :param code: + :type code: str + :param target: + :type target: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error_py3.py new file mode 100644 index 000000000000..49f294bd5d45 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(Model): + """Error object properties. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.network.v2015_06_15.models.ErrorDetails] + :param inner_error: + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, inner_error: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit.py index 2c8ad1ab801d..7acec03c438b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit.py @@ -84,15 +84,15 @@ class ExpressRouteCircuit(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, circuit_provisioning_state=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key=None, service_provider_notes=None, service_provider_properties=None, provisioning_state=None, etag=None): - super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.circuit_provisioning_state = circuit_provisioning_state - self.service_provider_provisioning_state = service_provider_provisioning_state - self.authorizations = authorizations - self.peerings = peerings - self.service_key = service_key - self.service_provider_notes = service_provider_notes - self.service_provider_properties = service_provider_properties - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(ExpressRouteCircuit, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.circuit_provisioning_state = kwargs.get('circuit_provisioning_state', None) + self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) + self.authorizations = kwargs.get('authorizations', None) + self.peerings = kwargs.get('peerings', None) + self.service_key = kwargs.get('service_key', None) + self.service_provider_notes = kwargs.get('service_provider_notes', None) + self.service_provider_properties = kwargs.get('service_provider_properties', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_arp_table.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_arp_table.py index cd824b686344..09ec13d3791e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_arp_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_arp_table.py @@ -26,7 +26,7 @@ class ExpressRouteCircuitArpTable(Model): 'mac_address': {'key': 'macAddress', 'type': 'str'}, } - def __init__(self, ip_address=None, mac_address=None): - super(ExpressRouteCircuitArpTable, self).__init__() - self.ip_address = ip_address - self.mac_address = mac_address + def __init__(self, **kwargs): + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.mac_address = kwargs.get('mac_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_arp_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_arp_table_py3.py new file mode 100644 index 000000000000..5c009c3110e2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_arp_table_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitArpTable(Model): + """The ARP table associated with the ExpressRouteCircuit. + + :param ip_address: The IP address. + :type ip_address: str + :param mac_address: The MAC address. + :type mac_address: str + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, *, ip_address: str=None, mac_address: str=None, **kwargs) -> None: + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.ip_address = ip_address + self.mac_address = mac_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_authorization.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_authorization.py index 78743cb3a5de..9a44db3fd667 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_authorization.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_authorization.py @@ -44,10 +44,10 @@ class ExpressRouteCircuitAuthorization(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, authorization_key=None, authorization_use_status=None, provisioning_state=None, name=None, etag=None): - super(ExpressRouteCircuitAuthorization, self).__init__(id=id) - self.authorization_key = authorization_key - self.authorization_use_status = authorization_use_status - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ExpressRouteCircuitAuthorization, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.authorization_use_status = kwargs.get('authorization_use_status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_authorization_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_authorization_py3.py new file mode 100644 index 000000000000..ced04ecf4364 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_authorization_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + :param id: Resource Identifier. + :type id: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param authorization_use_status: AuthorizationUseStatus. Possible values + are: 'Available' and 'InUse'. Possible values include: 'Available', + 'InUse' + :type authorization_use_status: str or + ~azure.mgmt.network.v2015_06_15.models.AuthorizationUseStatus + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, authorization_key: str=None, authorization_use_status=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuitAuthorization, self).__init__(id=id, **kwargs) + self.authorization_key = authorization_key + self.authorization_use_status = authorization_use_status + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering.py index 1cb8b8b62fce..723ea6b084b2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering.py @@ -79,20 +79,20 @@ class ExpressRouteCircuitPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, peering_type=None, state=None, azure_asn=None, peer_asn=None, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, primary_azure_port=None, secondary_azure_port=None, shared_key=None, vlan_id=None, microsoft_peering_config=None, stats=None, provisioning_state=None, name=None, etag=None): - super(ExpressRouteCircuitPeering, self).__init__(id=id) - self.peering_type = peering_type - self.state = state - self.azure_asn = azure_asn - self.peer_asn = peer_asn - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.primary_azure_port = primary_azure_port - self.secondary_azure_port = secondary_azure_port - self.shared_key = shared_key - self.vlan_id = vlan_id - self.microsoft_peering_config = microsoft_peering_config - self.stats = stats - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeering, self).__init__(**kwargs) + self.peering_type = kwargs.get('peering_type', None) + self.state = kwargs.get('state', None) + self.azure_asn = kwargs.get('azure_asn', None) + self.peer_asn = kwargs.get('peer_asn', None) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.primary_azure_port = kwargs.get('primary_azure_port', None) + self.secondary_azure_port = kwargs.get('secondary_azure_port', None) + self.shared_key = kwargs.get('shared_key', None) + self.vlan_id = kwargs.get('vlan_id', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.stats = kwargs.get('stats', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering_config.py index ffbe729f3c1b..b48496e64cc8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering_config.py @@ -38,9 +38,9 @@ class ExpressRouteCircuitPeeringConfig(Model): 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, } - def __init__(self, advertised_public_prefixes=None, advertised_public_prefixes_state=None, customer_asn=None, routing_registry_name=None): - super(ExpressRouteCircuitPeeringConfig, self).__init__() - self.advertised_public_prefixes = advertised_public_prefixes - self.advertised_public_prefixes_state = advertised_public_prefixes_state - self.customer_asn = customer_asn - self.routing_registry_name = routing_registry_name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = kwargs.get('advertised_public_prefixes', None) + self.advertised_public_prefixes_state = kwargs.get('advertised_public_prefixes_state', None) + self.customer_asn = kwargs.get('customer_asn', None) + self.routing_registry_name = kwargs.get('routing_registry_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..10e5c7b97755 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering_config_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitPeeringConfig(Model): + """Specifies the peering configuration. + + :param advertised_public_prefixes: The reference of + AdvertisedPublicPrefixes. + :type advertised_public_prefixes: list[str] + :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of + the Peering resource. Possible values are 'NotConfigured', 'Configuring', + 'Configured', and 'ValidationNeeded'. Possible values include: + 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' + :type advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :param customer_asn: The CustomerASN of the peering. + :type customer_asn: int + :param routing_registry_name: The RoutingRegistryName of the + configuration. + :type routing_registry_name: str + """ + + _attribute_map = { + 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, + 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, + 'customer_asn': {'key': 'customerASN', 'type': 'int'}, + 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, + } + + def __init__(self, *, advertised_public_prefixes=None, advertised_public_prefixes_state=None, customer_asn: int=None, routing_registry_name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = advertised_public_prefixes + self.advertised_public_prefixes_state = advertised_public_prefixes_state + self.customer_asn = customer_asn + self.routing_registry_name = routing_registry_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering_py3.py new file mode 100644 index 000000000000..cc2feacea699 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_peering_py3.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitPeering(SubResource): + """Peering in an ExpressRouteCircuit resource. + + :param id: Resource Identifier. + :type id: str + :param peering_type: The PeeringType. Possible values are: + 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. + Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + 'MicrosoftPeering' + :type peering_type: str or + ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeeringType + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeeringState + :param azure_asn: The Azure ASN. + :type azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: int + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param primary_azure_port: The primary port. + :type primary_azure_port: str + :param secondary_azure_port: The secondary port. + :type secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeeringConfig + :param stats: Gets peering stats. + :type stats: + ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitStats + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'int'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, peering_type=None, state=None, azure_asn: int=None, peer_asn: int=None, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, primary_azure_port: str=None, secondary_azure_port: str=None, shared_key: str=None, vlan_id: int=None, microsoft_peering_config=None, stats=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeering, self).__init__(id=id, **kwargs) + self.peering_type = peering_type + self.state = state + self.azure_asn = azure_asn + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = primary_azure_port + self.secondary_azure_port = secondary_azure_port + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.stats = stats + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_py3.py new file mode 100644 index 000000000000..f7acdb01ca2c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_py3.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteCircuit(Resource): + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The SKU. + :type sku: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitSku + :param circuit_provisioning_state: The CircuitProvisioningState state of + the resource. + :type circuit_provisioning_state: str + :param service_provider_provisioning_state: The + ServiceProviderProvisioningState state of the resource. Possible values + are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + 'Deprovisioning' + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2015_06_15.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: + list[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeering] + :param service_key: The ServiceKey. + :type service_key: str + :param service_provider_notes: The ServiceProviderNotes. + :type service_provider_notes: str + :param service_provider_properties: The ServiceProviderProperties. + :type service_provider_properties: + ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitServiceProviderProperties + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, + 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, circuit_provisioning_state: str=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key: str=None, service_provider_notes: str=None, service_provider_properties=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.circuit_provisioning_state = circuit_provisioning_state + self.service_provider_provisioning_state = service_provider_provisioning_state + self.authorizations = authorizations + self.peerings = peerings + self.service_key = service_key + self.service_provider_notes = service_provider_notes + self.service_provider_properties = service_provider_properties + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_routes_table.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_routes_table.py index 0373f5115c31..47f8b0b1291a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_routes_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_routes_table.py @@ -15,9 +15,11 @@ class ExpressRouteCircuitRoutesTable(Model): """The routes table associated with the ExpressRouteCircuit. + All required parameters must be populated in order to send to Azure. + :param address_prefix: Gets AddressPrefix. :type address_prefix: str - :param next_hop_type: Gets NextHopType. Possible values include: + :param next_hop_type: Required. Gets NextHopType. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' :type next_hop_type: str or @@ -39,9 +41,9 @@ class ExpressRouteCircuitRoutesTable(Model): 'as_path': {'key': 'asPath', 'type': 'str'}, } - def __init__(self, next_hop_type, address_prefix=None, next_hop_ip=None, as_path=None): - super(ExpressRouteCircuitRoutesTable, self).__init__() - self.address_prefix = address_prefix - self.next_hop_type = next_hop_type - self.next_hop_ip = next_hop_ip - self.as_path = as_path + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip = kwargs.get('next_hop_ip', None) + self.as_path = kwargs.get('as_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_routes_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_routes_table_py3.py new file mode 100644 index 000000000000..4489ad1c18e2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_routes_table_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTable(Model): + """The routes table associated with the ExpressRouteCircuit. + + All required parameters must be populated in order to send to Azure. + + :param address_prefix: Gets AddressPrefix. + :type address_prefix: str + :param next_hop_type: Required. Gets NextHopType. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2015_06_15.models.RouteNextHopType + :param next_hop_ip: Gets NextHopIP. + :type next_hop_ip: str + :param as_path: Gets AsPath. + :type as_path: str + """ + + _validation = { + 'next_hop_type': {'required': True}, + } + + _attribute_map = { + 'address_prefix': {'key': 'addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop_ip': {'key': 'nextHopIP', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type, address_prefix: str=None, next_hop_ip: str=None, as_path: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.address_prefix = address_prefix + self.next_hop_type = next_hop_type + self.next_hop_ip = next_hop_ip + self.as_path = as_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_service_provider_properties.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_service_provider_properties.py index 7a6b4ba96061..c51e6d8d653b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_service_provider_properties.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_service_provider_properties.py @@ -29,8 +29,8 @@ class ExpressRouteCircuitServiceProviderProperties(Model): 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, } - def __init__(self, service_provider_name=None, peering_location=None, bandwidth_in_mbps=None): - super(ExpressRouteCircuitServiceProviderProperties, self).__init__() - self.service_provider_name = service_provider_name - self.peering_location = peering_location - self.bandwidth_in_mbps = bandwidth_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = kwargs.get('service_provider_name', None) + self.peering_location = kwargs.get('peering_location', None) + self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_service_provider_properties_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_service_provider_properties_py3.py new file mode 100644 index 000000000000..ea701a54c3fe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_service_provider_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitServiceProviderProperties(Model): + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :param service_provider_name: The serviceProviderName. + :type service_provider_name: str + :param peering_location: The peering location. + :type peering_location: str + :param bandwidth_in_mbps: The BandwidthInMbps. + :type bandwidth_in_mbps: int + """ + + _attribute_map = { + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + } + + def __init__(self, *, service_provider_name: str=None, peering_location: str=None, bandwidth_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = service_provider_name + self.peering_location = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_sku.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_sku.py index 9ebdde1d6a5e..d5335be304ee 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_sku.py @@ -33,8 +33,8 @@ class ExpressRouteCircuitSku(Model): 'family': {'key': 'family', 'type': 'str'}, } - def __init__(self, name=None, tier=None, family=None): - super(ExpressRouteCircuitSku, self).__init__() - self.name = name - self.tier = tier - self.family = family + def __init__(self, **kwargs): + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.family = kwargs.get('family', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_sku_py3.py new file mode 100644 index 000000000000..602f2a9638e0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_sku_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitSku(Model): + """Contains SKU in an ExpressRouteCircuit. + + :param name: The name of the SKU. + :type name: str + :param tier: The tier of the SKU. Possible values are 'Standard' and + 'Premium'. Possible values include: 'Standard', 'Premium' + :type tier: str or + ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values are: 'UnlimitedData' + and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' + :type family: str or + ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, tier=None, family=None, **kwargs) -> None: + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.family = family diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_stats.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_stats.py index f11899cdc03f..124aaea36996 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_stats.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_stats.py @@ -26,7 +26,7 @@ class ExpressRouteCircuitStats(Model): 'bytes_out': {'key': 'bytesOut', 'type': 'int'}, } - def __init__(self, bytes_in=None, bytes_out=None): - super(ExpressRouteCircuitStats, self).__init__() - self.bytes_in = bytes_in - self.bytes_out = bytes_out + def __init__(self, **kwargs): + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.bytes_in = kwargs.get('bytes_in', None) + self.bytes_out = kwargs.get('bytes_out', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_stats_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_stats_py3.py new file mode 100644 index 000000000000..d248f00b14f7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_circuit_stats_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitStats(Model): + """Contains stats associated with the peering. + + :param bytes_in: Gets BytesIn of the peering. + :type bytes_in: int + :param bytes_out: Gets BytesOut of the peering. + :type bytes_out: int + """ + + _attribute_map = { + 'bytes_in': {'key': 'bytesIn', 'type': 'int'}, + 'bytes_out': {'key': 'bytesOut', 'type': 'int'}, + } + + def __init__(self, *, bytes_in: int=None, bytes_out: int=None, **kwargs) -> None: + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.bytes_in = bytes_in + self.bytes_out = bytes_out diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider.py index aaae8b3c6b77..81840a1bd81f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider.py @@ -53,8 +53,8 @@ class ExpressRouteServiceProvider(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state=None): - super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags) - self.peering_locations = peering_locations - self.bandwidths_offered = bandwidths_offered - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ExpressRouteServiceProvider, self).__init__(**kwargs) + self.peering_locations = kwargs.get('peering_locations', None) + self.bandwidths_offered = kwargs.get('bandwidths_offered', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider_bandwidths_offered.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider_bandwidths_offered.py index 9cbba2fcfe97..b27622af42d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider_bandwidths_offered.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider_bandwidths_offered.py @@ -26,7 +26,7 @@ class ExpressRouteServiceProviderBandwidthsOffered(Model): 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, } - def __init__(self, offer_name=None, value_in_mbps=None): - super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__() - self.offer_name = offer_name - self.value_in_mbps = value_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = kwargs.get('offer_name', None) + self.value_in_mbps = kwargs.get('value_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider_bandwidths_offered_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider_bandwidths_offered_py3.py new file mode 100644 index 000000000000..88516a0dfcf8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider_bandwidths_offered_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteServiceProviderBandwidthsOffered(Model): + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :param offer_name: The OfferName. + :type offer_name: str + :param value_in_mbps: The ValueInMbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__(self, *, offer_name: str=None, value_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = offer_name + self.value_in_mbps = value_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider_py3.py new file mode 100644 index 000000000000..3293b43fcd6f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/express_route_service_provider_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param peering_locations: Get a list of peering locations. + :type peering_locations: list[str] + :param bandwidths_offered: Gets bandwidths offered. + :type bandwidths_offered: + list[~azure.mgmt.network.v2015_06_15.models.ExpressRouteServiceProviderBandwidthsOffered] + :param provisioning_state: Gets the provisioning state of the resource. + :type provisioning_state: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, + 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state: str=None, **kwargs) -> None: + super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.peering_locations = peering_locations + self.bandwidths_offered = bandwidths_offered + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/frontend_ip_configuration.py index 60882ad25972..3346367c37e7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/frontend_ip_configuration.py @@ -71,16 +71,16 @@ class FrontendIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, load_balancing_rules=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(FrontendIPConfiguration, self).__init__(id=id) - self.inbound_nat_rules = inbound_nat_rules - self.inbound_nat_pools = inbound_nat_pools - self.outbound_nat_rules = outbound_nat_rules - self.load_balancing_rules = load_balancing_rules - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(FrontendIPConfiguration, self).__init__(**kwargs) + self.inbound_nat_rules = kwargs.get('inbound_nat_rules', None) + self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) + self.outbound_nat_rules = kwargs.get('outbound_nat_rules', None) + self.load_balancing_rules = kwargs.get('load_balancing_rules', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..80e25c8fdf62 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/frontend_ip_configuration_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class FrontendIPConfiguration(SubResource): + """Frontend IP address of the load balancer. + + :param id: Resource Identifier. + :type id: str + :param inbound_nat_rules: Read only. Inbound rules URIs that use this + frontend IP. + :type inbound_nat_rules: + list[~azure.mgmt.network.v2015_06_15.models.SubResource] + :param inbound_nat_pools: Read only. Inbound pools URIs that use this + frontend IP. + :type inbound_nat_pools: + list[~azure.mgmt.network.v2015_06_15.models.SubResource] + :param outbound_nat_rules: Read only. Outbound rules URIs that use this + frontend IP. + :type outbound_nat_rules: + list[~azure.mgmt.network.v2015_06_15.models.SubResource] + :param load_balancing_rules: Gets load balancing rules URIs that use this + frontend IP. + :type load_balancing_rules: + list[~azure.mgmt.network.v2015_06_15.models.SubResource] + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The Private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2015_06_15.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2015_06_15.models.Subnet + :param public_ip_address: The reference of the Public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2015_06_15.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[SubResource]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, load_balancing_rules=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(FrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.inbound_nat_rules = inbound_nat_rules + self.inbound_nat_pools = inbound_nat_pools + self.outbound_nat_rules = outbound_nat_rules + self.load_balancing_rules = load_balancing_rules + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_pool.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_pool.py index 30b6d0217912..5318ce7a8217 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_pool.py @@ -15,25 +15,29 @@ class InboundNatPool(SubResource): """Inbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource Identifier. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. :type frontend_ip_configuration: ~azure.mgmt.network.v2015_06_15.models.SubResource - :param protocol: The transport protocol for the endpoint. Possible values - are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :param protocol: Required. The transport protocol for the endpoint. + Possible values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2015_06_15.models.TransportProtocol - :param frontend_port_range_start: The first port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65534. + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. :type frontend_port_range_start: int - :param frontend_port_range_end: The last port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65535. + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. :type frontend_port_range_end: int - :param backend_port: The port used for internal connections on the - endpoint. Acceptable values are between 1 and 65535. + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. :type backend_port: int :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. @@ -65,13 +69,13 @@ class InboundNatPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port_range_start, frontend_port_range_end, backend_port, id=None, frontend_ip_configuration=None, provisioning_state=None, name=None, etag=None): - super(InboundNatPool, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.protocol = protocol - self.frontend_port_range_start = frontend_port_range_start - self.frontend_port_range_end = frontend_port_range_end - self.backend_port = backend_port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(InboundNatPool, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.protocol = kwargs.get('protocol', None) + self.frontend_port_range_start = kwargs.get('frontend_port_range_start', None) + self.frontend_port_range_end = kwargs.get('frontend_port_range_end', None) + self.backend_port = kwargs.get('backend_port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_pool_py3.py new file mode 100644 index 000000000000..edcbeedebee9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_pool_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatPool(SubResource): + """Inbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Identifier. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param protocol: Required. The transport protocol for the endpoint. + Possible values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2015_06_15.models.TransportProtocol + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. + :type frontend_port_range_start: int + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. + :type frontend_port_range_end: int + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port_range_start': {'required': True}, + 'frontend_port_range_end': {'required': True}, + 'backend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, + 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port_range_start: int, frontend_port_range_end: int, backend_port: int, id: str=None, frontend_ip_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatPool, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.protocol = protocol + self.frontend_port_range_start = frontend_port_range_start + self.frontend_port_range_end = frontend_port_range_end + self.backend_port = backend_port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_rule.py index 405bd46bdb16..fa809f17aa2a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_rule.py @@ -71,15 +71,15 @@ class InboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, backend_ip_configuration=None, protocol=None, frontend_port=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(InboundNatRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.backend_ip_configuration = backend_ip_configuration - self.protocol = protocol - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(InboundNatRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_ip_configuration = kwargs.get('backend_ip_configuration', None) + self.protocol = kwargs.get('protocol', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_rule_py3.py new file mode 100644 index 000000000000..f96eda7c2767 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/inbound_nat_rule_py3.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatRule(SubResource): + """Inbound NAT rule of the load balancer. + + :param id: Resource Identifier. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param backend_ip_configuration: A reference to a private IP address + defined on a network interface of a VM. Traffic sent to the frontend port + of each of the frontend IP configurations is forwarded to the backed IP. + :type backend_ip_configuration: + ~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceIPConfiguration + :param protocol: The transport protocol for the endpoint. Possible values + are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2015_06_15.models.TransportProtocol + :param frontend_port: The port for the external endpoint. Port numbers for + each rule must be unique within the Load Balancer. Acceptable values range + from 1 to 65534. + :type frontend_port: int + :param backend_port: The port used for the internal endpoint. Acceptable + values range from 1 to 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, backend_ip_configuration=None, protocol=None, frontend_port: int=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_ip_configuration = backend_ip_configuration + self.protocol = protocol + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/ip_configuration.py index 71236a281103..abc75e3cabf5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/ip_configuration.py @@ -51,12 +51,12 @@ class IPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(IPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(IPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/ip_configuration_py3.py new file mode 100644 index 000000000000..370dab687fd0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/ip_configuration_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class IPConfiguration(SubResource): + """IPConfiguration. + + :param id: Resource Identifier. + :type id: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2015_06_15.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2015_06_15.models.Subnet + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2015_06_15.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(IPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancer.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancer.py index fcb0b1421141..6b1c540d6ac1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancer.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancer.py @@ -97,15 +97,15 @@ class LoadBalancer(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(LoadBalancer, self).__init__(id=id, location=location, tags=tags) - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pools = backend_address_pools - self.load_balancing_rules = load_balancing_rules - self.probes = probes - self.inbound_nat_rules = inbound_nat_rules - self.inbound_nat_pools = inbound_nat_pools - self.outbound_nat_rules = outbound_nat_rules - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancer, self).__init__(**kwargs) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.load_balancing_rules = kwargs.get('load_balancing_rules', None) + self.probes = kwargs.get('probes', None) + self.inbound_nat_rules = kwargs.get('inbound_nat_rules', None) + self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) + self.outbound_nat_rules = kwargs.get('outbound_nat_rules', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancer_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancer_py3.py new file mode 100644 index 000000000000..217c6f8de781 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancer_py3.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LoadBalancer(Resource): + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param frontend_ip_configurations: Object representing the frontend IPs to + be used for the load balancer + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2015_06_15.models.FrontendIPConfiguration] + :param backend_address_pools: Collection of backend address pools used by + a load balancer + :type backend_address_pools: + list[~azure.mgmt.network.v2015_06_15.models.BackendAddressPool] + :param load_balancing_rules: Object collection representing the load + balancing rules Gets the provisioning + :type load_balancing_rules: + list[~azure.mgmt.network.v2015_06_15.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer + :type probes: list[~azure.mgmt.network.v2015_06_15.models.Probe] + :param inbound_nat_rules: Collection of inbound NAT Rules used by a load + balancer. Defining inbound NAT rules on your load balancer is mutually + exclusive with defining an inbound NAT pool. Inbound NAT pools are + referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an Inbound NAT pool. They + have to reference individual inbound NAT rules. + :type inbound_nat_rules: + list[~azure.mgmt.network.v2015_06_15.models.InboundNatRule] + :param inbound_nat_pools: Defines an external port range for inbound NAT + to a single backend port on NICs associated with a load balancer. Inbound + NAT rules are created automatically for each NIC associated with the Load + Balancer using an external port from this range. Defining an Inbound NAT + pool on your Load Balancer is mutually exclusive with defining inbound Nat + rules. Inbound NAT pools are referenced from virtual machine scale sets. + NICs that are associated with individual virtual machines cannot reference + an inbound NAT pool. They have to reference individual inbound NAT rules. + :type inbound_nat_pools: + list[~azure.mgmt.network.v2015_06_15.models.InboundNatPool] + :param outbound_nat_rules: The outbound NAT rules. + :type outbound_nat_rules: + list[~azure.mgmt.network.v2015_06_15.models.OutboundNatRule] + :param resource_guid: The resource GUID property of the load balancer + resource. + :type resource_guid: str + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, + 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[OutboundNatRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancer, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pools = backend_address_pools + self.load_balancing_rules = load_balancing_rules + self.probes = probes + self.inbound_nat_rules = inbound_nat_rules + self.inbound_nat_pools = inbound_nat_pools + self.outbound_nat_rules = outbound_nat_rules + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancing_rule.py index 5cf96430aa77..4a46fd23a615 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancing_rule.py @@ -15,6 +15,8 @@ class LoadBalancingRule(SubResource): """A loag balancing rule for a load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource Identifier. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. @@ -27,8 +29,9 @@ class LoadBalancingRule(SubResource): :param probe: The reference of the load balancer probe used by the load balancing rule. :type probe: ~azure.mgmt.network.v2015_06_15.models.SubResource - :param protocol: The transport protocol for the external endpoint. - Possible values are 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :param protocol: Required. The transport protocol for the external + endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: + 'Udp', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2015_06_15.models.TransportProtocol :param load_distribution: The load distribution policy for this rule. @@ -36,9 +39,9 @@ class LoadBalancingRule(SubResource): Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' :type load_distribution: str or ~azure.mgmt.network.v2015_06_15.models.LoadDistribution - :param frontend_port: The port for the external endpoint. Port numbers for - each rule must be unique within the Load Balancer. Acceptable values are - between 1 and 65534. + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 1 and 65534. :type frontend_port: int :param backend_port: The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. @@ -85,17 +88,17 @@ class LoadBalancingRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port, id=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(LoadBalancingRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.backend_address_pool = backend_address_pool - self.probe = probe - self.protocol = protocol - self.load_distribution = load_distribution - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancingRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.probe = kwargs.get('probe', None) + self.protocol = kwargs.get('protocol', None) + self.load_distribution = kwargs.get('load_distribution', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancing_rule_py3.py new file mode 100644 index 000000000000..695a8e63e564 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/load_balancing_rule_py3.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class LoadBalancingRule(SubResource): + """A loag balancing rule for a load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Identifier. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param backend_address_pool: A reference to a pool of DIPs. Inbound + traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param probe: The reference of the load balancer probe used by the load + balancing rule. + :type probe: ~azure.mgmt.network.v2015_06_15.models.SubResource + :param protocol: Required. The transport protocol for the external + endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: + 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2015_06_15.models.TransportProtocol + :param load_distribution: The load distribution policy for this rule. + Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + :type load_distribution: str or + ~azure.mgmt.network.v2015_06_15.models.LoadDistribution + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 1 and 65534. + :type frontend_port: int + :param backend_port: The port used for internal connections on the + endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port: int, id: str=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancingRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_address_pool = backend_address_pool + self.probe = probe + self.protocol = protocol + self.load_distribution = load_distribution + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/local_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/local_network_gateway.py index b68b75f2c724..1eac829334e9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/local_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/local_network_gateway.py @@ -65,11 +65,11 @@ class LocalNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, local_network_address_space=None, gateway_ip_address=None, bgp_settings=None, resource_guid=None, provisioning_state=None, etag=None): - super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.local_network_address_space = local_network_address_space - self.gateway_ip_address = gateway_ip_address - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(LocalNetworkGateway, self).__init__(**kwargs) + self.local_network_address_space = kwargs.get('local_network_address_space', None) + self.gateway_ip_address = kwargs.get('gateway_ip_address', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/local_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/local_network_gateway_py3.py new file mode 100644 index 000000000000..8dab2a33ea8f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/local_network_gateway_py3.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LocalNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param local_network_address_space: Local network site address space. + :type local_network_address_space: + ~azure.mgmt.network.v2015_06_15.models.AddressSpace + :param gateway_ip_address: IP address of local network gateway. + :type gateway_ip_address: str + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2015_06_15.models.BgpSettings + :param resource_guid: The resource GUID property of the + LocalNetworkGateway resource. + :type resource_guid: str + :param provisioning_state: Gets or sets Provisioning state of the + LocalNetworkGateway resource Updating/Deleting/Failed + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, + 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, local_network_address_space=None, gateway_ip_address: str=None, bgp_settings=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.local_network_address_space = local_network_address_space + self.gateway_ip_address = gateway_ip_address + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface.py index d08a48f0a7dc..d75fda3afd86 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface.py @@ -83,15 +83,15 @@ class NetworkInterface(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address=None, primary=None, enable_ip_forwarding=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkInterface, self).__init__(id=id, location=location, tags=tags) - self.virtual_machine = virtual_machine - self.network_security_group = network_security_group - self.ip_configurations = ip_configurations - self.dns_settings = dns_settings - self.mac_address = mac_address - self.primary = primary - self.enable_ip_forwarding = enable_ip_forwarding - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.virtual_machine = kwargs.get('virtual_machine', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.mac_address = kwargs.get('mac_address', None) + self.primary = kwargs.get('primary', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_dns_settings.py index dc60cbe8fba3..141689f91c86 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_dns_settings.py @@ -40,9 +40,9 @@ class NetworkInterfaceDnsSettings(Model): 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, } - def __init__(self, dns_servers=None, applied_dns_servers=None, internal_dns_name_label=None, internal_fqdn=None): - super(NetworkInterfaceDnsSettings, self).__init__() - self.dns_servers = dns_servers - self.applied_dns_servers = applied_dns_servers - self.internal_dns_name_label = internal_dns_name_label - self.internal_fqdn = internal_fqdn + def __init__(self, **kwargs): + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + self.applied_dns_servers = kwargs.get('applied_dns_servers', None) + self.internal_dns_name_label = kwargs.get('internal_dns_name_label', None) + self.internal_fqdn = kwargs.get('internal_fqdn', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_dns_settings_py3.py new file mode 100644 index 000000000000..1755891ff075 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_dns_settings_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceDnsSettings(Model): + """DNS settings of a network interface. + + :param dns_servers: List of DNS servers IP addresses. Use + 'AzureProvidedDNS' to switch to azure provided DNS resolution. + 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + only value in dnsServers collection. + :type dns_servers: list[str] + :param applied_dns_servers: If the VM that uses this NIC is part of an + Availability Set, then this list will have the union of all DNS servers + from all NICs that are part of the Availability Set. This property is what + is configured on each of those VMs. + :type applied_dns_servers: list[str] + :param internal_dns_name_label: Relative DNS name for this NIC used for + internal communications between VMs in the same virtual network. + :type internal_dns_name_label: str + :param internal_fqdn: Fully qualified DNS name supporting internal + communications between VMs in the same virtual network. + :type internal_fqdn: str + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, + 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + } + + def __init__(self, *, dns_servers=None, applied_dns_servers=None, internal_dns_name_label: str=None, internal_fqdn: str=None, **kwargs) -> None: + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers + self.applied_dns_servers = applied_dns_servers + self.internal_dns_name_label = internal_dns_name_label + self.internal_fqdn = internal_fqdn diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_ip_configuration.py index c3257546a025..f729fc3eb1ab 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_ip_configuration.py @@ -60,14 +60,14 @@ class NetworkInterfaceIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(NetworkInterfaceIPConfiguration, self).__init__(id=id) - self.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterfaceIPConfiguration, self).__init__(**kwargs) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_rules = kwargs.get('load_balancer_inbound_nat_rules', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_ip_configuration_py3.py new file mode 100644 index 000000000000..fbb4cce88425 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_ip_configuration_py3.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class NetworkInterfaceIPConfiguration(SubResource): + """IPConfiguration in a network interface. + + :param id: Resource Identifier. + :type id: str + :param load_balancer_backend_address_pools: The reference of + LoadBalancerBackendAddressPool resource. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2015_06_15.models.BackendAddressPool] + :param load_balancer_inbound_nat_rules: A list of references of + LoadBalancerInboundNatRules. + :type load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2015_06_15.models.InboundNatRule] + :param private_ip_address: + :type private_ip_address: str + :param private_ip_allocation_method: Defines how a private IP address is + assigned. Possible values are: 'Static' and 'Dynamic'. Possible values + include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2015_06_15.models.IPAllocationMethod + :param subnet: + :type subnet: ~azure.mgmt.network.v2015_06_15.models.Subnet + :param public_ip_address: + :type public_ip_address: + ~azure.mgmt.network.v2015_06_15.models.PublicIPAddress + :param provisioning_state: + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterfaceIPConfiguration, self).__init__(id=id, **kwargs) + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_py3.py new file mode 100644 index 000000000000..7d1ab38ee4bc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_py3.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkInterface(Resource): + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param virtual_machine: The reference of a virtual machine. + :type virtual_machine: ~azure.mgmt.network.v2015_06_15.models.SubResource + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroup + :param ip_configurations: A list of IPConfigurations of the network + interface. + :type ip_configurations: + list[~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceIPConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: + ~azure.mgmt.network.v2015_06_15.models.NetworkInterfaceDnsSettings + :param mac_address: The MAC address of the network interface. + :type mac_address: str + :param primary: Gets whether this is a primary network interface on a + virtual machine. + :type primary: bool + :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on + this network interface. + :type enable_ip_forwarding: bool + :param resource_guid: The resource GUID property of the network interface + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, + 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address: str=None, primary: bool=None, enable_ip_forwarding: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterface, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.virtual_machine = virtual_machine + self.network_security_group = network_security_group + self.ip_configurations = ip_configurations + self.dns_settings = dns_settings + self.mac_address = mac_address + self.primary = primary + self.enable_ip_forwarding = enable_ip_forwarding + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_management_client_enums.py index 34425eb9c99a..85e378dffbc1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_management_client_enums.py @@ -12,50 +12,50 @@ from enum import Enum -class ApplicationGatewaySkuName(Enum): +class ApplicationGatewaySkuName(str, Enum): standard_small = "Standard_Small" standard_medium = "Standard_Medium" standard_large = "Standard_Large" -class ApplicationGatewayTier(Enum): +class ApplicationGatewayTier(str, Enum): standard = "Standard" -class IPAllocationMethod(Enum): +class IPAllocationMethod(str, Enum): static = "Static" dynamic = "Dynamic" -class TransportProtocol(Enum): +class TransportProtocol(str, Enum): udp = "Udp" tcp = "Tcp" -class SecurityRuleProtocol(Enum): +class SecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" asterisk = "*" -class SecurityRuleAccess(Enum): +class SecurityRuleAccess(str, Enum): allow = "Allow" deny = "Deny" -class SecurityRuleDirection(Enum): +class SecurityRuleDirection(str, Enum): inbound = "Inbound" outbound = "Outbound" -class RouteNextHopType(Enum): +class RouteNextHopType(str, Enum): virtual_network_gateway = "VirtualNetworkGateway" vnet_local = "VnetLocal" @@ -64,25 +64,25 @@ class RouteNextHopType(Enum): none = "None" -class ApplicationGatewayProtocol(Enum): +class ApplicationGatewayProtocol(str, Enum): http = "Http" https = "Https" -class ApplicationGatewayCookieBasedAffinity(Enum): +class ApplicationGatewayCookieBasedAffinity(str, Enum): enabled = "Enabled" disabled = "Disabled" -class ApplicationGatewayRequestRoutingRuleType(Enum): +class ApplicationGatewayRequestRoutingRuleType(str, Enum): basic = "Basic" path_based_routing = "PathBasedRouting" -class ApplicationGatewayOperationalState(Enum): +class ApplicationGatewayOperationalState(str, Enum): stopped = "Stopped" starting = "Starting" @@ -90,13 +90,13 @@ class ApplicationGatewayOperationalState(Enum): stopping = "Stopping" -class AuthorizationUseStatus(Enum): +class AuthorizationUseStatus(str, Enum): available = "Available" in_use = "InUse" -class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(str, Enum): not_configured = "NotConfigured" configuring = "Configuring" @@ -104,32 +104,32 @@ class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): validation_needed = "ValidationNeeded" -class ExpressRouteCircuitPeeringType(Enum): +class ExpressRouteCircuitPeeringType(str, Enum): azure_public_peering = "AzurePublicPeering" azure_private_peering = "AzurePrivatePeering" microsoft_peering = "MicrosoftPeering" -class ExpressRouteCircuitPeeringState(Enum): +class ExpressRouteCircuitPeeringState(str, Enum): disabled = "Disabled" enabled = "Enabled" -class ExpressRouteCircuitSkuTier(Enum): +class ExpressRouteCircuitSkuTier(str, Enum): standard = "Standard" premium = "Premium" -class ExpressRouteCircuitSkuFamily(Enum): +class ExpressRouteCircuitSkuFamily(str, Enum): unlimited_data = "UnlimitedData" metered_data = "MeteredData" -class ServiceProviderProvisioningState(Enum): +class ServiceProviderProvisioningState(str, Enum): not_provisioned = "NotProvisioned" provisioning = "Provisioning" @@ -137,59 +137,59 @@ class ServiceProviderProvisioningState(Enum): deprovisioning = "Deprovisioning" -class LoadDistribution(Enum): +class LoadDistribution(str, Enum): default = "Default" source_ip = "SourceIP" source_ip_protocol = "SourceIPProtocol" -class ProbeProtocol(Enum): +class ProbeProtocol(str, Enum): http = "Http" tcp = "Tcp" -class NetworkOperationStatus(Enum): +class NetworkOperationStatus(str, Enum): in_progress = "InProgress" succeeded = "Succeeded" failed = "Failed" -class VirtualNetworkGatewayType(Enum): +class VirtualNetworkGatewayType(str, Enum): vpn = "Vpn" express_route = "ExpressRoute" -class VpnType(Enum): +class VpnType(str, Enum): policy_based = "PolicyBased" route_based = "RouteBased" -class VirtualNetworkGatewaySkuName(Enum): +class VirtualNetworkGatewaySkuName(str, Enum): basic = "Basic" high_performance = "HighPerformance" standard = "Standard" -class VirtualNetworkGatewaySkuTier(Enum): +class VirtualNetworkGatewaySkuTier(str, Enum): basic = "Basic" high_performance = "HighPerformance" standard = "Standard" -class ProcessorArchitecture(Enum): +class ProcessorArchitecture(str, Enum): amd64 = "Amd64" x86 = "X86" -class VirtualNetworkGatewayConnectionType(Enum): +class VirtualNetworkGatewayConnectionType(str, Enum): ipsec = "IPsec" vnet2_vnet = "Vnet2Vnet" @@ -197,7 +197,7 @@ class VirtualNetworkGatewayConnectionType(Enum): vpn_client = "VPNClient" -class VirtualNetworkGatewayConnectionStatus(Enum): +class VirtualNetworkGatewayConnectionStatus(str, Enum): unknown = "Unknown" connecting = "Connecting" diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_security_group.py index 7213d08bb536..08c8e88c72a9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_security_group.py @@ -73,12 +73,12 @@ class NetworkSecurityGroup(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, security_rules=None, default_security_rules=None, network_interfaces=None, subnets=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags) - self.security_rules = security_rules - self.default_security_rules = default_security_rules - self.network_interfaces = network_interfaces - self.subnets = subnets - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(NetworkSecurityGroup, self).__init__(**kwargs) + self.security_rules = kwargs.get('security_rules', None) + self.default_security_rules = kwargs.get('default_security_rules', None) + self.network_interfaces = kwargs.get('network_interfaces', None) + self.subnets = kwargs.get('subnets', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_security_group_py3.py new file mode 100644 index 000000000000..65a66f7c8d76 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_security_group_py3.py @@ -0,0 +1,84 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkSecurityGroup(Resource): + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param security_rules: A collection of security rules of the network + security group. + :type security_rules: + list[~azure.mgmt.network.v2015_06_15.models.SecurityRule] + :param default_security_rules: The default security rules of network + security group. + :type default_security_rules: + list[~azure.mgmt.network.v2015_06_15.models.SecurityRule] + :param network_interfaces: A collection of references to network + interfaces. + :type network_interfaces: + list[~azure.mgmt.network.v2015_06_15.models.NetworkInterface] + :param subnets: A collection of references to subnets. + :type subnets: list[~azure.mgmt.network.v2015_06_15.models.Subnet] + :param resource_guid: The resource GUID property of the network security + group resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, + 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, security_rules=None, default_security_rules=None, network_interfaces=None, subnets=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.security_rules = security_rules + self.default_security_rules = default_security_rules + self.network_interfaces = network_interfaces + self.subnets = subnets + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/outbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/outbound_nat_rule.py index 6b66e4e2ac09..d6c730fe9387 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/outbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/outbound_nat_rule.py @@ -15,6 +15,8 @@ class OutboundNatRule(SubResource): """Outbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource Identifier. :type id: str :param allocated_outbound_ports: The number of outbound ports to be used @@ -24,8 +26,8 @@ class OutboundNatRule(SubResource): balancer. :type frontend_ip_configurations: list[~azure.mgmt.network.v2015_06_15.models.SubResource] - :param backend_address_pool: A reference to a pool of DIPs. Outbound - traffic is randomly load balanced across IPs in the backend IPs. + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. :type backend_address_pool: ~azure.mgmt.network.v2015_06_15.models.SubResource :param provisioning_state: Gets the provisioning state of the PublicIP @@ -53,11 +55,11 @@ class OutboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, backend_address_pool, id=None, allocated_outbound_ports=None, frontend_ip_configurations=None, provisioning_state=None, name=None, etag=None): - super(OutboundNatRule, self).__init__(id=id) - self.allocated_outbound_ports = allocated_outbound_ports - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pool = backend_address_pool - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(OutboundNatRule, self).__init__(**kwargs) + self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/outbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/outbound_nat_rule_py3.py new file mode 100644 index 000000000000..f3f8acbb60e5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/outbound_nat_rule_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class OutboundNatRule(SubResource): + """Outbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Identifier. + :type id: str + :param allocated_outbound_ports: The number of outbound ports to be used + for NAT. + :type allocated_outbound_ports: int + :param frontend_ip_configurations: The Frontend IP addresses of the load + balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2015_06_15.models.SubResource] + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_address_pool': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, backend_address_pool, id: str=None, allocated_outbound_ports: int=None, frontend_ip_configurations=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(OutboundNatRule, self).__init__(id=id, **kwargs) + self.allocated_outbound_ports = allocated_outbound_ports + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pool = backend_address_pool + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/probe.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/probe.py index 53a8bd0444d0..d59bc78e4c89 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/probe.py @@ -15,20 +15,22 @@ class Probe(SubResource): """A load balancer probe. + All required parameters must be populated in order to send to Azure. + :param id: Resource Identifier. :type id: str :param load_balancing_rules: The load balancer rules that use this probe. :type load_balancing_rules: list[~azure.mgmt.network.v2015_06_15.models.SubResource] - :param protocol: The protocol of the end point. Possible values are: - 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the - probe to be successful. If 'Http' is specified, a 200 OK response from the - specifies URI is required for the probe to be successful. Possible values - include: 'Http', 'Tcp' + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2015_06_15.models.ProbeProtocol - :param port: The port for communicating the probe. Possible values range - from 1 to 65535, inclusive. + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. :type port: int :param interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is @@ -74,14 +76,14 @@ class Probe(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, port, id=None, load_balancing_rules=None, interval_in_seconds=None, number_of_probes=None, request_path=None, provisioning_state=None, name=None, etag=None): - super(Probe, self).__init__(id=id) - self.load_balancing_rules = load_balancing_rules - self.protocol = protocol - self.port = port - self.interval_in_seconds = interval_in_seconds - self.number_of_probes = number_of_probes - self.request_path = request_path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(Probe, self).__init__(**kwargs) + self.load_balancing_rules = kwargs.get('load_balancing_rules', None) + self.protocol = kwargs.get('protocol', None) + self.port = kwargs.get('port', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.number_of_probes = kwargs.get('number_of_probes', None) + self.request_path = kwargs.get('request_path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/probe_py3.py new file mode 100644 index 000000000000..f4d48cdfbfd0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/probe_py3.py @@ -0,0 +1,89 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Probe(SubResource): + """A load balancer probe. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Identifier. + :type id: str + :param load_balancing_rules: The load balancer rules that use this probe. + :type load_balancing_rules: + list[~azure.mgmt.network.v2015_06_15.models.SubResource] + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2015_06_15.models.ProbeProtocol + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. + :type port: int + :param interval_in_seconds: The interval, in seconds, for how frequently + to probe the endpoint for health status. Typically, the interval is + slightly less than half the allocated timeout period (in seconds) which + allows two full probes before taking the instance out of rotation. The + default value is 15, the minimum value is 5. + :type interval_in_seconds: int + :param number_of_probes: The number of probes where if no response, will + result in stopping further traffic from being delivered to the endpoint. + This values allows endpoints to be taken out of rotation faster or slower + than the typical times used in Azure. + :type number_of_probes: int + :param request_path: The URI used for requesting health status from the + VM. Path is required if a protocol is set to http. Otherwise, it is not + allowed. There is no default value. + :type request_path: str + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, + 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, port: int, id: str=None, load_balancing_rules=None, interval_in_seconds: int=None, number_of_probes: int=None, request_path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Probe, self).__init__(id=id, **kwargs) + self.load_balancing_rules = load_balancing_rules + self.protocol = protocol + self.port = port + self.interval_in_seconds = interval_in_seconds + self.number_of_probes = number_of_probes + self.request_path = request_path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address.py index 19087b57742b..92db6e3b6b95 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address.py @@ -76,13 +76,13 @@ class PublicIPAddress(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, public_ip_allocation_method=None, ip_configuration=None, dns_settings=None, ip_address=None, idle_timeout_in_minutes=None, resource_guid=None, provisioning_state=None, etag=None): - super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags) - self.public_ip_allocation_method = public_ip_allocation_method - self.ip_configuration = ip_configuration - self.dns_settings = dns_settings - self.ip_address = ip_address - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(PublicIPAddress, self).__init__(**kwargs) + self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) + self.ip_configuration = kwargs.get('ip_configuration', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_address = kwargs.get('ip_address', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address_dns_settings.py index a248461f05d7..07dfe30433a6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address_dns_settings.py @@ -38,8 +38,8 @@ class PublicIPAddressDnsSettings(Model): 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, } - def __init__(self, domain_name_label=None, fqdn=None, reverse_fqdn=None): - super(PublicIPAddressDnsSettings, self).__init__() - self.domain_name_label = domain_name_label - self.fqdn = fqdn - self.reverse_fqdn = reverse_fqdn + def __init__(self, **kwargs): + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) + self.fqdn = kwargs.get('fqdn', None) + self.reverse_fqdn = kwargs.get('reverse_fqdn', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address_dns_settings_py3.py new file mode 100644 index 000000000000..e84aa9c10bf5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address_dns_settings_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressDnsSettings(Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :param domain_name_label: Gets or sets the Domain name label.The + concatenation of the domain name label and the regionalized DNS zone make + up the fully qualified domain name associated with the public IP address. + If a domain name label is specified, an A DNS record is created for the + public IP in the Microsoft Azure DNS system. + :type domain_name_label: str + :param fqdn: Gets the FQDN, Fully qualified domain name of the A DNS + record associated with the public IP. This is the concatenation of the + domainNameLabel and the regionalized DNS zone. + :type fqdn: str + :param reverse_fqdn: Gets or Sets the Reverse FQDN. A user-visible, fully + qualified domain name that resolves to this public IP address. If the + reverseFqdn is specified, then a PTR DNS record is created pointing from + the IP address in the in-addr.arpa domain to the reverse FQDN. + :type reverse_fqdn: str + """ + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, + } + + def __init__(self, *, domain_name_label: str=None, fqdn: str=None, reverse_fqdn: str=None, **kwargs) -> None: + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label + self.fqdn = fqdn + self.reverse_fqdn = reverse_fqdn diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address_py3.py new file mode 100644 index 000000000000..552351f506fd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/public_ip_address_py3.py @@ -0,0 +1,88 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PublicIPAddress(Resource): + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param public_ip_allocation_method: The public IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type public_ip_allocation_method: str or + ~azure.mgmt.network.v2015_06_15.models.IPAllocationMethod + :param ip_configuration: + :type ip_configuration: + ~azure.mgmt.network.v2015_06_15.models.IPConfiguration + :param dns_settings: The FQDN of the DNS record associated with the public + IP address. + :type dns_settings: + ~azure.mgmt.network.v2015_06_15.models.PublicIPAddressDnsSettings + :param ip_address: + :type ip_address: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param resource_guid: The resource GUID property of the public IP + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, public_ip_allocation_method=None, ip_configuration=None, dns_settings=None, ip_address: str=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.public_ip_allocation_method = public_ip_allocation_method + self.ip_configuration = ip_configuration + self.dns_settings = dns_settings + self.ip_address = ip_address + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/resource.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/resource.py index 94ff6ae67cd3..687c0b3b9053 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/resource.py @@ -43,10 +43,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, location=None, tags=None): - super(Resource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/resource_py3.py new file mode 100644 index 000000000000..a1fae7e80f47 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/resource_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Azure resource manager resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route.py index fa6650dcf900..67b145a26205 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route.py @@ -15,13 +15,15 @@ class Route(SubResource): """Route resource. + All required parameters must be populated in order to send to Azure. + :param id: Resource Identifier. :type id: str :param address_prefix: The destination CIDR to which the route applies. :type address_prefix: str - :param next_hop_type: The type of Azure hop the packet should be sent to. - Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - 'VirtualAppliance', and 'None'. Possible values include: + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' :type next_hop_type: str or @@ -55,11 +57,11 @@ class Route(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, next_hop_type, id=None, address_prefix=None, next_hop_ip_address=None, provisioning_state=None, name=None, etag=None): - super(Route, self).__init__(id=id) - self.address_prefix = address_prefix - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(Route, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route_py3.py new file mode 100644 index 000000000000..364f8ed1966b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Route(SubResource): + """Route resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Identifier. + :type id: str + :param address_prefix: The destination CIDR to which the route applies. + :type address_prefix: str + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2015_06_15.models.RouteNextHopType + :param next_hop_ip_address: The IP address packets should be forwarded to. + Next hop values are only allowed in routes where the next hop type is + VirtualAppliance. + :type next_hop_ip_address: str + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'next_hop_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type, id: str=None, address_prefix: str=None, next_hop_ip_address: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Route, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route_table.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route_table.py index 70eccf8e97b7..2ef803a48d80 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route_table.py @@ -57,9 +57,9 @@ class RouteTable(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, routes=None, subnets=None, provisioning_state=None, etag=None): - super(RouteTable, self).__init__(id=id, location=location, tags=tags) - self.routes = routes - self.subnets = subnets - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(RouteTable, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) + self.subnets = kwargs.get('subnets', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route_table_py3.py new file mode 100644 index 000000000000..5bad4f936c4e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/route_table_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteTable(Resource): + """Route table resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param routes: Collection of routes contained within a route table. + :type routes: list[~azure.mgmt.network.v2015_06_15.models.Route] + :param subnets: A collection of references to subnets. + :type subnets: list[~azure.mgmt.network.v2015_06_15.models.Subnet] + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'routes': {'key': 'properties.routes', 'type': '[Route]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, routes=None, subnets=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(RouteTable, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.routes = routes + self.subnets = subnets + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/security_rule.py index 539453ed469b..b60316030e93 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/security_rule.py @@ -15,12 +15,15 @@ class SecurityRule(SubResource): """Network security rule. + All required parameters must be populated in order to send to Azure. + :param id: Resource Identifier. :type id: str :param description: A description for this rule. Restricted to 140 chars. :type description: str - :param protocol: Network protocol this rule applies to. Possible values - are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*' + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' :type protocol: str or ~azure.mgmt.network.v2015_06_15.models.SecurityRuleProtocol :param source_port_range: The source port or range. Integer or range @@ -30,18 +33,19 @@ class SecurityRule(SubResource): range between 0 and 65535. Asterix '*' can also be used to match all ports. :type destination_port_range: str - :param source_address_prefix: The CIDR or source IP range. Asterix '*' can - also be used to match all source IPs. Default tags such as + :param source_address_prefix: Required. The CIDR or source IP range. + Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. :type source_address_prefix: str - :param destination_address_prefix: The destination address prefix. CIDR or - source IP range. Asterix '*' can also be used to match all source IPs. - Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - can also be used. + :param destination_address_prefix: Required. The destination address + prefix. CIDR or source IP range. Asterix '*' can also be used to match all + source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. :type destination_address_prefix: str - :param access: The network traffic is allowed or denied. Possible values - are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' :type access: str or ~azure.mgmt.network.v2015_06_15.models.SecurityRuleAccess :param priority: The priority of the rule. The value can be between 100 @@ -49,10 +53,10 @@ class SecurityRule(SubResource): collection. The lower the priority number, the higher the priority of the rule. :type priority: int - :param direction: The direction of the rule. The direction specifies if - rule will be evaluated on incoming or outcoming traffic. Possible values - are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', - 'Outbound' + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2015_06_15.models.SecurityRuleDirection :param provisioning_state: The provisioning state of the public IP @@ -90,17 +94,17 @@ class SecurityRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, source_address_prefix, destination_address_prefix, access, direction, id=None, description=None, source_port_range=None, destination_port_range=None, priority=None, provisioning_state=None, name=None, etag=None): - super(SecurityRule, self).__init__(id=id) - self.description = description - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_address_prefix = source_address_prefix - self.destination_address_prefix = destination_address_prefix - self.access = access - self.priority = priority - self.direction = direction - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(SecurityRule, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/security_rule_py3.py new file mode 100644 index 000000000000..6fe655311045 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/security_rule_py3.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class SecurityRule(SubResource): + """Network security rule. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource Identifier. + :type id: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2015_06_15.models.SecurityRuleProtocol + :param source_port_range: The source port or range. Integer or range + between 0 and 65535. Asterix '*' can also be used to match all ports. + :type source_port_range: str + :param destination_port_range: The destination port or range. Integer or + range between 0 and 65535. Asterix '*' can also be used to match all + ports. + :type destination_port_range: str + :param source_address_prefix: Required. The CIDR or source IP range. + Asterix '*' can also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + this is an ingress rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param destination_address_prefix: Required. The destination address + prefix. CIDR or source IP range. Asterix '*' can also be used to match all + source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. + :type destination_address_prefix: str + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' + :type access: str or + ~azure.mgmt.network.v2015_06_15.models.SecurityRuleAccess + :param priority: The priority of the rule. The value can be between 100 + and 4096. The priority number must be unique for each rule in the + collection. The lower the priority number, the higher the priority of the + rule. + :type priority: int + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2015_06_15.models.SecurityRuleDirection + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'source_address_prefix': {'required': True}, + 'destination_address_prefix': {'required': True}, + 'access': {'required': True}, + 'direction': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, source_address_prefix: str, destination_address_prefix: str, access, direction, id: str=None, description: str=None, source_port_range: str=None, destination_port_range: str=None, priority: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(SecurityRule, self).__init__(id=id, **kwargs) + self.description = description + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/sub_resource.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/sub_resource.py index 27a3d1ca7c6d..e696786f5bca 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/sub_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/sub_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/sub_resource_py3.py new file mode 100644 index 000000000000..3ff52dab3f2d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """Azure resource manager sub resource properties. + + :param id: Resource Identifier. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/subnet.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/subnet.py index 96695523ac4f..644866e4f1f9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/subnet.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/subnet.py @@ -50,12 +50,12 @@ class Subnet(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, address_prefix=None, network_security_group=None, route_table=None, ip_configurations=None, provisioning_state=None, name=None, etag=None): - super(Subnet, self).__init__(id=id) - self.address_prefix = address_prefix - self.network_security_group = network_security_group - self.route_table = route_table - self.ip_configurations = ip_configurations - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(Subnet, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.route_table = kwargs.get('route_table', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/subnet_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/subnet_py3.py new file mode 100644 index 000000000000..82865643b697 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/subnet_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Subnet(SubResource): + """Subnet in a virtual network resource. + + :param id: Resource Identifier. + :type id: str + :param address_prefix: The address prefix for the subnet. + :type address_prefix: str + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroup + :param route_table: The reference of the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2015_06_15.models.RouteTable + :param ip_configurations: Gets an array of references to the network + interface IP configurations using subnet. + :type ip_configurations: + list[~azure.mgmt.network.v2015_06_15.models.IPConfiguration] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, address_prefix: str=None, network_security_group=None, route_table=None, ip_configurations=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Subnet, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.network_security_group = network_security_group + self.route_table = route_table + self.ip_configurations = ip_configurations + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage.py index 39d4c7e77e18..43ca84a5f2fe 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage.py @@ -18,14 +18,16 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar unit: An enum describing the unit of measurement. Default value: - "Count" . + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . :vartype unit: str - :param current_value: The current value of the usage. + :param current_value: Required. The current value of the usage. :type current_value: long - :param limit: The limit of usage. + :param limit: Required. The limit of usage. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.network.v2015_06_15.models.UsageName """ @@ -45,8 +47,8 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() - self.current_value = current_value - self.limit = limit - self.name = name + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage_name.py index df7f344bfb9b..bd1813944fdc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage_name_py3.py new file mode 100644 index 000000000000..4e5e3e10de15 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage_py3.py new file mode 100644 index 000000000000..7c4b3e38afe2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/usage_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes network resource usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . + :vartype unit: str + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.network.v2015_06_15.models.UsageName + """ + + _validation = { + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network.py index a161538a82c2..f504156a1d91 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network.py @@ -66,11 +66,11 @@ class VirtualNetwork(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, address_space=None, dhcp_options=None, subnets=None, resource_guid=None, provisioning_state=None, etag=None): - super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags) - self.address_space = address_space - self.dhcp_options = dhcp_options - self.subnets = subnets - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetwork, self).__init__(**kwargs) + self.address_space = kwargs.get('address_space', None) + self.dhcp_options = kwargs.get('dhcp_options', None) + self.subnets = kwargs.get('subnets', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway.py index 127f0b9da167..fe1117526369 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway.py @@ -94,16 +94,16 @@ class VirtualNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid=None, provisioning_state=None, etag=None): - super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.ip_configurations = ip_configurations - self.gateway_type = gateway_type - self.vpn_type = vpn_type - self.enable_bgp = enable_bgp - self.gateway_default_site = gateway_default_site - self.sku = sku - self.vpn_client_configuration = vpn_client_configuration - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetworkGateway, self).__init__(**kwargs) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.gateway_type = kwargs.get('gateway_type', None) + self.vpn_type = kwargs.get('vpn_type', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.gateway_default_site = kwargs.get('gateway_default_site', None) + self.sku = kwargs.get('sku', None) + self.vpn_client_configuration = kwargs.get('vpn_client_configuration', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_connection.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_connection.py index 2d9284082100..a55200e8cdba 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_connection.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_connection.py @@ -104,20 +104,20 @@ class VirtualNetworkGatewayConnection(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway1=None, virtual_network_gateway2=None, local_network_gateway2=None, connection_type=None, routing_weight=None, shared_key=None, connection_status=None, egress_bytes_transferred=None, ingress_bytes_transferred=None, peer=None, enable_bgp=None, resource_guid=None, provisioning_state=None, etag=None): - super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key - self.connection_status = connection_status - self.egress_bytes_transferred = egress_bytes_transferred - self.ingress_bytes_transferred = ingress_bytes_transferred - self.peer = peer - self.enable_bgp = enable_bgp - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnection, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) + self.connection_status = kwargs.get('connection_status', None) + self.egress_bytes_transferred = kwargs.get('egress_bytes_transferred', None) + self.ingress_bytes_transferred = kwargs.get('ingress_bytes_transferred', None) + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_connection_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_connection_py3.py new file mode 100644 index 000000000000..82e79511fede --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_connection_py3.py @@ -0,0 +1,123 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnection(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: + :type virtual_network_gateway1: + ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway + :param virtual_network_gateway2: + :type virtual_network_gateway2: + ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway + :param local_network_gateway2: + :type local_network_gateway2: + ~azure.mgmt.network.v2015_06_15.models.LocalNetworkGateway + :param connection_type: Gateway connection type. Possible values are: + 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :param connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :type connection_status: str or + ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnectionStatus + :param egress_bytes_transferred: The egress bytes transferred in this + connection. + :type egress_bytes_transferred: long + :param ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :type ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2015_06_15.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway1=None, virtual_network_gateway2=None, local_network_gateway2=None, connection_type=None, routing_weight: int=None, shared_key: str=None, connection_status=None, egress_bytes_transferred: int=None, ingress_bytes_transferred: int=None, peer=None, enable_bgp: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = connection_status + self.egress_bytes_transferred = egress_bytes_transferred + self.ingress_bytes_transferred = ingress_bytes_transferred + self.peer = peer + self.enable_bgp = enable_bgp + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_ip_configuration.py index 98e22be832ee..84050bb888f5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_ip_configuration.py @@ -52,12 +52,12 @@ class VirtualNetworkGatewayIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetworkGatewayIPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..dd43bb8666cf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_ip_configuration_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + :param id: Resource Identifier. + :type id: str + :param private_ip_address: Gets or sets the privateIPAddress of the IP + Configuration + :type private_ip_address: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2015_06_15.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2015_06_15.models.SubResource + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_py3.py new file mode 100644 index 000000000000..315b1145c6ac --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_py3.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param ip_configurations: IP configurations for virtual network gateway. + :type ip_configurations: + list[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible + values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', + 'ExpressRoute' + :type gateway_type: str or + ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayType + :param vpn_type: The type of this virtual network gateway. Possible values + are: 'PolicyBased' and 'RouteBased'. Possible values include: + 'PolicyBased', 'RouteBased' + :type vpn_type: str or ~azure.mgmt.network.v2015_06_15.models.VpnType + :param enable_bgp: Whether BGP is enabled for this virtual network gateway + or not. + :type enable_bgp: bool + :param gateway_default_site: The reference of the LocalNetworkGateway + resource which represents local network site having default routes. Assign + Null value in case of removing existing default site setting. + :type gateway_default_site: + ~azure.mgmt.network.v2015_06_15.models.SubResource + :param sku: The reference of the VirtualNetworkGatewaySku resource which + represents the SKU selected for Virtual network gateway. + :type sku: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewaySku + :param vpn_client_configuration: The reference of the + VpnClientConfiguration resource which represents the P2S VpnClient + configurations. + :type vpn_client_configuration: + ~azure.mgmt.network.v2015_06_15.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2015_06_15.models.BgpSettings + :param resource_guid: The resource GUID property of the + VirtualNetworkGateway resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the + VirtualNetworkGateway resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, + 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, + 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, + 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, + 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp: bool=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.ip_configurations = ip_configurations + self.gateway_type = gateway_type + self.vpn_type = vpn_type + self.enable_bgp = enable_bgp + self.gateway_default_site = gateway_default_site + self.sku = sku + self.vpn_client_configuration = vpn_client_configuration + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_sku.py index 045d1db7db2d..dcbd7b5212af 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_sku.py @@ -33,8 +33,8 @@ class VirtualNetworkGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(VirtualNetworkGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_sku_py3.py new file mode 100644 index 000000000000..4c527ffbb652 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_gateway_sku_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkGatewaySku(Model): + """VirtualNetworkGatewaySku details. + + :param name: Gateway sku name -Basic/HighPerformance/Standard. Possible + values include: 'Basic', 'HighPerformance', 'Standard' + :type name: str or + ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewaySkuName + :param tier: Gateway sku tier -Basic/HighPerformance/Standard. Possible + values include: 'Basic', 'HighPerformance', 'Standard' + :type tier: str or + ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewaySkuTier + :param capacity: The capacity + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_py3.py new file mode 100644 index 000000000000..cfe0f7cd677d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/virtual_network_py3.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetwork(Resource): + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource Identifier. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param address_space: The AddressSpace that contains an array of IP + address ranges that can be used by subnets. + :type address_space: ~azure.mgmt.network.v2015_06_15.models.AddressSpace + :param dhcp_options: The dhcpOptions that contains an array of DNS servers + available to VMs deployed in the virtual network. + :type dhcp_options: ~azure.mgmt.network.v2015_06_15.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2015_06_15.models.Subnet] + :param resource_guid: The resourceGuid property of the Virtual Network + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, address_space=None, dhcp_options=None, subnets=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.address_space = address_space + self.dhcp_options = dhcp_options + self.subnets = subnets + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_configuration.py index 79216c335b1c..c2d6ac59027f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_configuration.py @@ -35,8 +35,8 @@ class VpnClientConfiguration(Model): 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, } - def __init__(self, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None): - super(VpnClientConfiguration, self).__init__() - self.vpn_client_address_pool = vpn_client_address_pool - self.vpn_client_root_certificates = vpn_client_root_certificates - self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + def __init__(self, **kwargs): + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = kwargs.get('vpn_client_address_pool', None) + self.vpn_client_root_certificates = kwargs.get('vpn_client_root_certificates', None) + self.vpn_client_revoked_certificates = kwargs.get('vpn_client_revoked_certificates', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_configuration_py3.py new file mode 100644 index 000000000000..39b2332152fa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_configuration_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientConfiguration(Model): + """VpnClientConfiguration for P2S client. + + :param vpn_client_address_pool: Gets or sets the reference of the Address + space resource which represents Address space for P2S VpnClient. + :type vpn_client_address_pool: + ~azure.mgmt.network.v2015_06_15.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for Virtual + network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2015_06_15.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for + Virtual network gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2015_06_15.models.VpnClientRevokedCertificate] + """ + + _attribute_map = { + 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, + 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, + } + + def __init__(self, *, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, **kwargs) -> None: + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = vpn_client_address_pool + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_parameters.py index 82a458c33efd..e4f23bee6b5e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_parameters.py @@ -25,6 +25,6 @@ class VpnClientParameters(Model): 'processor_architecture': {'key': 'ProcessorArchitecture', 'type': 'str'}, } - def __init__(self, processor_architecture=None): - super(VpnClientParameters, self).__init__() - self.processor_architecture = processor_architecture + def __init__(self, **kwargs): + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = kwargs.get('processor_architecture', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_parameters_py3.py new file mode 100644 index 000000000000..ce00f1dcfe23 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_parameters_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientParameters(Model): + """VpnClientParameters. + + :param processor_architecture: VPN client Processor Architecture. Possible + values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' + :type processor_architecture: str or + ~azure.mgmt.network.v2015_06_15.models.ProcessorArchitecture + """ + + _attribute_map = { + 'processor_architecture': {'key': 'ProcessorArchitecture', 'type': 'str'}, + } + + def __init__(self, *, processor_architecture=None, **kwargs) -> None: + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = processor_architecture diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_revoked_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_revoked_certificate.py index 6b997a6872d1..004767a84a8a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_revoked_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_revoked_certificate.py @@ -39,9 +39,9 @@ class VpnClientRevokedCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, thumbprint=None, provisioning_state=None, name=None, etag=None): - super(VpnClientRevokedCertificate, self).__init__(id=id) - self.thumbprint = thumbprint - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(VpnClientRevokedCertificate, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_revoked_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_revoked_certificate_py3.py new file mode 100644 index 000000000000..e90d86e1768a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_revoked_certificate_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + :param id: Resource Identifier. + :type id: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + :param provisioning_state: The provisioning state of the VPN client + revoked certificate resource. Possible values are: 'Updating', 'Deleting', + and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, thumbprint: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRevokedCertificate, self).__init__(id=id, **kwargs) + self.thumbprint = thumbprint + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_root_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_root_certificate.py index 27e80ab7f998..2b93e570ff60 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_root_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_root_certificate.py @@ -39,9 +39,9 @@ class VpnClientRootCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, public_cert_data=None, provisioning_state=None, name=None, etag=None): - super(VpnClientRootCertificate, self).__init__(id=id) - self.public_cert_data = public_cert_data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(VpnClientRootCertificate, self).__init__(**kwargs) + self.public_cert_data = kwargs.get('public_cert_data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_root_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_root_certificate_py3.py new file mode 100644 index 000000000000..b4f5ffb31fb1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/vpn_client_root_certificate_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + :param id: Resource Identifier. + :type id: str + :param public_cert_data: Gets or sets the certificate public data + :type public_cert_data: str + :param provisioning_state: The provisioning state of the VPN client root + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, public_cert_data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRootCertificate, self).__init__(id=id, **kwargs) + self.public_cert_data = public_cert_data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/network_management_client.py index a90750a3bc81..83d61852c713 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/network_management_client.py @@ -15,7 +15,8 @@ from .version import VERSION from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.application_gateways_operations import ApplicationGatewaysOperations from .operations.express_route_circuit_authorizations_operations import ExpressRouteCircuitAuthorizationsOperations @@ -196,7 +197,7 @@ def check_dns_name_availability( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability' + url = self.check_dns_name_availability.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -238,3 +239,4 @@ def check_dns_name_availability( return client_raw_response return deserialized + check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/application_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/application_gateways_operations.py index cec082493657..b9bfd4a51f4d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/application_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/application_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ApplicationGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def get( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def _create_or_update_initial( self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2015_06_15.models.ApplicationGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.ApplicationGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.ApplicationGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ApplicationGateway', response) if raw: @@ -312,12 +276,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -339,7 +305,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -385,6 +351,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -404,7 +371,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -449,12 +416,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} def _start_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -490,7 +458,7 @@ def _start_initial( return client_raw_response def start( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -498,12 +466,14 @@ def start( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -513,46 +483,26 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} def _stop_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -588,7 +538,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -596,12 +546,14 @@ def stop( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -611,37 +563,17 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_circuit_authorizations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_circuit_authorizations_operations.py index 153eba27e3c5..2773df60999d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_circuit_authorizations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_circuit_authorizations_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified authorization from the specified express route circuit. @@ -91,12 +91,14 @@ def delete( :param authorization_name: The name of the authorization. :type authorization_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def get( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): @@ -166,7 +148,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an authorization in the specified express route circuit. @@ -278,13 +261,17 @@ def create_or_update( :type authorization_parameters: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitAuthorization :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitAuthorization or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitAuthorization or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitAuthorization] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitAuthorization]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -296,30 +283,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitAuthorization', response) if raw: @@ -328,12 +293,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +324,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -404,3 +371,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_circuit_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_circuit_peerings_operations.py index f9e32e615c18..51e4832b954c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_circuit_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_circuit_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param peering_name: The name of the peering. :type peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def get( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -275,13 +258,17 @@ def create_or_update( :type peering_parameters: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitPeering or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuitPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitPeering', response) if raw: @@ -325,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -401,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_circuits_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_circuits_operations.py index e8f3e0125833..f9cb8b37986e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_circuits_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_circuits_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param circuit_name: The name of the express route circuit. :type circuit_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def get( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuit :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuit or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuit] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.ExpressRouteCircuit]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuit', response) if raw: @@ -312,12 +276,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def list_arp_table( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +309,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/arpTable' + url = self.list_arp_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -390,6 +356,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/arpTable'} def list_routes_table( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -415,7 +382,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/routesTable' + url = self.list_routes_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -462,6 +429,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/routesTable'} def list_stats( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -486,7 +454,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats' + url = self.list_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -533,6 +501,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -554,7 +523,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -600,6 +569,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -619,7 +589,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -664,3 +634,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_service_providers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_service_providers_operations.py index d060fc328c86..0124fb6bd8bd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_service_providers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/express_route_service_providers_operations.py @@ -22,7 +22,7 @@ class ExpressRouteServiceProvidersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/load_balancers_operations.py index 11b331a7c048..fc390eaba5b5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/load_balancers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param load_balancer_name: The name of the load balancer. :type load_balancer_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def get( self, resource_group_name, load_balancer_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( balancer operation. :type parameters: ~azure.mgmt.network.v2015_06_15.models.LoadBalancer :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns LoadBalancer - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.LoadBalancer] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.LoadBalancer]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LoadBalancer', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -340,7 +306,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -385,6 +351,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -406,7 +373,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -452,3 +419,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/local_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/local_network_gateways_operations.py index 7706113dc606..c8368bf7704e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/local_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/local_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LocalNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a local network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2015_06_15.models.LocalNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - LocalNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.LocalNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.LocalNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LocalNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def get( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def _delete_initial( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type local_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +309,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -389,3 +355,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/network_interfaces_operations.py index fa29034f3bea..a4718eed0700 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/network_interfaces_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def get( self, resource_group_name, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def _create_or_update_initial( self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2015_06_15.models.NetworkInterface :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkInterface or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.NetworkInterface] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.NetworkInterface]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkInterface', response) if raw: @@ -316,12 +280,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -341,7 +307,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -386,6 +352,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -453,6 +420,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} def list_virtual_machine_scale_set_vm_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, custom_headers=None, raw=False, **operation_config): @@ -480,7 +448,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces' + url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -528,6 +496,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} def list_virtual_machine_scale_set_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -552,7 +521,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces' + url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -599,6 +568,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} def get_virtual_machine_scale_set_network_interface( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -626,7 +596,7 @@ def get_virtual_machine_scale_set_network_interface( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}' + url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -671,3 +641,4 @@ def get_virtual_machine_scale_set_network_interface( return client_raw_response return deserialized + get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/network_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/network_security_groups_operations.py index 292d61c2676b..dae054cab08b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/network_security_groups_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/network_security_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkSecurityGroupsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -88,12 +88,14 @@ def delete( group. :type network_security_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -103,40 +105,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def get( self, resource_group_name, network_security_group_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -203,12 +185,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -257,7 +240,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network security group in the specified resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroup :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.NetworkSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkSecurityGroup', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -345,7 +311,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -390,6 +356,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -411,7 +378,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -457,3 +424,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/public_ip_addresses_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/public_ip_addresses_operations.py index 31a52a67000f..fef4de29650f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/public_ip_addresses_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/public_ip_addresses_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PublicIPAddressesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param public_ip_address_name: The name of the subnet. :type public_ip_address_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def get( self, resource_group_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def _create_or_update_initial( self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2015_06_15.models.PublicIPAddress :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PublicIPAddress or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.PublicIPAddress] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.PublicIPAddress]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('PublicIPAddress', response) if raw: @@ -316,12 +280,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -341,7 +307,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -386,6 +352,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -453,3 +420,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/route_tables_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/route_tables_operations.py index 4c66d8151a3a..550e8368f444 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/route_tables_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/route_tables_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteTablesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_table_name: The name of the route table. :type route_table_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def get( self, resource_group_name, route_table_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( table operation. :type parameters: ~azure.mgmt.network.v2015_06_15.models.RouteTable :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteTable - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.RouteTable] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.RouteTable]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteTable', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -342,7 +308,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -388,6 +354,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -452,3 +419,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/routes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/routes_operations.py index f8ddf2a6f90b..f159fb5fad51 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/routes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/routes_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RoutesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param route_name: The name of the route. :type route_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def get( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -272,13 +255,16 @@ def create_or_update( route operation. :type route_parameters: ~azure.mgmt.network.v2015_06_15.models.Route :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Route or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Route or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.Route] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.Route]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -290,30 +276,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Route', response) if raw: @@ -322,12 +286,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def list( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): @@ -351,7 +317,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -398,3 +364,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/security_rules_operations.py index f43ce3b5c125..c4dda9e3d689 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/security_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( :param security_rule_name: The name of the security rule. :type security_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def get( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a security rule in the specified network security group. @@ -277,13 +260,16 @@ def create_or_update( :type security_rule_parameters: ~azure.mgmt.network.v2015_06_15.models.SecurityRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns SecurityRule - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.SecurityRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.SecurityRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -295,30 +281,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('SecurityRule', response) if raw: @@ -327,12 +291,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def list( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +323,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -404,3 +370,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/subnets_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/subnets_operations.py index b3f03d9ebcba..476d986c190c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/subnets_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/subnets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SubnetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param subnet_name: The name of the subnet. :type subnet_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}'} def get( self, resource_group_name, virtual_network_name, subnet_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -276,13 +259,16 @@ def create_or_update( subnet operation. :type subnet_parameters: ~azure.mgmt.network.v2015_06_15.models.Subnet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Subnet or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Subnet or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.Subnet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.Subnet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -294,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Subnet', response) if raw: @@ -326,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -355,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -402,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/usages_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/usages_operations.py index 636d17f6ca70..abbcb4e333d5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/usages_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/usages_operations.py @@ -22,7 +22,7 @@ class UsagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/virtual_network_gateway_connections_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/virtual_network_gateway_connections_operations.py index a045682ef2fe..040481830f97 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/virtual_network_gateway_connections_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/virtual_network_gateway_connections_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway connection in the specified resource group. @@ -106,13 +106,17 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnection :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGatewayConnection or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnection or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnection] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGatewayConnection]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +127,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGatewayConnection', response) if raw: @@ -155,12 +137,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def get( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -185,7 +169,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -226,12 +210,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -267,7 +252,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -276,12 +261,14 @@ def delete( virtual network gateway connection. :type virtual_network_gateway_connection_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -291,40 +278,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def get_shared_key( self, resource_group_name, connection_shared_key_name, custom_headers=None, raw=False, **operation_config): @@ -349,7 +316,7 @@ def get_shared_key( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{connectionSharedKeyName}/sharedkey' + url = self.get_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'connectionSharedKeyName': self._serialize.url("connection_shared_key_name", connection_shared_key_name, 'str'), @@ -390,6 +357,7 @@ def get_shared_key( return client_raw_response return deserialized + get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{connectionSharedKeyName}/sharedkey'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -412,7 +380,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -458,6 +426,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} def _reset_shared_key_initial( @@ -465,7 +434,7 @@ def _reset_shared_key_initial( parameters = models.ConnectionResetSharedKey(key_length=key_length) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset' + url = self.reset_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -512,7 +481,7 @@ def _reset_shared_key_initial( return deserialized def reset_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, key_length=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, key_length=None, custom_headers=None, raw=False, polling=True, **operation_config): """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -527,13 +496,17 @@ def reset_shared_key( length :type key_length: long :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionResetSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConnectionResetSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.ConnectionResetSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.ConnectionResetSharedKey]] :raises: :class:`CloudError` """ raw_result = self._reset_shared_key_initial( @@ -544,30 +517,8 @@ def reset_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectionResetSharedKey', response) if raw: @@ -576,12 +527,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} def _set_shared_key_initial( @@ -589,7 +542,7 @@ def _set_shared_key_initial( parameters = models.ConnectionSharedKey(value=value) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.set_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -638,7 +591,7 @@ def _set_shared_key_initial( return deserialized def set_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, value=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, value=None, custom_headers=None, raw=False, polling=True, **operation_config): """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -652,13 +605,16 @@ def set_shared_key( :param value: The virtual network connection shared key value :type value: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectionSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.ConnectionSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.ConnectionSharedKey]] :raises: :class:`CloudError` """ raw_result = self._set_shared_key_initial( @@ -669,30 +625,8 @@ def set_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ConnectionSharedKey', response) if raw: @@ -701,9 +635,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/virtual_network_gateways_operations.py index 5e75e2a0a234..a7fa5d8c4bfb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/virtual_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def get( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +309,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -389,12 +355,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} def _reset_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset' + url = self.reset.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -441,7 +408,7 @@ def _reset_initial( return deserialized def reset( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Resets the primary of the virtual network gateway in the specified resource group. @@ -455,13 +422,16 @@ def reset( :type parameters: ~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._reset_initial( @@ -472,30 +442,8 @@ def reset( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -504,12 +452,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} def generatevpnclientpackage( self, resource_group_name, virtual_network_gateway_name, processor_architecture=None, custom_headers=None, raw=False, **operation_config): @@ -538,7 +488,7 @@ def generatevpnclientpackage( parameters = models.VpnClientParameters(processor_architecture=processor_architecture) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage' + url = self.generatevpnclientpackage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -583,3 +533,4 @@ def generatevpnclientpackage( return client_raw_response return deserialized + generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/virtual_networks_operations.py b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/virtual_networks_operations.py index 6e9c59d41e13..157347935449 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/virtual_networks_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/virtual_networks_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworksOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2015-06-15". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param virtual_network_name: The name of the virtual network. :type virtual_network_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def get( self, resource_group_name, virtual_network_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2015_06_15.models.VirtualNetwork :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetwork or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2015_06_15.models.VirtualNetwork] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2015_06_15.models.VirtualNetwork]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetwork', response) if raw: @@ -316,12 +280,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -341,7 +307,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualnetworks' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -386,6 +352,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualnetworks'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -453,3 +420,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/__init__.py index c850bd434303..324fde9e156a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/__init__.py @@ -9,127 +9,250 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource -from .network_interface_dns_settings import NetworkInterfaceDnsSettings -from .sub_resource import SubResource -from .public_ip_address_dns_settings import PublicIPAddressDnsSettings -from .resource_navigation_link import ResourceNavigationLink -from .route import Route -from .security_rule import SecurityRule -from .application_gateway_backend_address import ApplicationGatewayBackendAddress -from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool -from .backend_address_pool import BackendAddressPool -from .inbound_nat_rule import InboundNatRule -from .ip_configuration import IPConfiguration -from .public_ip_address import PublicIPAddress -from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration -from .network_interface import NetworkInterface -from .network_security_group import NetworkSecurityGroup -from .route_table import RouteTable -from .subnet import Subnet -from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings -from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer -from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings -from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool -from .application_gateway_backend_health import ApplicationGatewayBackendHealth -from .application_gateway_sku import ApplicationGatewaySku -from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy -from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration -from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate -from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate -from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration -from .application_gateway_frontend_port import ApplicationGatewayFrontendPort -from .application_gateway_http_listener import ApplicationGatewayHttpListener -from .application_gateway_path_rule import ApplicationGatewayPathRule -from .application_gateway_probe import ApplicationGatewayProbe -from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule -from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap -from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration -from .application_gateway import ApplicationGateway -from .dns_name_availability_result import DnsNameAvailabilityResult -from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization -from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig -from .express_route_circuit_stats import ExpressRouteCircuitStats -from .express_route_circuit_peering import ExpressRouteCircuitPeering -from .express_route_circuit_sku import ExpressRouteCircuitSku -from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties -from .express_route_circuit import ExpressRouteCircuit -from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable -from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult -from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable -from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult -from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary -from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult -from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered -from .express_route_service_provider import ExpressRouteServiceProvider -from .frontend_ip_configuration import FrontendIPConfiguration -from .load_balancing_rule import LoadBalancingRule -from .probe import Probe -from .inbound_nat_pool import InboundNatPool -from .outbound_nat_rule import OutboundNatRule -from .load_balancer import LoadBalancer -from .error_details import ErrorDetails -from .error import Error -from .azure_async_operation_result import AzureAsyncOperationResult -from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation -from .effective_network_security_rule import EffectiveNetworkSecurityRule -from .effective_network_security_group import EffectiveNetworkSecurityGroup -from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult -from .effective_route import EffectiveRoute -from .effective_route_list_result import EffectiveRouteListResult -from .network_watcher import NetworkWatcher -from .topology_parameters import TopologyParameters -from .topology_association import TopologyAssociation -from .topology_resource import TopologyResource -from .topology import Topology -from .verification_ip_flow_parameters import VerificationIPFlowParameters -from .verification_ip_flow_result import VerificationIPFlowResult -from .next_hop_parameters import NextHopParameters -from .next_hop_result import NextHopResult -from .security_group_view_parameters import SecurityGroupViewParameters -from .network_interface_association import NetworkInterfaceAssociation -from .subnet_association import SubnetAssociation -from .security_rule_associations import SecurityRuleAssociations -from .security_group_network_interface import SecurityGroupNetworkInterface -from .security_group_view_result import SecurityGroupViewResult -from .packet_capture_storage_location import PacketCaptureStorageLocation -from .packet_capture_filter import PacketCaptureFilter -from .packet_capture_parameters import PacketCaptureParameters -from .packet_capture import PacketCapture -from .packet_capture_result import PacketCaptureResult -from .packet_capture_query_status_result import PacketCaptureQueryStatusResult -from .troubleshooting_parameters import TroubleshootingParameters -from .query_troubleshooting_parameters import QueryTroubleshootingParameters -from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions -from .troubleshooting_details import TroubleshootingDetails -from .troubleshooting_result import TroubleshootingResult -from .retention_policy_parameters import RetentionPolicyParameters -from .flow_log_status_parameters import FlowLogStatusParameters -from .flow_log_information import FlowLogInformation -from .usage_name import UsageName -from .usage import Usage -from .virtual_network_peering import VirtualNetworkPeering -from .address_space import AddressSpace -from .dhcp_options import DhcpOptions -from .virtual_network import VirtualNetwork -from .ip_address_availability_result import IPAddressAvailabilityResult -from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration -from .virtual_network_gateway_sku import VirtualNetworkGatewaySku -from .vpn_client_root_certificate import VpnClientRootCertificate -from .vpn_client_revoked_certificate import VpnClientRevokedCertificate -from .vpn_client_configuration import VpnClientConfiguration -from .bgp_settings import BgpSettings -from .bgp_peer_status import BgpPeerStatus -from .gateway_route import GatewayRoute -from .virtual_network_gateway import VirtualNetworkGateway -from .vpn_client_parameters import VpnClientParameters -from .bgp_peer_status_list_result import BgpPeerStatusListResult -from .gateway_route_list_result import GatewayRouteListResult -from .tunnel_connection_health import TunnelConnectionHealth -from .local_network_gateway import LocalNetworkGateway -from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection -from .connection_reset_shared_key import ConnectionResetSharedKey -from .connection_shared_key import ConnectionSharedKey +try: + from .resource_py3 import Resource + from .network_interface_dns_settings_py3 import NetworkInterfaceDnsSettings + from .sub_resource_py3 import SubResource + from .public_ip_address_dns_settings_py3 import PublicIPAddressDnsSettings + from .resource_navigation_link_py3 import ResourceNavigationLink + from .route_py3 import Route + from .security_rule_py3 import SecurityRule + from .application_gateway_backend_address_py3 import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool_py3 import ApplicationGatewayBackendAddressPool + from .backend_address_pool_py3 import BackendAddressPool + from .inbound_nat_rule_py3 import InboundNatRule + from .ip_configuration_py3 import IPConfiguration + from .public_ip_address_py3 import PublicIPAddress + from .network_interface_ip_configuration_py3 import NetworkInterfaceIPConfiguration + from .network_interface_py3 import NetworkInterface + from .network_security_group_py3 import NetworkSecurityGroup + from .route_table_py3 import RouteTable + from .subnet_py3 import Subnet + from .application_gateway_backend_http_settings_py3 import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server_py3 import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings_py3 import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool_py3 import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health_py3 import ApplicationGatewayBackendHealth + from .application_gateway_sku_py3 import ApplicationGatewaySku + from .application_gateway_ssl_policy_py3 import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration_py3 import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate_py3 import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate_py3 import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration_py3 import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port_py3 import ApplicationGatewayFrontendPort + from .application_gateway_http_listener_py3 import ApplicationGatewayHttpListener + from .application_gateway_path_rule_py3 import ApplicationGatewayPathRule + from .application_gateway_probe_py3 import ApplicationGatewayProbe + from .application_gateway_request_routing_rule_py3 import ApplicationGatewayRequestRoutingRule + from .application_gateway_url_path_map_py3 import ApplicationGatewayUrlPathMap + from .application_gateway_web_application_firewall_configuration_py3 import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway_py3 import ApplicationGateway + from .dns_name_availability_result_py3 import DnsNameAvailabilityResult + from .express_route_circuit_authorization_py3 import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config_py3 import ExpressRouteCircuitPeeringConfig + from .express_route_circuit_stats_py3 import ExpressRouteCircuitStats + from .express_route_circuit_peering_py3 import ExpressRouteCircuitPeering + from .express_route_circuit_sku_py3 import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties_py3 import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit_py3 import ExpressRouteCircuit + from .express_route_circuit_arp_table_py3 import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result_py3 import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table_py3 import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result_py3 import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary_py3 import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result_py3 import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered_py3 import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider_py3 import ExpressRouteServiceProvider + from .frontend_ip_configuration_py3 import FrontendIPConfiguration + from .load_balancing_rule_py3 import LoadBalancingRule + from .probe_py3 import Probe + from .inbound_nat_pool_py3 import InboundNatPool + from .outbound_nat_rule_py3 import OutboundNatRule + from .load_balancer_py3 import LoadBalancer + from .error_details_py3 import ErrorDetails + from .error_py3 import Error + from .azure_async_operation_result_py3 import AzureAsyncOperationResult + from .effective_network_security_group_association_py3 import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule_py3 import EffectiveNetworkSecurityRule + from .effective_network_security_group_py3 import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result_py3 import EffectiveNetworkSecurityGroupListResult + from .effective_route_py3 import EffectiveRoute + from .effective_route_list_result_py3 import EffectiveRouteListResult + from .network_watcher_py3 import NetworkWatcher + from .topology_parameters_py3 import TopologyParameters + from .topology_association_py3 import TopologyAssociation + from .topology_resource_py3 import TopologyResource + from .topology_py3 import Topology + from .verification_ip_flow_parameters_py3 import VerificationIPFlowParameters + from .verification_ip_flow_result_py3 import VerificationIPFlowResult + from .next_hop_parameters_py3 import NextHopParameters + from .next_hop_result_py3 import NextHopResult + from .security_group_view_parameters_py3 import SecurityGroupViewParameters + from .network_interface_association_py3 import NetworkInterfaceAssociation + from .subnet_association_py3 import SubnetAssociation + from .security_rule_associations_py3 import SecurityRuleAssociations + from .security_group_network_interface_py3 import SecurityGroupNetworkInterface + from .security_group_view_result_py3 import SecurityGroupViewResult + from .packet_capture_storage_location_py3 import PacketCaptureStorageLocation + from .packet_capture_filter_py3 import PacketCaptureFilter + from .packet_capture_parameters_py3 import PacketCaptureParameters + from .packet_capture_py3 import PacketCapture + from .packet_capture_result_py3 import PacketCaptureResult + from .packet_capture_query_status_result_py3 import PacketCaptureQueryStatusResult + from .troubleshooting_parameters_py3 import TroubleshootingParameters + from .query_troubleshooting_parameters_py3 import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions_py3 import TroubleshootingRecommendedActions + from .troubleshooting_details_py3 import TroubleshootingDetails + from .troubleshooting_result_py3 import TroubleshootingResult + from .retention_policy_parameters_py3 import RetentionPolicyParameters + from .flow_log_status_parameters_py3 import FlowLogStatusParameters + from .flow_log_information_py3 import FlowLogInformation + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .virtual_network_peering_py3 import VirtualNetworkPeering + from .address_space_py3 import AddressSpace + from .dhcp_options_py3 import DhcpOptions + from .virtual_network_py3 import VirtualNetwork + from .ip_address_availability_result_py3 import IPAddressAvailabilityResult + from .virtual_network_gateway_ip_configuration_py3 import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku_py3 import VirtualNetworkGatewaySku + from .vpn_client_root_certificate_py3 import VpnClientRootCertificate + from .vpn_client_revoked_certificate_py3 import VpnClientRevokedCertificate + from .vpn_client_configuration_py3 import VpnClientConfiguration + from .bgp_settings_py3 import BgpSettings + from .bgp_peer_status_py3 import BgpPeerStatus + from .gateway_route_py3 import GatewayRoute + from .virtual_network_gateway_py3 import VirtualNetworkGateway + from .vpn_client_parameters_py3 import VpnClientParameters + from .bgp_peer_status_list_result_py3 import BgpPeerStatusListResult + from .gateway_route_list_result_py3 import GatewayRouteListResult + from .tunnel_connection_health_py3 import TunnelConnectionHealth + from .local_network_gateway_py3 import LocalNetworkGateway + from .virtual_network_gateway_connection_py3 import VirtualNetworkGatewayConnection + from .connection_reset_shared_key_py3 import ConnectionResetSharedKey + from .connection_shared_key_py3 import ConnectionSharedKey +except (SyntaxError, ImportError): + from .resource import Resource + from .network_interface_dns_settings import NetworkInterfaceDnsSettings + from .sub_resource import SubResource + from .public_ip_address_dns_settings import PublicIPAddressDnsSettings + from .resource_navigation_link import ResourceNavigationLink + from .route import Route + from .security_rule import SecurityRule + from .application_gateway_backend_address import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool + from .backend_address_pool import BackendAddressPool + from .inbound_nat_rule import InboundNatRule + from .ip_configuration import IPConfiguration + from .public_ip_address import PublicIPAddress + from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration + from .network_interface import NetworkInterface + from .network_security_group import NetworkSecurityGroup + from .route_table import RouteTable + from .subnet import Subnet + from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health import ApplicationGatewayBackendHealth + from .application_gateway_sku import ApplicationGatewaySku + from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port import ApplicationGatewayFrontendPort + from .application_gateway_http_listener import ApplicationGatewayHttpListener + from .application_gateway_path_rule import ApplicationGatewayPathRule + from .application_gateway_probe import ApplicationGatewayProbe + from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule + from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap + from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway import ApplicationGateway + from .dns_name_availability_result import DnsNameAvailabilityResult + from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig + from .express_route_circuit_stats import ExpressRouteCircuitStats + from .express_route_circuit_peering import ExpressRouteCircuitPeering + from .express_route_circuit_sku import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit import ExpressRouteCircuit + from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider import ExpressRouteServiceProvider + from .frontend_ip_configuration import FrontendIPConfiguration + from .load_balancing_rule import LoadBalancingRule + from .probe import Probe + from .inbound_nat_pool import InboundNatPool + from .outbound_nat_rule import OutboundNatRule + from .load_balancer import LoadBalancer + from .error_details import ErrorDetails + from .error import Error + from .azure_async_operation_result import AzureAsyncOperationResult + from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule import EffectiveNetworkSecurityRule + from .effective_network_security_group import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult + from .effective_route import EffectiveRoute + from .effective_route_list_result import EffectiveRouteListResult + from .network_watcher import NetworkWatcher + from .topology_parameters import TopologyParameters + from .topology_association import TopologyAssociation + from .topology_resource import TopologyResource + from .topology import Topology + from .verification_ip_flow_parameters import VerificationIPFlowParameters + from .verification_ip_flow_result import VerificationIPFlowResult + from .next_hop_parameters import NextHopParameters + from .next_hop_result import NextHopResult + from .security_group_view_parameters import SecurityGroupViewParameters + from .network_interface_association import NetworkInterfaceAssociation + from .subnet_association import SubnetAssociation + from .security_rule_associations import SecurityRuleAssociations + from .security_group_network_interface import SecurityGroupNetworkInterface + from .security_group_view_result import SecurityGroupViewResult + from .packet_capture_storage_location import PacketCaptureStorageLocation + from .packet_capture_filter import PacketCaptureFilter + from .packet_capture_parameters import PacketCaptureParameters + from .packet_capture import PacketCapture + from .packet_capture_result import PacketCaptureResult + from .packet_capture_query_status_result import PacketCaptureQueryStatusResult + from .troubleshooting_parameters import TroubleshootingParameters + from .query_troubleshooting_parameters import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions + from .troubleshooting_details import TroubleshootingDetails + from .troubleshooting_result import TroubleshootingResult + from .retention_policy_parameters import RetentionPolicyParameters + from .flow_log_status_parameters import FlowLogStatusParameters + from .flow_log_information import FlowLogInformation + from .usage_name import UsageName + from .usage import Usage + from .virtual_network_peering import VirtualNetworkPeering + from .address_space import AddressSpace + from .dhcp_options import DhcpOptions + from .virtual_network import VirtualNetwork + from .ip_address_availability_result import IPAddressAvailabilityResult + from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku import VirtualNetworkGatewaySku + from .vpn_client_root_certificate import VpnClientRootCertificate + from .vpn_client_revoked_certificate import VpnClientRevokedCertificate + from .vpn_client_configuration import VpnClientConfiguration + from .bgp_settings import BgpSettings + from .bgp_peer_status import BgpPeerStatus + from .gateway_route import GatewayRoute + from .virtual_network_gateway import VirtualNetworkGateway + from .vpn_client_parameters import VpnClientParameters + from .bgp_peer_status_list_result import BgpPeerStatusListResult + from .gateway_route_list_result import GatewayRouteListResult + from .tunnel_connection_health import TunnelConnectionHealth + from .local_network_gateway import LocalNetworkGateway + from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection + from .connection_reset_shared_key import ConnectionResetSharedKey + from .connection_shared_key import ConnectionSharedKey from .network_interface_paged import NetworkInterfacePaged from .application_gateway_paged import ApplicationGatewayPaged from .express_route_circuit_authorization_paged import ExpressRouteCircuitAuthorizationPaged diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/address_space.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/address_space.py index d7050c78a457..fbf42c9e0ade 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/address_space.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/address_space.py @@ -25,6 +25,6 @@ class AddressSpace(Model): 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, } - def __init__(self, address_prefixes=None): - super(AddressSpace, self).__init__() - self.address_prefixes = address_prefixes + def __init__(self, **kwargs): + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = kwargs.get('address_prefixes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/address_space_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/address_space_py3.py new file mode 100644 index 000000000000..9794cc805efa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/address_space_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AddressSpace(Model): + """AddressSpace contains an array of IP address ranges that can be used by + subnets of the virtual network. + + :param address_prefixes: A list of address blocks reserved for this + virtual network in CIDR notation. + :type address_prefixes: list[str] + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__(self, *, address_prefixes=None, **kwargs) -> None: + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = address_prefixes diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway.py index c17f6df6c31b..a0c663a64273 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway.py @@ -126,23 +126,23 @@ class ApplicationGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, web_application_firewall_configuration=None, resource_guid=None, provisioning_state=None, etag=None): - super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.ssl_policy = ssl_policy + def __init__(self, **kwargs): + super(ApplicationGateway, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.ssl_policy = kwargs.get('ssl_policy', None) self.operational_state = None - self.gateway_ip_configurations = gateway_ip_configurations - self.authentication_certificates = authentication_certificates - self.ssl_certificates = ssl_certificates - self.frontend_ip_configurations = frontend_ip_configurations - self.frontend_ports = frontend_ports - self.probes = probes - self.backend_address_pools = backend_address_pools - self.backend_http_settings_collection = backend_http_settings_collection - self.http_listeners = http_listeners - self.url_path_maps = url_path_maps - self.request_routing_rules = request_routing_rules - self.web_application_firewall_configuration = web_application_firewall_configuration - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.gateway_ip_configurations = kwargs.get('gateway_ip_configurations', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.ssl_certificates = kwargs.get('ssl_certificates', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.frontend_ports = kwargs.get('frontend_ports', None) + self.probes = kwargs.get('probes', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) + self.http_listeners = kwargs.get('http_listeners', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.web_application_firewall_configuration = kwargs.get('web_application_firewall_configuration', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_authentication_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_authentication_certificate.py index a492a39ca080..c7fb4d9a7226 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_authentication_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_authentication_certificate.py @@ -39,9 +39,9 @@ class ApplicationGatewayAuthenticationCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, data=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id) - self.data = data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayAuthenticationCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_authentication_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_authentication_certificate_py3.py new file mode 100644 index 000000000000..2ab1073a0e7d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_authentication_certificate_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayAuthenticationCertificate(SubResource): + """Authentication certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Certificate public data. + :type data: str + :param provisioning_state: Provisioning state of the authentication + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address.py index 6005027d0845..e7a61fe1705c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address.py @@ -26,7 +26,7 @@ class ApplicationGatewayBackendAddress(Model): 'ip_address': {'key': 'ipAddress', 'type': 'str'}, } - def __init__(self, fqdn=None, ip_address=None): - super(ApplicationGatewayBackendAddress, self).__init__() - self.fqdn = fqdn - self.ip_address = ip_address + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = kwargs.get('fqdn', None) + self.ip_address = kwargs.get('ip_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address_pool.py index 1d354ae2b1f5..d2da9af17e5f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address_pool.py @@ -44,10 +44,10 @@ class ApplicationGatewayBackendAddressPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayBackendAddressPool, self).__init__(id=id) - self.backend_ip_configurations = backend_ip_configurations - self.backend_addresses = backend_addresses - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddressPool, self).__init__(**kwargs) + self.backend_ip_configurations = kwargs.get('backend_ip_configurations', None) + self.backend_addresses = kwargs.get('backend_addresses', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address_pool_py3.py new file mode 100644 index 000000000000..b7660d4c49e5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address_pool_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + :param id: Resource ID. + :type id: str + :param backend_ip_configurations: Collection of references to IPs defined + in network interfaces. + :type backend_ip_configurations: + list[~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses + :type backend_addresses: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendAddress] + :param provisioning_state: Provisioning state of the backend address pool + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Resource that is unique within a resource group. This name + can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = backend_ip_configurations + self.backend_addresses = backend_addresses + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address_py3.py new file mode 100644 index 000000000000..d18e476244d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_address_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendAddress(Model): + """Backend address of an application gateway. + + :param fqdn: Fully qualified domain name (FQDN). + :type fqdn: str + :param ip_address: IP address + :type ip_address: str + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__(self, *, fqdn: str=None, ip_address: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = fqdn + self.ip_address = ip_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health.py index 11ff30c542ff..0adaeca727f7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health.py @@ -24,6 +24,6 @@ class ApplicationGatewayBackendHealth(Model): 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, } - def __init__(self, backend_address_pools=None): - super(ApplicationGatewayBackendHealth, self).__init__() - self.backend_address_pools = backend_address_pools + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = kwargs.get('backend_address_pools', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_http_settings.py index b2aefd53b524..e1b813674312 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_http_settings.py @@ -29,7 +29,7 @@ class ApplicationGatewayBackendHealthHttpSettings(Model): 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, } - def __init__(self, backend_http_settings=None, servers=None): - super(ApplicationGatewayBackendHealthHttpSettings, self).__init__() - self.backend_http_settings = backend_http_settings - self.servers = servers + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.servers = kwargs.get('servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_http_settings_py3.py new file mode 100644 index 000000000000..4fad286c5cd5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_http_settings_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthHttpSettings(Model): + """Application gateway BackendHealthHttp settings. + + :param backend_http_settings: Reference of an + ApplicationGatewayBackendHttpSettings resource. + :type backend_http_settings: + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendHealthServer] + """ + + _attribute_map = { + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, + 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, + } + + def __init__(self, *, backend_http_settings=None, servers=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = backend_http_settings + self.servers = servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_pool.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_pool.py index a67e363cfd24..a6dd3a24edff 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_pool.py @@ -30,7 +30,7 @@ class ApplicationGatewayBackendHealthPool(Model): 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, } - def __init__(self, backend_address_pool=None, backend_http_settings_collection=None): - super(ApplicationGatewayBackendHealthPool, self).__init__() - self.backend_address_pool = backend_address_pool - self.backend_http_settings_collection = backend_http_settings_collection + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_pool_py3.py new file mode 100644 index 000000000000..8d0246bb7066 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_pool_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthPool(Model): + """Application gateway BackendHealth pool. + + :param backend_address_pool: Reference of an + ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of + ApplicationGatewayBackendHealthHttpSettings resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, + } + + def __init__(self, *, backend_address_pool=None, backend_http_settings_collection=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_http_settings_collection = backend_http_settings_collection diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_py3.py new file mode 100644 index 000000000000..9d8b6de82c2d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealth(Model): + """List of ApplicationGatewayBackendHealthPool resources. + + :param backend_address_pools: + :type backend_address_pools: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendHealthPool] + """ + + _attribute_map = { + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, + } + + def __init__(self, *, backend_address_pools=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = backend_address_pools diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_server.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_server.py index 0d05be701cc0..94f4dee82abe 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_server.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_server.py @@ -32,8 +32,8 @@ class ApplicationGatewayBackendHealthServer(Model): 'health': {'key': 'health', 'type': 'str'}, } - def __init__(self, address=None, ip_configuration=None, health=None): - super(ApplicationGatewayBackendHealthServer, self).__init__() - self.address = address - self.ip_configuration = ip_configuration - self.health = health + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + self.ip_configuration = kwargs.get('ip_configuration', None) + self.health = kwargs.get('health', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_server_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_server_py3.py new file mode 100644 index 000000000000..bf50a379b0c8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_server_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthServer(Model): + """Application gateway backendhealth http settings. + + :param address: IP address or FQDN of backend server. + :type address: str + :param ip_configuration: Reference of IP configuration of backend server. + :type ip_configuration: ~azure.mgmt.network.v2016_09_01.models.SubResource + :param health: Health of backend server. Possible values are: 'Unknown', + 'Up', 'Down', and 'Partial'. Possible values include: 'Unknown', 'Up', + 'Down', 'Partial' + :type health: str or + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendHealthServerHealth + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': 'SubResource'}, + 'health': {'key': 'health', 'type': 'str'}, + } + + def __init__(self, *, address: str=None, ip_configuration=None, health=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = address + self.ip_configuration = ip_configuration + self.health = health diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_http_settings.py index e192a9ba352d..3b5fa0e7ba41 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_http_settings.py @@ -61,14 +61,14 @@ class ApplicationGatewayBackendHttpSettings(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, port=None, protocol=None, cookie_based_affinity=None, request_timeout=None, probe=None, authentication_certificates=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id) - self.port = port - self.protocol = protocol - self.cookie_based_affinity = cookie_based_affinity - self.request_timeout = request_timeout - self.probe = probe - self.authentication_certificates = authentication_certificates - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHttpSettings, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.protocol = kwargs.get('protocol', None) + self.cookie_based_affinity = kwargs.get('cookie_based_affinity', None) + self.request_timeout = kwargs.get('request_timeout', None) + self.probe = kwargs.get('probe', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_http_settings_py3.py new file mode 100644 index 000000000000..be5a8f1d0150 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_backend_http_settings_py3.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendHttpSettings(SubResource): + """Backend address pool settings of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Port + :type port: int + :param protocol: Protocol. Possible values are: 'Http' and 'Https'. + Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayProtocol + :param cookie_based_affinity: Cookie based affinity. Possible values are: + 'Enabled' and 'Disabled'. Possible values include: 'Enabled', 'Disabled' + :type cookie_based_affinity: str or + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayCookieBasedAffinity + :param request_timeout: Request timeout in seconds. Application Gateway + will fail the request if response is not received within RequestTimeout. + Acceptable values are from 1 second to 86400 seconds. + :type request_timeout: int + :param probe: Probe resource of an application gateway. + :type probe: ~azure.mgmt.network.v2016_09_01.models.SubResource + :param authentication_certificates: Array of references to application + gateway authentication certificates. + :type authentication_certificates: + list[~azure.mgmt.network.v2016_09_01.models.SubResource] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, + 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, protocol=None, cookie_based_affinity=None, request_timeout: int=None, probe=None, authentication_certificates=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id, **kwargs) + self.port = port + self.protocol = protocol + self.cookie_based_affinity = cookie_based_affinity + self.request_timeout = request_timeout + self.probe = probe + self.authentication_certificates = authentication_certificates + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_ip_configuration.py index 16a95dd8190e..20d64d92f0b2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_ip_configuration.py @@ -52,12 +52,12 @@ class ApplicationGatewayFrontendIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..2d325c51f523 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_ip_configuration_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): + """Frontend IP configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param private_ip_address: PrivateIPAddress of the network interface IP + Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: PrivateIP allocation method. Possible + values are: 'Static' and 'Dynamic'. Possible values include: 'Static', + 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2016_09_01.models.IPAllocationMethod + :param subnet: Reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2016_09_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param provisioning_state: Provisioning state of the public IP resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_port.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_port.py index 1555284f9949..a8c5b703f4e6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_port.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_port.py @@ -38,9 +38,9 @@ class ApplicationGatewayFrontendPort(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, port=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayFrontendPort, self).__init__(id=id) - self.port = port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendPort, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_port_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_port_py3.py new file mode 100644 index 000000000000..557923221748 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_frontend_port_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Frontend port + :type port: int + :param provisioning_state: Provisioning state of the frontend port + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendPort, self).__init__(id=id, **kwargs) + self.port = port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_http_listener.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_http_listener.py index aafe575aa6cd..b2fc8f723348 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_http_listener.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_http_listener.py @@ -59,14 +59,14 @@ class ApplicationGatewayHttpListener(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name=None, ssl_certificate=None, require_server_name_indication=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayHttpListener, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.frontend_port = frontend_port - self.protocol = protocol - self.host_name = host_name - self.ssl_certificate = ssl_certificate - self.require_server_name_indication = require_server_name_indication - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayHttpListener, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.protocol = kwargs.get('protocol', None) + self.host_name = kwargs.get('host_name', None) + self.ssl_certificate = kwargs.get('ssl_certificate', None) + self.require_server_name_indication = kwargs.get('require_server_name_indication', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_http_listener_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_http_listener_py3.py new file mode 100644 index 000000000000..7b2839c7ba25 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_http_listener_py3.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayHttpListener(SubResource): + """Http listener of an application gateway. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: Frontend IP configuration resource of an + application gateway. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2016_09_01.models.SubResource + :param protocol: Protocol. Possible values are: 'Http' and 'Https'. + Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayProtocol + :param host_name: Host name of HTTP listener. + :type host_name: str + :param ssl_certificate: SSL certificate resource of an application + gateway. + :type ssl_certificate: ~azure.mgmt.network.v2016_09_01.models.SubResource + :param require_server_name_indication: Applicable only if protocol is + https. Enables SNI for multi-hosting. + :type require_server_name_indication: bool + :param provisioning_state: Provisioning state of the HTTP listener + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, + 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name: str=None, ssl_certificate=None, require_server_name_indication: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayHttpListener, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.frontend_port = frontend_port + self.protocol = protocol + self.host_name = host_name + self.ssl_certificate = ssl_certificate + self.require_server_name_indication = require_server_name_indication + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ip_configuration.py index 0cd81a357973..afa3f6ca668a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ip_configuration.py @@ -41,9 +41,9 @@ class ApplicationGatewayIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, subnet=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayIPConfiguration, self).__init__(id=id) - self.subnet = subnet - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayIPConfiguration, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..8c805a9a6762 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ip_configuration_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 + private IP configuration is allowed. + + :param id: Resource ID. + :type id: str + :param subnet: Reference of the subnet resource. A subnet from where + application gateway gets its private address. + :type subnet: ~azure.mgmt.network.v2016_09_01.models.SubResource + :param provisioning_state: Provisioning state of the application gateway + subnet resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, subnet=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.subnet = subnet + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_path_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_path_rule.py index 8806f7d27b59..7746abf89abc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_path_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_path_rule.py @@ -48,11 +48,11 @@ class ApplicationGatewayPathRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, paths=None, backend_address_pool=None, backend_http_settings=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayPathRule, self).__init__(id=id) - self.paths = paths - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayPathRule, self).__init__(**kwargs) + self.paths = kwargs.get('paths', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_path_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_path_rule_py3.py new file mode 100644 index 000000000000..ea26ce29c2c6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_path_rule_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayPathRule(SubResource): + """Path rule of URL path map of an application gateway. + + :param id: Resource ID. + :type id: str + :param paths: Path rules of URL path map. + :type paths: list[str] + :param backend_address_pool: Backend address pool resource of URL path + map. + :type backend_address_pool: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param backend_http_settings: Backend http settings resource of URL path + map. + :type backend_http_settings: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param provisioning_state: Path rule of URL path map resource. Possible + values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'paths': {'key': 'properties.paths', 'type': '[str]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, paths=None, backend_address_pool=None, backend_http_settings=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayPathRule, self).__init__(id=id, **kwargs) + self.paths = paths + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_probe.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_probe.py index 5568067a765b..910b6cc39f07 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_probe.py @@ -62,14 +62,14 @@ class ApplicationGatewayProbe(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, protocol=None, host=None, path=None, interval=None, timeout=None, unhealthy_threshold=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayProbe, self).__init__(id=id) - self.protocol = protocol - self.host = host - self.path = path - self.interval = interval - self.timeout = timeout - self.unhealthy_threshold = unhealthy_threshold - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayProbe, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.host = kwargs.get('host', None) + self.path = kwargs.get('path', None) + self.interval = kwargs.get('interval', None) + self.timeout = kwargs.get('timeout', None) + self.unhealthy_threshold = kwargs.get('unhealthy_threshold', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_probe_py3.py new file mode 100644 index 000000000000..f7ce23fbee9b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_probe_py3.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayProbe(SubResource): + """Probe of the application gateway. + + :param id: Resource ID. + :type id: str + :param protocol: Protocol. Possible values are: 'Http' and 'Https'. + Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is + sent to ://: + :type path: str + :param interval: The probing interval in seconds. This is the time + interval between two consecutive probes. Acceptable values are from 1 + second to 86400 seconds. + :type interval: int + :param timeout: the probe timeout in seconds. Probe marked as failed if + valid response is not received with this timeout period. Acceptable values + are from 1 second to 86400 seconds. + :type timeout: int + :param unhealthy_threshold: The probe retry count. Backend server is + marked down after consecutive probe failure count reaches + UnhealthyThreshold. Acceptable values are from 1 second to 20. + :type unhealthy_threshold: int + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host': {'key': 'properties.host', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, protocol=None, host: str=None, path: str=None, interval: int=None, timeout: int=None, unhealthy_threshold: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayProbe, self).__init__(id=id, **kwargs) + self.protocol = protocol + self.host = host + self.path = path + self.interval = interval + self.timeout = timeout + self.unhealthy_threshold = unhealthy_threshold + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_py3.py new file mode 100644 index 000000000000..a188545b648d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_py3.py @@ -0,0 +1,148 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGateway(Resource): + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewaySslPolicy + :ivar operational_state: Operational state of the application gateway + resource. Possible values are: 'Stopped', 'Started', 'Running', and + 'Stopping'. Possible values include: 'Stopped', 'Starting', 'Running', + 'Stopping' + :vartype operational_state: str or + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayOperationalState + :param gateway_ip_configurations: Subnets of application the gateway + resource. + :type gateway_ip_configurations: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayIPConfiguration] + :param authentication_certificates: Authentication certificates of the + application gateway resource. + :type authentication_certificates: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayAuthenticationCertificate] + :param ssl_certificates: SSL certificates of the application gateway + resource. + :type ssl_certificates: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewaySslCertificate] + :param frontend_ip_configurations: Frontend IP addresses of the + application gateway resource. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayFrontendIPConfiguration] + :param frontend_ports: Frontend ports of the application gateway resource. + :type frontend_ports: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayProbe] + :param backend_address_pools: Backend address pool of the application + gateway resource. + :type backend_address_pools: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendAddressPool] + :param backend_http_settings_collection: Backend http settings of the + application gateway resource. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendHttpSettings] + :param http_listeners: Http listeners of the application gateway resource. + :type http_listeners: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayHttpListener] + :param url_path_maps: URL path map of the application gateway resource. + :type url_path_maps: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application + gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayRequestRoutingRule] + :param web_application_firewall_configuration: Web application firewall + configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param resource_guid: Resource GUID property of the application gateway + resource. + :type resource_guid: str + :param provisioning_state: Provisioning state of the application gateway + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operational_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, + 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, + 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, + 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, + 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, + 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, web_application_firewall_configuration=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.ssl_policy = ssl_policy + self.operational_state = None + self.gateway_ip_configurations = gateway_ip_configurations + self.authentication_certificates = authentication_certificates + self.ssl_certificates = ssl_certificates + self.frontend_ip_configurations = frontend_ip_configurations + self.frontend_ports = frontend_ports + self.probes = probes + self.backend_address_pools = backend_address_pools + self.backend_http_settings_collection = backend_http_settings_collection + self.http_listeners = http_listeners + self.url_path_maps = url_path_maps + self.request_routing_rules = request_routing_rules + self.web_application_firewall_configuration = web_application_firewall_configuration + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_request_routing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_request_routing_rule.py index 8d5561ba9948..02397886b7d5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_request_routing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_request_routing_rule.py @@ -56,13 +56,13 @@ class ApplicationGatewayRequestRoutingRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id) - self.rule_type = rule_type - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.http_listener = http_listener - self.url_path_map = url_path_map - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayRequestRoutingRule, self).__init__(**kwargs) + self.rule_type = kwargs.get('rule_type', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.http_listener = kwargs.get('http_listener', None) + self.url_path_map = kwargs.get('url_path_map', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_request_routing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_request_routing_rule_py3.py new file mode 100644 index 000000000000..cdb91392a176 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_request_routing_rule_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRequestRoutingRule(SubResource): + """Request routing rule of an application gateway. + + :param id: Resource ID. + :type id: str + :param rule_type: Rule type. Possible values are: 'Basic' and + 'PathBasedRouting'. Possible values include: 'Basic', 'PathBasedRouting' + :type rule_type: str or + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayRequestRoutingRuleType + :param backend_address_pool: Backend address pool resource of the + application gateway. + :type backend_address_pool: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param backend_http_settings: Frontend port resource of the application + gateway. + :type backend_http_settings: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2016_09_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2016_09_01.models.SubResource + :param provisioning_state: Provisioning state of the request routing rule + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, + 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id, **kwargs) + self.rule_type = rule_type + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.http_listener = http_listener + self.url_path_map = url_path_map + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_sku.py index 44432d212f9b..9ca024fe602e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_sku.py @@ -35,8 +35,8 @@ class ApplicationGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(ApplicationGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_sku_py3.py new file mode 100644 index 000000000000..dce182e58341 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_sku_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySku(Model): + """SKU of an application gateway. + + :param name: Name of an application gateway SKU. Possible values are: + 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', and + 'WAF_Large'. Possible values include: 'Standard_Small', 'Standard_Medium', + 'Standard_Large', 'WAF_Medium', 'WAF_Large' + :type name: str or + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewaySkuName + :param tier: Tier of an application gateway. Possible values are: + 'Standard' and 'WAF'. Possible values include: 'Standard', 'WAF' + :type tier: str or + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayTier + :param capacity: Capacity (instance count) of an application gateway. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_certificate.py index b29e94104a25..b3538fc5d66b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_certificate.py @@ -47,11 +47,11 @@ class ApplicationGatewaySslCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, data=None, password=None, public_cert_data=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewaySslCertificate, self).__init__(id=id) - self.data = data - self.password = password - self.public_cert_data = public_cert_data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewaySslCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.password = kwargs.get('password', None) + self.public_cert_data = kwargs.get('public_cert_data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_certificate_py3.py new file mode 100644 index 000000000000..f00c4fb2302e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_certificate_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Base-64 encoded pfx certificate. Only applicable in PUT + Request. + :type data: str + :param password: Password for the pfx file specified in data. Only + applicable in PUT request. + :type password: str + :param public_cert_data: Base-64 encoded Public cert data corresponding to + pfx specified in data. Only applicable in GET request. + :type public_cert_data: str + :param provisioning_state: Provisioning state of the SSL certificate + resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, password: str=None, public_cert_data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewaySslCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.password = password + self.public_cert_data = public_cert_data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_policy.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_policy.py index a6c5b53cf2f8..eb44d28bf9ec 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_policy.py @@ -25,6 +25,6 @@ class ApplicationGatewaySslPolicy(Model): 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, } - def __init__(self, disabled_ssl_protocols=None): - super(ApplicationGatewaySslPolicy, self).__init__() - self.disabled_ssl_protocols = disabled_ssl_protocols + def __init__(self, **kwargs): + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = kwargs.get('disabled_ssl_protocols', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_policy_py3.py new file mode 100644 index 000000000000..95785cea358d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_ssl_policy_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySslPolicy(Model): + """Application gateway SSL policy. + + :param disabled_ssl_protocols: SSL protocols to be disabled on application + gateway. Possible values are: 'TLSv1_0', 'TLSv1_1', and 'TLSv1_2'. + :type disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewaySslProtocol] + """ + + _attribute_map = { + 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, + } + + def __init__(self, *, disabled_ssl_protocols=None, **kwargs) -> None: + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = disabled_ssl_protocols diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_url_path_map.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_url_path_map.py index 67017e2ef3ee..5dd9d14507c5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_url_path_map.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_url_path_map.py @@ -50,11 +50,11 @@ class ApplicationGatewayUrlPathMap(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, default_backend_address_pool=None, default_backend_http_settings=None, path_rules=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayUrlPathMap, self).__init__(id=id) - self.default_backend_address_pool = default_backend_address_pool - self.default_backend_http_settings = default_backend_http_settings - self.path_rules = path_rules - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayUrlPathMap, self).__init__(**kwargs) + self.default_backend_address_pool = kwargs.get('default_backend_address_pool', None) + self.default_backend_http_settings = kwargs.get('default_backend_http_settings', None) + self.path_rules = kwargs.get('path_rules', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_url_path_map_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_url_path_map_py3.py new file mode 100644 index 000000000000..3e968c130127 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_url_path_map_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayUrlPathMap(SubResource): + """UrlPathMaps give a url path to the backend mapping information for + PathBasedRouting. + + :param id: Resource ID. + :type id: str + :param default_backend_address_pool: Default backend address pool resource + of URL path map. + :type default_backend_address_pool: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param default_backend_http_settings: Default backend http settings + resource of URL path map. + :type default_backend_http_settings: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayPathRule] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, + 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, default_backend_address_pool=None, default_backend_http_settings=None, path_rules=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayUrlPathMap, self).__init__(id=id, **kwargs) + self.default_backend_address_pool = default_backend_address_pool + self.default_backend_http_settings = default_backend_http_settings + self.path_rules = path_rules + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_web_application_firewall_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_web_application_firewall_configuration.py index 161921a261ed..6053670f74d5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_web_application_firewall_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_web_application_firewall_configuration.py @@ -15,7 +15,9 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): """Application gateway web application firewall configuration. - :param enabled: Whether the web application firewall is enabled. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled. :type enabled: bool :param firewall_mode: Web application firewall mode. Possible values are: 'Detection' and 'Prevention'. Possible values include: 'Detection', @@ -33,7 +35,7 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, } - def __init__(self, enabled, firewall_mode=None): - super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__() - self.enabled = enabled - self.firewall_mode = firewall_mode + def __init__(self, **kwargs): + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.firewall_mode = kwargs.get('firewall_mode', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_web_application_firewall_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_web_application_firewall_configuration_py3.py new file mode 100644 index 000000000000..441063250b49 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/application_gateway_web_application_firewall_configuration_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayWebApplicationFirewallConfiguration(Model): + """Application gateway web application firewall configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled. + :type enabled: bool + :param firewall_mode: Web application firewall mode. Possible values are: + 'Detection' and 'Prevention'. Possible values include: 'Detection', + 'Prevention' + :type firewall_mode: str or + ~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayFirewallMode + """ + + _validation = { + 'enabled': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool, firewall_mode=None, **kwargs) -> None: + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = enabled + self.firewall_mode = firewall_mode diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/azure_async_operation_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/azure_async_operation_result.py index 402e6601bb80..804b3119e9d9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/azure_async_operation_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/azure_async_operation_result.py @@ -36,7 +36,7 @@ class AzureAsyncOperationResult(Model): 'error': {'key': 'error', 'type': 'Error'}, } - def __init__(self, status=None, error=None): - super(AzureAsyncOperationResult, self).__init__() - self.status = status - self.error = error + def __init__(self, **kwargs): + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/azure_async_operation_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/azure_async_operation_result_py3.py new file mode 100644 index 000000000000..9a45c60160aa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/azure_async_operation_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureAsyncOperationResult(Model): + """The response body contains the status of the specified asynchronous + operation, indicating whether it has succeeded, is in progress, or has + failed. Note that this status is distinct from the HTTP status code + returned for the Get Operation Status operation itself. If the asynchronous + operation succeeded, the response body includes the HTTP status code for + the successful request. If the asynchronous operation failed, the response + body includes the HTTP status code for the failed request and error + information regarding the failure. + + :param status: Status of the Azure async operation. Possible values are: + 'InProgress', 'Succeeded', and 'Failed'. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or + ~azure.mgmt.network.v2016_09_01.models.NetworkOperationStatus + :param error: + :type error: ~azure.mgmt.network.v2016_09_01.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, status=None, error=None, **kwargs) -> None: + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/backend_address_pool.py index c84c5840f76a..0d8db44a6091 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/backend_address_pool.py @@ -59,11 +59,11 @@ class BackendAddressPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, provisioning_state=None, name=None, etag=None): - super(BackendAddressPool, self).__init__(id=id) + def __init__(self, **kwargs): + super(BackendAddressPool, self).__init__(**kwargs) self.backend_ip_configurations = None self.load_balancing_rules = None self.outbound_nat_rule = None - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/backend_address_pool_py3.py new file mode 100644 index 000000000000..e3fe98f8bd37 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/backend_address_pool_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class BackendAddressPool(SubResource): + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar backend_ip_configurations: Gets collection of references to IP + addresses defined in network interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: Gets load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2016_09_01.models.SubResource] + :ivar outbound_nat_rule: Gets outbound rules that use this backend address + pool. + :vartype outbound_nat_rule: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param provisioning_state: Get provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configurations': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'outbound_nat_rule': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'outbound_nat_rule': {'key': 'properties.outboundNatRule', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(BackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = None + self.load_balancing_rules = None + self.outbound_nat_rule = None + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status.py index 28cc331b36a5..34bf4aaa0e8c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status.py @@ -59,8 +59,8 @@ class BgpPeerStatus(Model): 'messages_received': {'key': 'messagesReceived', 'type': 'int'}, } - def __init__(self): - super(BgpPeerStatus, self).__init__() + def __init__(self, **kwargs): + super(BgpPeerStatus, self).__init__(**kwargs) self.local_address = None self.neighbor = None self.asn = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status_list_result.py index 7dfc50c1c14a..166d3fd039cf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status_list_result.py @@ -23,6 +23,6 @@ class BgpPeerStatusListResult(Model): 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, } - def __init__(self, value=None): - super(BgpPeerStatusListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status_list_result_py3.py new file mode 100644 index 000000000000..514c37d9ebaa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatusListResult(Model): + """Response for list BGP peer status API service call. + + :param value: List of BGP peers + :type value: list[~azure.mgmt.network.v2016_09_01.models.BgpPeerStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status_py3.py new file mode 100644 index 000000000000..201b52bb1259 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_peer_status_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatus(Model): + """BgpPeerStatus. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The virtual network gateway's local address + :vartype local_address: str + :ivar neighbor: The remote BGP peer + :vartype neighbor: str + :ivar asn: The autonomous system number of the remote BGP peer + :vartype asn: int + :ivar state: The BGP peer state. Possible values include: 'Unknown', + 'Stopped', 'Idle', 'Connecting', 'Connected' + :vartype state: str or ~azure.mgmt.network.v2016_09_01.models.BgpPeerState + :ivar connected_duration: For how long the peering has been up + :vartype connected_duration: str + :ivar routes_received: The number of routes learned from this peer + :vartype routes_received: long + :ivar messages_sent: The number of BGP messages sent + :vartype messages_sent: long + :ivar messages_received: The number of BGP messages received + :vartype messages_received: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'neighbor': {'readonly': True}, + 'asn': {'readonly': True}, + 'state': {'readonly': True}, + 'connected_duration': {'readonly': True}, + 'routes_received': {'readonly': True}, + 'messages_sent': {'readonly': True}, + 'messages_received': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'str'}, + 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, + 'routes_received': {'key': 'routesReceived', 'type': 'long'}, + 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, + 'messages_received': {'key': 'messagesReceived', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(BgpPeerStatus, self).__init__(**kwargs) + self.local_address = None + self.neighbor = None + self.asn = None + self.state = None + self.connected_duration = None + self.routes_received = None + self.messages_sent = None + self.messages_received = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_settings.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_settings.py index cd3f5e596a04..4560c0e4cfa4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_settings.py @@ -31,8 +31,8 @@ class BgpSettings(Model): 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, } - def __init__(self, asn=None, bgp_peering_address=None, peer_weight=None): - super(BgpSettings, self).__init__() - self.asn = asn - self.bgp_peering_address = bgp_peering_address - self.peer_weight = peer_weight + def __init__(self, **kwargs): + super(BgpSettings, self).__init__(**kwargs) + self.asn = kwargs.get('asn', None) + self.bgp_peering_address = kwargs.get('bgp_peering_address', None) + self.peer_weight = kwargs.get('peer_weight', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_settings_py3.py new file mode 100644 index 000000000000..1ac51b2b24a3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/bgp_settings_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpSettings(Model): + """BgpSettings. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of + this BGP speaker. + :type bgp_peering_address: str + :param peer_weight: The weight added to routes learned from this BGP + speaker. + :type peer_weight: int + """ + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, + } + + def __init__(self, *, asn: int=None, bgp_peering_address: str=None, peer_weight: int=None, **kwargs) -> None: + super(BgpSettings, self).__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + self.peer_weight = peer_weight diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_reset_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_reset_shared_key.py index c68ade7d79f5..47e448e2ffe7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_reset_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_reset_shared_key.py @@ -15,8 +15,10 @@ class ConnectionResetSharedKey(Model): """ConnectionResetSharedKey. - :param key_length: The virtual network connection reset shared key length, - should between 1 and 128. + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. :type key_length: int """ @@ -28,6 +30,6 @@ class ConnectionResetSharedKey(Model): 'key_length': {'key': 'keyLength', 'type': 'int'}, } - def __init__(self, key_length): - super(ConnectionResetSharedKey, self).__init__() - self.key_length = key_length + def __init__(self, **kwargs): + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = kwargs.get('key_length', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_reset_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_reset_shared_key_py3.py new file mode 100644 index 000000000000..b9d127d6fc61 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_reset_shared_key_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionResetSharedKey(Model): + """ConnectionResetSharedKey. + + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. + :type key_length: int + """ + + _validation = { + 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, + } + + _attribute_map = { + 'key_length': {'key': 'keyLength', 'type': 'int'}, + } + + def __init__(self, *, key_length: int, **kwargs) -> None: + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = key_length diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_shared_key.py index 2c1b0ed9a914..742f1cb15126 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_shared_key.py @@ -15,7 +15,9 @@ class ConnectionSharedKey(Model): """Response for GetConnectionSharedKey API service call. - :param value: The virtual network connection shared key value. + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. :type value: str """ @@ -27,6 +29,6 @@ class ConnectionSharedKey(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, value): - super(ConnectionSharedKey, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_shared_key_py3.py new file mode 100644 index 000000000000..11b88da35e17 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/connection_shared_key_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionSharedKey(Model): + """Response for GetConnectionSharedKey API service call. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, **kwargs) -> None: + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dhcp_options.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dhcp_options.py index 8744ba6fc9b1..93b68a7f037c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dhcp_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dhcp_options.py @@ -25,6 +25,6 @@ class DhcpOptions(Model): 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, } - def __init__(self, dns_servers=None): - super(DhcpOptions, self).__init__() - self.dns_servers = dns_servers + def __init__(self, **kwargs): + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dhcp_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dhcp_options_py3.py new file mode 100644 index 000000000000..7dc4651973a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dhcp_options_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DhcpOptions(Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in + the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + options. + + :param dns_servers: The list of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = dns_servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dns_name_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dns_name_availability_result.py index 15a0238e49a7..86ba19eb407b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dns_name_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dns_name_availability_result.py @@ -23,6 +23,6 @@ class DnsNameAvailabilityResult(Model): 'available': {'key': 'available', 'type': 'bool'}, } - def __init__(self, available=None): - super(DnsNameAvailabilityResult, self).__init__() - self.available = available + def __init__(self, **kwargs): + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dns_name_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dns_name_availability_result_py3.py new file mode 100644 index 000000000000..de0117c27715 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/dns_name_availability_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DnsNameAvailabilityResult(Model): + """Response for the CheckDnsNameAvailability API service call. + + :param available: Domain availability (True/False). + :type available: bool + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + } + + def __init__(self, *, available: bool=None, **kwargs) -> None: + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = available diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group.py index 9d6540b4c12d..8ebb52f34f19 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group.py @@ -33,8 +33,8 @@ class EffectiveNetworkSecurityGroup(Model): 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, } - def __init__(self, network_security_group=None, association=None, effective_security_rules=None): - super(EffectiveNetworkSecurityGroup, self).__init__() - self.network_security_group = network_security_group - self.association = association - self.effective_security_rules = effective_security_rules + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = kwargs.get('network_security_group', None) + self.association = kwargs.get('association', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_association.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_association.py index 69749f112977..9d6f0471bf63 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_association.py @@ -27,7 +27,7 @@ class EffectiveNetworkSecurityGroupAssociation(Model): 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, } - def __init__(self, subnet=None, network_interface=None): - super(EffectiveNetworkSecurityGroupAssociation, self).__init__() - self.subnet = subnet - self.network_interface = network_interface + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.network_interface = kwargs.get('network_interface', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_association_py3.py new file mode 100644 index 000000000000..b0629001f7aa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_association_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupAssociation(Model): + """The effective network security group association. + + :param subnet: The ID of the subnet if assigned. + :type subnet: ~azure.mgmt.network.v2016_09_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: + ~azure.mgmt.network.v2016_09_01.models.SubResource + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, + } + + def __init__(self, *, subnet=None, network_interface=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = subnet + self.network_interface = network_interface diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_list_result.py index 0876384ae787..c68fb3686b29 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_list_result.py @@ -27,7 +27,7 @@ class EffectiveNetworkSecurityGroupListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(EffectiveNetworkSecurityGroupListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_list_result_py3.py new file mode 100644 index 000000000000..8a56d1e63992 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_list_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupListResult(Model): + """Response for list effective network security groups API service call. + + :param value: A list of effective network security groups. + :type value: + list[~azure.mgmt.network.v2016_09_01.models.EffectiveNetworkSecurityGroup] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_py3.py new file mode 100644 index 000000000000..cdef654c8e1b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_group_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroup(Model): + """Effective network security group. + + :param network_security_group: The ID of network security group that is + applied. + :type network_security_group: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param association: + :type association: + ~azure.mgmt.network.v2016_09_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2016_09_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, + 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__(self, *, network_security_group=None, association=None, effective_security_rules=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = network_security_group + self.association = association + self.effective_security_rules = effective_security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_rule.py index e4e87252b6ac..58d6dc154b72 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_rule.py @@ -62,16 +62,16 @@ class EffectiveNetworkSecurityRule(Model): 'direction': {'key': 'direction', 'type': 'str'}, } - def __init__(self, name=None, protocol=None, source_port_range=None, destination_port_range=None, source_address_prefix=None, destination_address_prefix=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority=None, direction=None): - super(EffectiveNetworkSecurityRule, self).__init__() - self.name = name - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_address_prefix = source_address_prefix - self.destination_address_prefix = destination_address_prefix - self.expanded_source_address_prefix = expanded_source_address_prefix - self.expanded_destination_address_prefix = expanded_destination_address_prefix - self.access = access - self.priority = priority - self.direction = direction + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.expanded_source_address_prefix = kwargs.get('expanded_source_address_prefix', None) + self.expanded_destination_address_prefix = kwargs.get('expanded_destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_rule_py3.py new file mode 100644 index 000000000000..6b55b17368c4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_network_security_rule_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityRule(Model): + """Effective network security rules. + + :param name: The name of the security rule specified by the user (if + created by the user). + :type name: str + :param protocol: The network protocol this rule applies to. Possible + values are: 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2016_09_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. + :type source_port_range: str + :param destination_port_range: The destination port or range. + :type destination_port_range: str + :param source_address_prefix: The source address prefix. + :type source_address_prefix: str + :param destination_address_prefix: The destination address prefix. + :type destination_address_prefix: str + :param expanded_source_address_prefix: The expanded source address prefix. + :type expanded_source_address_prefix: list[str] + :param expanded_destination_address_prefix: Expanded destination address + prefix. + :type expanded_destination_address_prefix: list[str] + :param access: Whether network traffic is allowed or denied. Possible + values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or + ~azure.mgmt.network.v2016_09_01.models.SecurityRuleAccess + :param priority: The priority of the rule. + :type priority: int + :param direction: The direction of the rule. Possible values are: 'Inbound + and Outbound'. Possible values include: 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2016_09_01.models.SecurityRuleDirection + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, + 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, + 'access': {'key': 'access', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, protocol=None, source_port_range: str=None, destination_port_range: str=None, source_address_prefix: str=None, destination_address_prefix: str=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority: int=None, direction=None, **kwargs) -> None: + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = name + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.expanded_source_address_prefix = expanded_source_address_prefix + self.expanded_destination_address_prefix = expanded_destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route.py index 782459c38540..70f068bf30f1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route.py @@ -50,11 +50,11 @@ class EffectiveRoute(Model): 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, } - def __init__(self, name=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None): - super(EffectiveRoute, self).__init__() - self.name = name - self.source = source - self.state = state - self.address_prefix = address_prefix - self.next_hop_ip_address = next_hop_ip_address - self.next_hop_type = next_hop_type + def __init__(self, **kwargs): + super(EffectiveRoute, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.next_hop_type = kwargs.get('next_hop_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route_list_result.py index 73dc586ce27a..7918608249cf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route_list_result.py @@ -26,7 +26,7 @@ class EffectiveRouteListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(EffectiveRouteListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route_list_result_py3.py new file mode 100644 index 000000000000..df958c7b013a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route_list_result_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRouteListResult(Model): + """Response for list effective route API service call. + + :param value: A list of effective routes. + :type value: list[~azure.mgmt.network.v2016_09_01.models.EffectiveRoute] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route_py3.py new file mode 100644 index 000000000000..3d5f813c153d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/effective_route_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRoute(Model): + """Effective Route. + + :param name: The name of the user defined route. This is optional. + :type name: str + :param source: Who created the route. Possible values are: 'Unknown', + 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: + 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' + :type source: str or + ~azure.mgmt.network.v2016_09_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values are: 'Active' + and 'Invalid'. Possible values include: 'Active', 'Invalid' + :type state: str or + ~azure.mgmt.network.v2016_09_01.models.EffectiveRouteState + :param address_prefix: The address prefixes of the effective routes in + CIDR notation. + :type address_prefix: list[str] + :param next_hop_ip_address: The IP address of the next hop of the + effective route. + :type next_hop_ip_address: list[str] + :param next_hop_type: The type of Azure hop the packet should be sent to. + Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2016_09_01.models.RouteNextHopType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None, **kwargs) -> None: + super(EffectiveRoute, self).__init__(**kwargs) + self.name = name + self.source = source + self.state = state + self.address_prefix = address_prefix + self.next_hop_ip_address = next_hop_ip_address + self.next_hop_type = next_hop_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error.py index d2b1b1cf2ef1..1714ba44e838 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error.py @@ -35,10 +35,10 @@ class Error(Model): 'inner_error': {'key': 'innerError', 'type': 'str'}, } - def __init__(self, code=None, message=None, target=None, details=None, inner_error=None): - super(Error, self).__init__() - self.code = code - self.message = message - self.target = target - self.details = details - self.inner_error = inner_error + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error_details.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error_details.py index 40bea00aa2fb..a8c4da6ba955 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error_details.py @@ -29,8 +29,8 @@ class ErrorDetails(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ErrorDetails, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error_details_py3.py new file mode 100644 index 000000000000..d791f0895345 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error_details_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """ErrorDetails. + + :param code: + :type code: str + :param target: + :type target: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error_py3.py new file mode 100644 index 000000000000..622b391943cc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(Model): + """Error. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.network.v2016_09_01.models.ErrorDetails] + :param inner_error: + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, inner_error: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit.py index 41057beccd53..59b5d8c04ac9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit.py @@ -90,17 +90,17 @@ class ExpressRouteCircuit(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, allow_classic_operations=None, circuit_provisioning_state=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key=None, service_provider_notes=None, service_provider_properties=None, provisioning_state=None, gateway_manager_etag=None, etag=None): - super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.allow_classic_operations = allow_classic_operations - self.circuit_provisioning_state = circuit_provisioning_state - self.service_provider_provisioning_state = service_provider_provisioning_state - self.authorizations = authorizations - self.peerings = peerings - self.service_key = service_key - self.service_provider_notes = service_provider_notes - self.service_provider_properties = service_provider_properties - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag - self.etag = etag + def __init__(self, **kwargs): + super(ExpressRouteCircuit, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.allow_classic_operations = kwargs.get('allow_classic_operations', None) + self.circuit_provisioning_state = kwargs.get('circuit_provisioning_state', None) + self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) + self.authorizations = kwargs.get('authorizations', None) + self.peerings = kwargs.get('peerings', None) + self.service_key = kwargs.get('service_key', None) + self.service_provider_notes = kwargs.get('service_provider_notes', None) + self.service_provider_properties = kwargs.get('service_provider_properties', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_arp_table.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_arp_table.py index ace325747ee5..826796619769 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_arp_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_arp_table.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitArpTable(Model): 'mac_address': {'key': 'macAddress', 'type': 'str'}, } - def __init__(self, age=None, interface=None, ip_address=None, mac_address=None): - super(ExpressRouteCircuitArpTable, self).__init__() - self.age = age - self.interface = interface - self.ip_address = ip_address - self.mac_address = mac_address + def __init__(self, **kwargs): + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = kwargs.get('age', None) + self.interface = kwargs.get('interface', None) + self.ip_address = kwargs.get('ip_address', None) + self.mac_address = kwargs.get('mac_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_arp_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_arp_table_py3.py new file mode 100644 index 000000000000..4401108c6001 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_arp_table_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitArpTable(Model): + """The ARP table associated with the ExpressRouteCircuit. + + :param age: Age + :type age: int + :param interface: Interface + :type interface: str + :param ip_address: The IP address. + :type ip_address: str + :param mac_address: The MAC address. + :type mac_address: str + """ + + _attribute_map = { + 'age': {'key': 'age', 'type': 'int'}, + 'interface': {'key': 'interface', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, *, age: int=None, interface: str=None, ip_address: str=None, mac_address: str=None, **kwargs) -> None: + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = age + self.interface = interface + self.ip_address = ip_address + self.mac_address = mac_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_authorization.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_authorization.py index 0b454094feda..d779031068e1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_authorization.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_authorization.py @@ -44,10 +44,10 @@ class ExpressRouteCircuitAuthorization(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, authorization_key=None, authorization_use_status=None, provisioning_state=None, name=None, etag=None): - super(ExpressRouteCircuitAuthorization, self).__init__(id=id) - self.authorization_key = authorization_key - self.authorization_use_status = authorization_use_status - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ExpressRouteCircuitAuthorization, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.authorization_use_status = kwargs.get('authorization_use_status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_authorization_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_authorization_py3.py new file mode 100644 index 000000000000..9bec6f0c222a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_authorization_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + :param id: Resource ID. + :type id: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param authorization_use_status: AuthorizationUseStatus. Possible values + are: 'Available' and 'InUse'. Possible values include: 'Available', + 'InUse' + :type authorization_use_status: str or + ~azure.mgmt.network.v2016_09_01.models.AuthorizationUseStatus + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, authorization_key: str=None, authorization_use_status=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuitAuthorization, self).__init__(id=id, **kwargs) + self.authorization_key = authorization_key + self.authorization_use_status = authorization_use_status + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering.py index 4c246b1fc643..f0ae4e282cd3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering.py @@ -86,22 +86,22 @@ class ExpressRouteCircuitPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, peering_type=None, state=None, azure_asn=None, peer_asn=None, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, primary_azure_port=None, secondary_azure_port=None, shared_key=None, vlan_id=None, microsoft_peering_config=None, stats=None, provisioning_state=None, gateway_manager_etag=None, last_modified_by=None, name=None, etag=None): - super(ExpressRouteCircuitPeering, self).__init__(id=id) - self.peering_type = peering_type - self.state = state - self.azure_asn = azure_asn - self.peer_asn = peer_asn - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.primary_azure_port = primary_azure_port - self.secondary_azure_port = secondary_azure_port - self.shared_key = shared_key - self.vlan_id = vlan_id - self.microsoft_peering_config = microsoft_peering_config - self.stats = stats - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag - self.last_modified_by = last_modified_by - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeering, self).__init__(**kwargs) + self.peering_type = kwargs.get('peering_type', None) + self.state = kwargs.get('state', None) + self.azure_asn = kwargs.get('azure_asn', None) + self.peer_asn = kwargs.get('peer_asn', None) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.primary_azure_port = kwargs.get('primary_azure_port', None) + self.secondary_azure_port = kwargs.get('secondary_azure_port', None) + self.shared_key = kwargs.get('shared_key', None) + self.vlan_id = kwargs.get('vlan_id', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.stats = kwargs.get('stats', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering_config.py index 2899722ad407..e8b3596b9edd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering_config.py @@ -38,9 +38,9 @@ class ExpressRouteCircuitPeeringConfig(Model): 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, } - def __init__(self, advertised_public_prefixes=None, advertised_public_prefixes_state=None, customer_asn=None, routing_registry_name=None): - super(ExpressRouteCircuitPeeringConfig, self).__init__() - self.advertised_public_prefixes = advertised_public_prefixes - self.advertised_public_prefixes_state = advertised_public_prefixes_state - self.customer_asn = customer_asn - self.routing_registry_name = routing_registry_name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = kwargs.get('advertised_public_prefixes', None) + self.advertised_public_prefixes_state = kwargs.get('advertised_public_prefixes_state', None) + self.customer_asn = kwargs.get('customer_asn', None) + self.routing_registry_name = kwargs.get('routing_registry_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..110708c089a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering_config_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitPeeringConfig(Model): + """Specifies the peering configuration. + + :param advertised_public_prefixes: The reference of + AdvertisedPublicPrefixes. + :type advertised_public_prefixes: list[str] + :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of + the Peering resource. Possible values are 'NotConfigured', 'Configuring', + 'Configured', and 'ValidationNeeded'. Possible values include: + 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' + :type advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :param customer_asn: The CustomerASN of the peering. + :type customer_asn: int + :param routing_registry_name: The RoutingRegistryName of the + configuration. + :type routing_registry_name: str + """ + + _attribute_map = { + 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, + 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, + 'customer_asn': {'key': 'customerASN', 'type': 'int'}, + 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, + } + + def __init__(self, *, advertised_public_prefixes=None, advertised_public_prefixes_state=None, customer_asn: int=None, routing_registry_name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = advertised_public_prefixes + self.advertised_public_prefixes_state = advertised_public_prefixes_state + self.customer_asn = customer_asn + self.routing_registry_name = routing_registry_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering_py3.py new file mode 100644 index 000000000000..eeb6020cf8ba --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_peering_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitPeering(SubResource): + """Peering in an ExpressRouteCircuit resource. + + :param id: Resource ID. + :type id: str + :param peering_type: The PeeringType. Possible values are: + 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. + Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + 'MicrosoftPeering' + :type peering_type: str or + ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeeringType + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeeringState + :param azure_asn: The Azure ASN. + :type azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: int + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param primary_azure_port: The primary port. + :type primary_azure_port: str + :param secondary_azure_port: The secondary port. + :type secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeeringConfig + :param stats: Gets peering stats. + :type stats: + ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitStats + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :param last_modified_by: Gets whether the provider or the customer last + modified the peering. + :type last_modified_by: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'int'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, peering_type=None, state=None, azure_asn: int=None, peer_asn: int=None, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, primary_azure_port: str=None, secondary_azure_port: str=None, shared_key: str=None, vlan_id: int=None, microsoft_peering_config=None, stats=None, provisioning_state: str=None, gateway_manager_etag: str=None, last_modified_by: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeering, self).__init__(id=id, **kwargs) + self.peering_type = peering_type + self.state = state + self.azure_asn = azure_asn + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = primary_azure_port + self.secondary_azure_port = secondary_azure_port + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.stats = stats + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.last_modified_by = last_modified_by + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_py3.py new file mode 100644 index 000000000000..99b29b658333 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_py3.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteCircuit(Resource): + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The SKU. + :type sku: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitSku + :param allow_classic_operations: Allow classic operations + :type allow_classic_operations: bool + :param circuit_provisioning_state: The CircuitProvisioningState state of + the resource. + :type circuit_provisioning_state: str + :param service_provider_provisioning_state: The + ServiceProviderProvisioningState state of the resource. Possible values + are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + 'Deprovisioning' + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2016_09_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: + list[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeering] + :param service_key: The ServiceKey. + :type service_key: str + :param service_provider_notes: The ServiceProviderNotes. + :type service_provider_notes: str + :param service_provider_properties: The ServiceProviderProperties. + :type service_provider_properties: + ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitServiceProviderProperties + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, + 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, + 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, allow_classic_operations: bool=None, circuit_provisioning_state: str=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key: str=None, service_provider_notes: str=None, service_provider_properties=None, provisioning_state: str=None, gateway_manager_etag: str=None, etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.allow_classic_operations = allow_classic_operations + self.circuit_provisioning_state = circuit_provisioning_state + self.service_provider_provisioning_state = service_provider_provisioning_state + self.authorizations = authorizations + self.peerings = peerings + self.service_key = service_key + self.service_provider_notes = service_provider_notes + self.service_provider_properties = service_provider_properties + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table.py index 804d29a2f9bb..7517e9867cfb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table.py @@ -35,10 +35,10 @@ class ExpressRouteCircuitRoutesTable(Model): 'path': {'key': 'path', 'type': 'str'}, } - def __init__(self, network=None, next_hop=None, loc_prf=None, weight=None, path=None): - super(ExpressRouteCircuitRoutesTable, self).__init__() - self.network = network - self.next_hop = next_hop - self.loc_prf = loc_prf - self.weight = weight - self.path = path + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = kwargs.get('network', None) + self.next_hop = kwargs.get('next_hop', None) + self.loc_prf = kwargs.get('loc_prf', None) + self.weight = kwargs.get('weight', None) + self.path = kwargs.get('path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table_py3.py new file mode 100644 index 000000000000..38ea85cf642d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTable(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param network: network + :type network: str + :param next_hop: nextHop + :type next_hop: str + :param loc_prf: locPrf + :type loc_prf: str + :param weight: weight. + :type weight: int + :param path: path + :type path: str + """ + + _attribute_map = { + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'loc_prf': {'key': 'locPrf', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, *, network: str=None, next_hop: str=None, loc_prf: str=None, weight: int=None, path: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = network + self.next_hop = next_hop + self.loc_prf = loc_prf + self.weight = weight + self.path = path diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table_summary.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table_summary.py index 6f5f89764dd4..577c3c2edd45 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table_summary.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table_summary.py @@ -37,10 +37,10 @@ class ExpressRouteCircuitRoutesTableSummary(Model): 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, } - def __init__(self, neighbor=None, v=None, as_property=None, up_down=None, state_pfx_rcd=None): - super(ExpressRouteCircuitRoutesTableSummary, self).__init__() - self.neighbor = neighbor - self.v = v - self.as_property = as_property - self.up_down = up_down - self.state_pfx_rcd = state_pfx_rcd + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = kwargs.get('neighbor', None) + self.v = kwargs.get('v', None) + self.as_property = kwargs.get('as_property', None) + self.up_down = kwargs.get('up_down', None) + self.state_pfx_rcd = kwargs.get('state_pfx_rcd', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table_summary_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table_summary_py3.py new file mode 100644 index 000000000000..e18d0051d218 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_routes_table_summary_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTableSummary(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: Neighbor + :type neighbor: str + :param v: BGP version number spoken to the neighbor. + :type v: int + :param as_property: Autonomous system number. + :type as_property: int + :param up_down: The length of time that the BGP session has been in the + Established state, or the current status if not in the Established state. + :type up_down: str + :param state_pfx_rcd: Current state of the BGP session, and the number of + prefixes that have been received from a neighbor or peer group. + :type state_pfx_rcd: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'v': {'key': 'v', 'type': 'int'}, + 'as_property': {'key': 'as', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, + } + + def __init__(self, *, neighbor: str=None, v: int=None, as_property: int=None, up_down: str=None, state_pfx_rcd: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = neighbor + self.v = v + self.as_property = as_property + self.up_down = up_down + self.state_pfx_rcd = state_pfx_rcd diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_service_provider_properties.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_service_provider_properties.py index 7a6b4ba96061..c51e6d8d653b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_service_provider_properties.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_service_provider_properties.py @@ -29,8 +29,8 @@ class ExpressRouteCircuitServiceProviderProperties(Model): 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, } - def __init__(self, service_provider_name=None, peering_location=None, bandwidth_in_mbps=None): - super(ExpressRouteCircuitServiceProviderProperties, self).__init__() - self.service_provider_name = service_provider_name - self.peering_location = peering_location - self.bandwidth_in_mbps = bandwidth_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = kwargs.get('service_provider_name', None) + self.peering_location = kwargs.get('peering_location', None) + self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_service_provider_properties_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_service_provider_properties_py3.py new file mode 100644 index 000000000000..ea701a54c3fe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_service_provider_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitServiceProviderProperties(Model): + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :param service_provider_name: The serviceProviderName. + :type service_provider_name: str + :param peering_location: The peering location. + :type peering_location: str + :param bandwidth_in_mbps: The BandwidthInMbps. + :type bandwidth_in_mbps: int + """ + + _attribute_map = { + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + } + + def __init__(self, *, service_provider_name: str=None, peering_location: str=None, bandwidth_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = service_provider_name + self.peering_location = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_sku.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_sku.py index e5524c749dd6..655772792901 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_sku.py @@ -33,8 +33,8 @@ class ExpressRouteCircuitSku(Model): 'family': {'key': 'family', 'type': 'str'}, } - def __init__(self, name=None, tier=None, family=None): - super(ExpressRouteCircuitSku, self).__init__() - self.name = name - self.tier = tier - self.family = family + def __init__(self, **kwargs): + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.family = kwargs.get('family', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_sku_py3.py new file mode 100644 index 000000000000..1e29b630b3f7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_sku_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitSku(Model): + """Contains SKU in an ExpressRouteCircuit. + + :param name: The name of the SKU. + :type name: str + :param tier: The tier of the SKU. Possible values are 'Standard' and + 'Premium'. Possible values include: 'Standard', 'Premium' + :type tier: str or + ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values are: 'UnlimitedData' + and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' + :type family: str or + ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, tier=None, family=None, **kwargs) -> None: + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.family = family diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_stats.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_stats.py index e26f6f7d2f74..41c45ae2b19a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_stats.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_stats.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitStats(Model): 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, } - def __init__(self, primarybytes_in=None, primarybytes_out=None, secondarybytes_in=None, secondarybytes_out=None): - super(ExpressRouteCircuitStats, self).__init__() - self.primarybytes_in = primarybytes_in - self.primarybytes_out = primarybytes_out - self.secondarybytes_in = secondarybytes_in - self.secondarybytes_out = secondarybytes_out + def __init__(self, **kwargs): + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = kwargs.get('primarybytes_in', None) + self.primarybytes_out = kwargs.get('primarybytes_out', None) + self.secondarybytes_in = kwargs.get('secondarybytes_in', None) + self.secondarybytes_out = kwargs.get('secondarybytes_out', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_stats_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_stats_py3.py new file mode 100644 index 000000000000..f78335343544 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuit_stats_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitStats(Model): + """Contains stats associated with the peering. + + :param primarybytes_in: Gets BytesIn of the peering. + :type primarybytes_in: long + :param primarybytes_out: Gets BytesOut of the peering. + :type primarybytes_out: long + :param secondarybytes_in: Gets BytesIn of the peering. + :type secondarybytes_in: long + :param secondarybytes_out: Gets BytesOut of the peering. + :type secondarybytes_out: long + """ + + _attribute_map = { + 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, + 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, + 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, + 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, + } + + def __init__(self, *, primarybytes_in: int=None, primarybytes_out: int=None, secondarybytes_in: int=None, secondarybytes_out: int=None, **kwargs) -> None: + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = primarybytes_in + self.primarybytes_out = primarybytes_out + self.secondarybytes_in = secondarybytes_in + self.secondarybytes_out = secondarybytes_out diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_arp_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_arp_table_list_result.py index f5815585579a..76dab6a07afc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_arp_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_arp_table_list_result.py @@ -27,7 +27,7 @@ class ExpressRouteCircuitsArpTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsArpTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_arp_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_arp_table_list_result_py3.py new file mode 100644 index 000000000000..2b5a8e588375 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_arp_table_list_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsArpTableListResult(Model): + """Response for ListArpTable associated with the Express Route Circuits API. + + :param value: Gets list of the ARP table. + :type value: + list[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitArpTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_list_result.py index f92fbb8fd520..b4d225d0aa89 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_list_result_py3.py new file mode 100644 index 000000000000..b5ca98c72dd7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: The list of routes table. + :type value: + list[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitRoutesTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_summary_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_summary_list_result.py index 569c861ce662..5d72ba3c22b7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_summary_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_summary_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_summary_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_summary_list_result_py3.py new file mode 100644 index 000000000000..27e34786908f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_circuits_routes_table_summary_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: A list of the routes table. + :type value: + list[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitRoutesTableSummary] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider.py index b0ea7ca6f92f..cb6d434c5d23 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider.py @@ -53,8 +53,8 @@ class ExpressRouteServiceProvider(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state=None): - super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags) - self.peering_locations = peering_locations - self.bandwidths_offered = bandwidths_offered - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ExpressRouteServiceProvider, self).__init__(**kwargs) + self.peering_locations = kwargs.get('peering_locations', None) + self.bandwidths_offered = kwargs.get('bandwidths_offered', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider_bandwidths_offered.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider_bandwidths_offered.py index 9cbba2fcfe97..b27622af42d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider_bandwidths_offered.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider_bandwidths_offered.py @@ -26,7 +26,7 @@ class ExpressRouteServiceProviderBandwidthsOffered(Model): 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, } - def __init__(self, offer_name=None, value_in_mbps=None): - super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__() - self.offer_name = offer_name - self.value_in_mbps = value_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = kwargs.get('offer_name', None) + self.value_in_mbps = kwargs.get('value_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider_bandwidths_offered_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider_bandwidths_offered_py3.py new file mode 100644 index 000000000000..88516a0dfcf8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider_bandwidths_offered_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteServiceProviderBandwidthsOffered(Model): + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :param offer_name: The OfferName. + :type offer_name: str + :param value_in_mbps: The ValueInMbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__(self, *, offer_name: str=None, value_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = offer_name + self.value_in_mbps = value_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider_py3.py new file mode 100644 index 000000000000..0eed8533bb42 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/express_route_service_provider_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param peering_locations: Get a list of peering locations. + :type peering_locations: list[str] + :param bandwidths_offered: Gets bandwidths offered. + :type bandwidths_offered: + list[~azure.mgmt.network.v2016_09_01.models.ExpressRouteServiceProviderBandwidthsOffered] + :param provisioning_state: Gets the provisioning state of the resource. + :type provisioning_state: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, + 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state: str=None, **kwargs) -> None: + super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.peering_locations = peering_locations + self.bandwidths_offered = bandwidths_offered + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_information.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_information.py index 24e7f2c047a6..fe72e9d1ec4f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_information.py @@ -15,13 +15,15 @@ class FlowLogInformation(Model): """Information on the configuration of flow log. - :param target_resource_id: The ID of the resource to configure for flow - logging. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. :type target_resource_id: str - :param storage_id: ID of the storage account which is used to store the - flow log. + :param storage_id: Required. ID of the storage account which is used to + store the flow log. :type storage_id: str - :param enabled: Flag to enable/disable flow logging. + :param enabled: Required. Flag to enable/disable flow logging. :type enabled: bool :param retention_policy: :type retention_policy: @@ -41,9 +43,9 @@ class FlowLogInformation(Model): 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, } - def __init__(self, target_resource_id, storage_id, enabled, retention_policy=None): - super(FlowLogInformation, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.enabled = enabled - self.retention_policy = retention_policy + def __init__(self, **kwargs): + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.enabled = kwargs.get('enabled', None) + self.retention_policy = kwargs.get('retention_policy', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_information_py3.py new file mode 100644 index 000000000000..9def3c90b30c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_information_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogInformation(Model): + """Information on the configuration of flow log. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. + :type target_resource_id: str + :param storage_id: Required. ID of the storage account which is used to + store the flow log. + :type storage_id: str + :param enabled: Required. Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: + :type retention_policy: + ~azure.mgmt.network.v2016_09_01.models.RetentionPolicyParameters + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, enabled: bool, retention_policy=None, **kwargs) -> None: + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.enabled = enabled + self.retention_policy = retention_policy diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_status_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_status_parameters.py index 4cd22222bb45..5a48e938f2d6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_status_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_status_parameters.py @@ -15,8 +15,10 @@ class FlowLogStatusParameters(Model): """Parameters that define a resource to query flow log status. - :param target_resource_id: The target resource where getting the flow - logging status. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class FlowLogStatusParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(FlowLogStatusParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_status_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_status_parameters_py3.py new file mode 100644 index 000000000000..0768d2495150 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/flow_log_status_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogStatusParameters(Model): + """Parameters that define a resource to query flow log status. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/frontend_ip_configuration.py index 558b1de5eab2..2e1333657597 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/frontend_ip_configuration.py @@ -81,16 +81,16 @@ class FrontendIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(FrontendIPConfiguration, self).__init__(id=id) + def __init__(self, **kwargs): + super(FrontendIPConfiguration, self).__init__(**kwargs) self.inbound_nat_rules = None self.inbound_nat_pools = None self.outbound_nat_rules = None self.load_balancing_rules = None - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..33da2725f69a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/frontend_ip_configuration_py3.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class FrontendIPConfiguration(SubResource): + """Frontend IP address of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar inbound_nat_rules: Read only. Inbound rules URIs that use this + frontend IP. + :vartype inbound_nat_rules: + list[~azure.mgmt.network.v2016_09_01.models.SubResource] + :ivar inbound_nat_pools: Read only. Inbound pools URIs that use this + frontend IP. + :vartype inbound_nat_pools: + list[~azure.mgmt.network.v2016_09_01.models.SubResource] + :ivar outbound_nat_rules: Read only. Outbound rules URIs that use this + frontend IP. + :vartype outbound_nat_rules: + list[~azure.mgmt.network.v2016_09_01.models.SubResource] + :ivar load_balancing_rules: Gets load balancing rules URIs that use this + frontend IP. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2016_09_01.models.SubResource] + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The Private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2016_09_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2016_09_01.models.Subnet + :param public_ip_address: The reference of the Public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2016_09_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'inbound_nat_rules': {'readonly': True}, + 'inbound_nat_pools': {'readonly': True}, + 'outbound_nat_rules': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[SubResource]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(FrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.inbound_nat_rules = None + self.inbound_nat_pools = None + self.outbound_nat_rules = None + self.load_balancing_rules = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route.py index b4e542466325..f49c0aa3433d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route.py @@ -54,8 +54,8 @@ class GatewayRoute(Model): 'weight': {'key': 'weight', 'type': 'int'}, } - def __init__(self): - super(GatewayRoute, self).__init__() + def __init__(self, **kwargs): + super(GatewayRoute, self).__init__(**kwargs) self.local_address = None self.network = None self.next_hop = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route_list_result.py index 58a2b7e49823..1dc884022f17 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route_list_result.py @@ -23,6 +23,6 @@ class GatewayRouteListResult(Model): 'value': {'key': 'value', 'type': '[GatewayRoute]'}, } - def __init__(self, value=None): - super(GatewayRouteListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route_list_result_py3.py new file mode 100644 index 000000000000..37b41a6d3f35 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRouteListResult(Model): + """List of virtual network gateway routes. + + :param value: List of gateway routes + :type value: list[~azure.mgmt.network.v2016_09_01.models.GatewayRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayRoute]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route_py3.py new file mode 100644 index 000000000000..89d6acedbc58 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/gateway_route_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRoute(Model): + """GatewayRoute. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The gateway's local address + :vartype local_address: str + :ivar network: The route's network prefix + :vartype network: str + :ivar next_hop: The route's next hop + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from + :vartype source_peer: str + :ivar origin: The source this route was learned from + :vartype origin: str + :ivar as_path: The route's AS path sequence + :vartype as_path: str + :ivar weight: The route's weight + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(GatewayRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_pool.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_pool.py index 2741c90367e6..59543d3023b7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_pool.py @@ -15,25 +15,29 @@ class InboundNatPool(SubResource): """Inbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. :type frontend_ip_configuration: ~azure.mgmt.network.v2016_09_01.models.SubResource - :param protocol: The transport protocol for the endpoint. Possible values - are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :param protocol: Required. The transport protocol for the endpoint. + Possible values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2016_09_01.models.TransportProtocol - :param frontend_port_range_start: The first port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65534. + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. :type frontend_port_range_start: int - :param frontend_port_range_end: The last port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65535. + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. :type frontend_port_range_end: int - :param backend_port: The port used for internal connections on the - endpoint. Acceptable values are between 1 and 65535. + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. :type backend_port: int :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. @@ -65,13 +69,13 @@ class InboundNatPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port_range_start, frontend_port_range_end, backend_port, id=None, frontend_ip_configuration=None, provisioning_state=None, name=None, etag=None): - super(InboundNatPool, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.protocol = protocol - self.frontend_port_range_start = frontend_port_range_start - self.frontend_port_range_end = frontend_port_range_end - self.backend_port = backend_port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(InboundNatPool, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.protocol = kwargs.get('protocol', None) + self.frontend_port_range_start = kwargs.get('frontend_port_range_start', None) + self.frontend_port_range_end = kwargs.get('frontend_port_range_end', None) + self.backend_port = kwargs.get('backend_port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_pool_py3.py new file mode 100644 index 000000000000..c0143fac23e3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_pool_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatPool(SubResource): + """Inbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param protocol: Required. The transport protocol for the endpoint. + Possible values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2016_09_01.models.TransportProtocol + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. + :type frontend_port_range_start: int + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. + :type frontend_port_range_end: int + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port_range_start': {'required': True}, + 'frontend_port_range_end': {'required': True}, + 'backend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, + 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port_range_start: int, frontend_port_range_end: int, backend_port: int, id: str=None, frontend_ip_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatPool, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.protocol = protocol + self.frontend_port_range_start = frontend_port_range_start + self.frontend_port_range_end = frontend_port_range_end + self.backend_port = backend_port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_rule.py index 72002a10e634..b68b92f95a2e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_rule.py @@ -78,15 +78,15 @@ class InboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, protocol=None, frontend_port=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(InboundNatRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration + def __init__(self, **kwargs): + super(InboundNatRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) self.backend_ip_configuration = None - self.protocol = protocol - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_rule_py3.py new file mode 100644 index 000000000000..c1e73c6d3686 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/inbound_nat_rule_py3.py @@ -0,0 +1,92 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatRule(SubResource): + """Inbound NAT rule of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :ivar backend_ip_configuration: A reference to a private IP address + defined on a network interface of a VM. Traffic sent to the frontend port + of each of the frontend IP configurations is forwarded to the backed IP. + :vartype backend_ip_configuration: + ~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceIPConfiguration + :param protocol: The transport protocol for the endpoint. Possible values + are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2016_09_01.models.TransportProtocol + :param frontend_port: The port for the external endpoint. Port numbers for + each rule must be unique within the Load Balancer. Acceptable values range + from 1 to 65534. + :type frontend_port: int + :param backend_port: The port used for the internal endpoint. Acceptable + values range from 1 to 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, protocol=None, frontend_port: int=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_ip_configuration = None + self.protocol = protocol + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_address_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_address_availability_result.py index f2cb36a550ec..6bcf52275711 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_address_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_address_availability_result.py @@ -27,7 +27,7 @@ class IPAddressAvailabilityResult(Model): 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, } - def __init__(self, available=None, available_ip_addresses=None): - super(IPAddressAvailabilityResult, self).__init__() - self.available = available - self.available_ip_addresses = available_ip_addresses + def __init__(self, **kwargs): + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) + self.available_ip_addresses = kwargs.get('available_ip_addresses', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_address_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_address_availability_result_py3.py new file mode 100644 index 000000000000..e5fc4340d370 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_address_availability_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPAddressAvailabilityResult(Model): + """Response for CheckIPAddressAvailability API service call. + + :param available: Private IP address availability. + :type available: bool + :param available_ip_addresses: Contains other available private IP + addresses if the asked for address is taken. + :type available_ip_addresses: list[str] + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, + } + + def __init__(self, *, available: bool=None, available_ip_addresses=None, **kwargs) -> None: + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = available + self.available_ip_addresses = available_ip_addresses diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_configuration.py index 1a3a83880b71..80572db64906 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_configuration.py @@ -51,12 +51,12 @@ class IPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(IPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(IPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_configuration_py3.py new file mode 100644 index 000000000000..7a7e1bed7a4f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/ip_configuration_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class IPConfiguration(SubResource): + """IPConfiguration. + + :param id: Resource ID. + :type id: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2016_09_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2016_09_01.models.Subnet + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2016_09_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(IPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancer.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancer.py index 5a06eae4cd23..175815eaba43 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancer.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancer.py @@ -97,15 +97,15 @@ class LoadBalancer(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(LoadBalancer, self).__init__(id=id, location=location, tags=tags) - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pools = backend_address_pools - self.load_balancing_rules = load_balancing_rules - self.probes = probes - self.inbound_nat_rules = inbound_nat_rules - self.inbound_nat_pools = inbound_nat_pools - self.outbound_nat_rules = outbound_nat_rules - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancer, self).__init__(**kwargs) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.load_balancing_rules = kwargs.get('load_balancing_rules', None) + self.probes = kwargs.get('probes', None) + self.inbound_nat_rules = kwargs.get('inbound_nat_rules', None) + self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) + self.outbound_nat_rules = kwargs.get('outbound_nat_rules', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancer_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancer_py3.py new file mode 100644 index 000000000000..9694829961ad --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancer_py3.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LoadBalancer(Resource): + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param frontend_ip_configurations: Object representing the frontend IPs to + be used for the load balancer + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2016_09_01.models.FrontendIPConfiguration] + :param backend_address_pools: Collection of backend address pools used by + a load balancer + :type backend_address_pools: + list[~azure.mgmt.network.v2016_09_01.models.BackendAddressPool] + :param load_balancing_rules: Object collection representing the load + balancing rules Gets the provisioning + :type load_balancing_rules: + list[~azure.mgmt.network.v2016_09_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer + :type probes: list[~azure.mgmt.network.v2016_09_01.models.Probe] + :param inbound_nat_rules: Collection of inbound NAT Rules used by a load + balancer. Defining inbound NAT rules on your load balancer is mutually + exclusive with defining an inbound NAT pool. Inbound NAT pools are + referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an Inbound NAT pool. They + have to reference individual inbound NAT rules. + :type inbound_nat_rules: + list[~azure.mgmt.network.v2016_09_01.models.InboundNatRule] + :param inbound_nat_pools: Defines an external port range for inbound NAT + to a single backend port on NICs associated with a load balancer. Inbound + NAT rules are created automatically for each NIC associated with the Load + Balancer using an external port from this range. Defining an Inbound NAT + pool on your Load Balancer is mutually exclusive with defining inbound Nat + rules. Inbound NAT pools are referenced from virtual machine scale sets. + NICs that are associated with individual virtual machines cannot reference + an inbound NAT pool. They have to reference individual inbound NAT rules. + :type inbound_nat_pools: + list[~azure.mgmt.network.v2016_09_01.models.InboundNatPool] + :param outbound_nat_rules: The outbound NAT rules. + :type outbound_nat_rules: + list[~azure.mgmt.network.v2016_09_01.models.OutboundNatRule] + :param resource_guid: The resource GUID property of the load balancer + resource. + :type resource_guid: str + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, + 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[OutboundNatRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancer, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pools = backend_address_pools + self.load_balancing_rules = load_balancing_rules + self.probes = probes + self.inbound_nat_rules = inbound_nat_rules + self.inbound_nat_pools = inbound_nat_pools + self.outbound_nat_rules = outbound_nat_rules + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancing_rule.py index bcfd412a1e37..f2f222f7359c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancing_rule.py @@ -15,6 +15,8 @@ class LoadBalancingRule(SubResource): """A loag balancing rule for a load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. @@ -27,8 +29,9 @@ class LoadBalancingRule(SubResource): :param probe: The reference of the load balancer probe used by the load balancing rule. :type probe: ~azure.mgmt.network.v2016_09_01.models.SubResource - :param protocol: The transport protocol for the external endpoint. - Possible values are 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :param protocol: Required. The transport protocol for the external + endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: + 'Udp', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2016_09_01.models.TransportProtocol :param load_distribution: The load distribution policy for this rule. @@ -36,9 +39,9 @@ class LoadBalancingRule(SubResource): Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' :type load_distribution: str or ~azure.mgmt.network.v2016_09_01.models.LoadDistribution - :param frontend_port: The port for the external endpoint. Port numbers for - each rule must be unique within the Load Balancer. Acceptable values are - between 1 and 65534. + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 1 and 65534. :type frontend_port: int :param backend_port: The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. @@ -85,17 +88,17 @@ class LoadBalancingRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port, id=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(LoadBalancingRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.backend_address_pool = backend_address_pool - self.probe = probe - self.protocol = protocol - self.load_distribution = load_distribution - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancingRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.probe = kwargs.get('probe', None) + self.protocol = kwargs.get('protocol', None) + self.load_distribution = kwargs.get('load_distribution', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancing_rule_py3.py new file mode 100644 index 000000000000..a377bc354b3e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/load_balancing_rule_py3.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class LoadBalancingRule(SubResource): + """A loag balancing rule for a load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param backend_address_pool: A reference to a pool of DIPs. Inbound + traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param probe: The reference of the load balancer probe used by the load + balancing rule. + :type probe: ~azure.mgmt.network.v2016_09_01.models.SubResource + :param protocol: Required. The transport protocol for the external + endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: + 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2016_09_01.models.TransportProtocol + :param load_distribution: The load distribution policy for this rule. + Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + :type load_distribution: str or + ~azure.mgmt.network.v2016_09_01.models.LoadDistribution + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 1 and 65534. + :type frontend_port: int + :param backend_port: The port used for internal connections on the + endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port: int, id: str=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancingRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_address_pool = backend_address_pool + self.probe = probe + self.protocol = protocol + self.load_distribution = load_distribution + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/local_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/local_network_gateway.py index 8f1398d30de9..b559c2e7da24 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/local_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/local_network_gateway.py @@ -18,6 +18,8 @@ class LocalNetworkGateway(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -28,7 +30,8 @@ class LocalNetworkGateway(Resource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :param local_network_address_space: Local network site address space. + :param local_network_address_space: Required. Local network site address + space. :type local_network_address_space: ~azure.mgmt.network.v2016_09_01.models.AddressSpace :param gateway_ip_address: IP address of local network gateway. @@ -68,11 +71,11 @@ class LocalNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, local_network_address_space, id=None, location=None, tags=None, gateway_ip_address=None, bgp_settings=None, resource_guid=None, etag=None): - super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.local_network_address_space = local_network_address_space - self.gateway_ip_address = gateway_ip_address - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(LocalNetworkGateway, self).__init__(**kwargs) + self.local_network_address_space = kwargs.get('local_network_address_space', None) + self.gateway_ip_address = kwargs.get('gateway_ip_address', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/local_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/local_network_gateway_py3.py new file mode 100644 index 000000000000..210d9e9d6d75 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/local_network_gateway_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LocalNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param local_network_address_space: Required. Local network site address + space. + :type local_network_address_space: + ~azure.mgmt.network.v2016_09_01.models.AddressSpace + :param gateway_ip_address: IP address of local network gateway. + :type gateway_ip_address: str + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2016_09_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + LocalNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', + and 'Failed'. + :vartype provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'local_network_address_space': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, + 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, local_network_address_space, id: str=None, location: str=None, tags=None, gateway_ip_address: str=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.local_network_address_space = local_network_address_space + self.gateway_ip_address = gateway_ip_address + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface.py index 7968fc86a596..2b68d718a42b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface.py @@ -87,16 +87,16 @@ class NetworkInterface(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address=None, primary=None, enable_accelerated_networking=None, enable_ip_forwarding=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkInterface, self).__init__(id=id, location=location, tags=tags) - self.virtual_machine = virtual_machine - self.network_security_group = network_security_group - self.ip_configurations = ip_configurations - self.dns_settings = dns_settings - self.mac_address = mac_address - self.primary = primary - self.enable_accelerated_networking = enable_accelerated_networking - self.enable_ip_forwarding = enable_ip_forwarding - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.virtual_machine = kwargs.get('virtual_machine', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.mac_address = kwargs.get('mac_address', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_association.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_association.py index bfc726978cec..650ccc6e0ed8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_association.py @@ -34,7 +34,7 @@ class NetworkInterfaceAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(NetworkInterfaceAssociation, self).__init__() + def __init__(self, **kwargs): + super(NetworkInterfaceAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_association_py3.py new file mode 100644 index 000000000000..28d5658adb0f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Network interface ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2016_09_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(NetworkInterfaceAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_dns_settings.py index 675a4a1eb08a..b6ee0ff40d51 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_dns_settings.py @@ -46,10 +46,10 @@ class NetworkInterfaceDnsSettings(Model): 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, } - def __init__(self, dns_servers=None, applied_dns_servers=None, internal_dns_name_label=None, internal_fqdn=None, internal_domain_name_suffix=None): - super(NetworkInterfaceDnsSettings, self).__init__() - self.dns_servers = dns_servers - self.applied_dns_servers = applied_dns_servers - self.internal_dns_name_label = internal_dns_name_label - self.internal_fqdn = internal_fqdn - self.internal_domain_name_suffix = internal_domain_name_suffix + def __init__(self, **kwargs): + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + self.applied_dns_servers = kwargs.get('applied_dns_servers', None) + self.internal_dns_name_label = kwargs.get('internal_dns_name_label', None) + self.internal_fqdn = kwargs.get('internal_fqdn', None) + self.internal_domain_name_suffix = kwargs.get('internal_domain_name_suffix', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_dns_settings_py3.py new file mode 100644 index 000000000000..ccdcc937def8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_dns_settings_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceDnsSettings(Model): + """DNS settings of a network interface. + + :param dns_servers: List of DNS servers IP addresses. Use + 'AzureProvidedDNS' to switch to azure provided DNS resolution. + 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + only value in dnsServers collection. + :type dns_servers: list[str] + :param applied_dns_servers: If the VM that uses this NIC is part of an + Availability Set, then this list will have the union of all DNS servers + from all NICs that are part of the Availability Set. This property is what + is configured on each of those VMs. + :type applied_dns_servers: list[str] + :param internal_dns_name_label: Relative DNS name for this NIC used for + internal communications between VMs in the same virtual network. + :type internal_dns_name_label: str + :param internal_fqdn: Fully qualified DNS name supporting internal + communications between VMs in the same virtual network. + :type internal_fqdn: str + :param internal_domain_name_suffix: Even if internalDnsNameLabel is not + specified, a DNS entry is created for the primary NIC of the VM. This DNS + name can be constructed by concatenating the VM name with the value of + internalDomainNameSuffix. + :type internal_domain_name_suffix: str + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, + 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, + } + + def __init__(self, *, dns_servers=None, applied_dns_servers=None, internal_dns_name_label: str=None, internal_fqdn: str=None, internal_domain_name_suffix: str=None, **kwargs) -> None: + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers + self.applied_dns_servers = applied_dns_servers + self.internal_dns_name_label = internal_dns_name_label + self.internal_fqdn = internal_fqdn + self.internal_domain_name_suffix = internal_domain_name_suffix diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_ip_configuration.py index 4caf7ad7535a..683506b154df 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_ip_configuration.py @@ -76,17 +76,17 @@ class NetworkInterfaceIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(NetworkInterfaceIPConfiguration, self).__init__(id=id) - self.application_gateway_backend_address_pools = application_gateway_backend_address_pools - self.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.private_ip_address_version = private_ip_address_version - self.subnet = subnet - self.primary = primary - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterfaceIPConfiguration, self).__init__(**kwargs) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_rules = kwargs.get('load_balancer_inbound_nat_rules', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_ip_configuration_py3.py new file mode 100644 index 000000000000..650a8f8b83ff --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_ip_configuration_py3.py @@ -0,0 +1,92 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class NetworkInterfaceIPConfiguration(SubResource): + """IPConfiguration in a network interface. + + :param id: Resource ID. + :type id: str + :param application_gateway_backend_address_pools: The reference of + ApplicationGatewayBackendAddressPool resource. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendAddressPool] + :param load_balancer_backend_address_pools: The reference of + LoadBalancerBackendAddressPool resource. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2016_09_01.models.BackendAddressPool] + :param load_balancer_inbound_nat_rules: A list of references of + LoadBalancerInboundNatRules. + :type load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2016_09_01.models.InboundNatRule] + :param private_ip_address: + :type private_ip_address: str + :param private_ip_allocation_method: Defines how a private IP address is + assigned. Possible values are: 'Static' and 'Dynamic'. Possible values + include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2016_09_01.models.IPAllocationMethod + :param private_ip_address_version: Available from Api-Version 2016-03-30 + onwards, it represents whether the specific ipconfiguration is IPv4 or + IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.network.v2016_09_01.models.IPVersion + :param subnet: + :type subnet: ~azure.mgmt.network.v2016_09_01.models.Subnet + :param primary: Gets whether this is a primary customer address on the + network interface. + :type primary: bool + :param public_ip_address: + :type public_ip_address: + ~azure.mgmt.network.v2016_09_01.models.PublicIPAddress + :param provisioning_state: + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address: str=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary: bool=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterfaceIPConfiguration, self).__init__(id=id, **kwargs) + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.private_ip_address_version = private_ip_address_version + self.subnet = subnet + self.primary = primary + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_py3.py new file mode 100644 index 000000000000..053fc75e0377 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_interface_py3.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkInterface(Resource): + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param virtual_machine: The reference of a virtual machine. + :type virtual_machine: ~azure.mgmt.network.v2016_09_01.models.SubResource + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2016_09_01.models.NetworkSecurityGroup + :param ip_configurations: A list of IPConfigurations of the network + interface. + :type ip_configurations: + list[~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceIPConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: + ~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceDnsSettings + :param mac_address: The MAC address of the network interface. + :type mac_address: str + :param primary: Gets whether this is a primary network interface on a + virtual machine. + :type primary: bool + :param enable_accelerated_networking: If the network interface is + accelerated networking enabled. + :type enable_accelerated_networking: bool + :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on + this network interface. + :type enable_ip_forwarding: bool + :param resource_guid: The resource GUID property of the network interface + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, + 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address: str=None, primary: bool=None, enable_accelerated_networking: bool=None, enable_ip_forwarding: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterface, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.virtual_machine = virtual_machine + self.network_security_group = network_security_group + self.ip_configurations = ip_configurations + self.dns_settings = dns_settings + self.mac_address = mac_address + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.enable_ip_forwarding = enable_ip_forwarding + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_management_client_enums.py index e51739c1d8ca..4d93648e67e6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_management_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class RouteNextHopType(Enum): +class RouteNextHopType(str, Enum): virtual_network_gateway = "VirtualNetworkGateway" vnet_local = "VnetLocal" @@ -21,56 +21,56 @@ class RouteNextHopType(Enum): none = "None" -class SecurityRuleProtocol(Enum): +class SecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" asterisk = "*" -class SecurityRuleAccess(Enum): +class SecurityRuleAccess(str, Enum): allow = "Allow" deny = "Deny" -class SecurityRuleDirection(Enum): +class SecurityRuleDirection(str, Enum): inbound = "Inbound" outbound = "Outbound" -class TransportProtocol(Enum): +class TransportProtocol(str, Enum): udp = "Udp" tcp = "Tcp" -class IPAllocationMethod(Enum): +class IPAllocationMethod(str, Enum): static = "Static" dynamic = "Dynamic" -class IPVersion(Enum): +class IPVersion(str, Enum): ipv4 = "IPv4" ipv6 = "IPv6" -class ApplicationGatewayProtocol(Enum): +class ApplicationGatewayProtocol(str, Enum): http = "Http" https = "Https" -class ApplicationGatewayCookieBasedAffinity(Enum): +class ApplicationGatewayCookieBasedAffinity(str, Enum): enabled = "Enabled" disabled = "Disabled" -class ApplicationGatewayBackendHealthServerHealth(Enum): +class ApplicationGatewayBackendHealthServerHealth(str, Enum): unknown = "Unknown" up = "Up" @@ -78,7 +78,7 @@ class ApplicationGatewayBackendHealthServerHealth(Enum): partial = "Partial" -class ApplicationGatewaySkuName(Enum): +class ApplicationGatewaySkuName(str, Enum): standard_small = "Standard_Small" standard_medium = "Standard_Medium" @@ -87,26 +87,26 @@ class ApplicationGatewaySkuName(Enum): waf_large = "WAF_Large" -class ApplicationGatewayTier(Enum): +class ApplicationGatewayTier(str, Enum): standard = "Standard" waf = "WAF" -class ApplicationGatewaySslProtocol(Enum): +class ApplicationGatewaySslProtocol(str, Enum): tl_sv1_0 = "TLSv1_0" tl_sv1_1 = "TLSv1_1" tl_sv1_2 = "TLSv1_2" -class ApplicationGatewayRequestRoutingRuleType(Enum): +class ApplicationGatewayRequestRoutingRuleType(str, Enum): basic = "Basic" path_based_routing = "PathBasedRouting" -class ApplicationGatewayOperationalState(Enum): +class ApplicationGatewayOperationalState(str, Enum): stopped = "Stopped" starting = "Starting" @@ -114,19 +114,19 @@ class ApplicationGatewayOperationalState(Enum): stopping = "Stopping" -class ApplicationGatewayFirewallMode(Enum): +class ApplicationGatewayFirewallMode(str, Enum): detection = "Detection" prevention = "Prevention" -class AuthorizationUseStatus(Enum): +class AuthorizationUseStatus(str, Enum): available = "Available" in_use = "InUse" -class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(str, Enum): not_configured = "NotConfigured" configuring = "Configuring" @@ -134,32 +134,32 @@ class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): validation_needed = "ValidationNeeded" -class ExpressRouteCircuitPeeringType(Enum): +class ExpressRouteCircuitPeeringType(str, Enum): azure_public_peering = "AzurePublicPeering" azure_private_peering = "AzurePrivatePeering" microsoft_peering = "MicrosoftPeering" -class ExpressRouteCircuitPeeringState(Enum): +class ExpressRouteCircuitPeeringState(str, Enum): disabled = "Disabled" enabled = "Enabled" -class ExpressRouteCircuitSkuTier(Enum): +class ExpressRouteCircuitSkuTier(str, Enum): standard = "Standard" premium = "Premium" -class ExpressRouteCircuitSkuFamily(Enum): +class ExpressRouteCircuitSkuFamily(str, Enum): unlimited_data = "UnlimitedData" metered_data = "MeteredData" -class ServiceProviderProvisioningState(Enum): +class ServiceProviderProvisioningState(str, Enum): not_provisioned = "NotProvisioned" provisioning = "Provisioning" @@ -167,27 +167,27 @@ class ServiceProviderProvisioningState(Enum): deprovisioning = "Deprovisioning" -class LoadDistribution(Enum): +class LoadDistribution(str, Enum): default = "Default" source_ip = "SourceIP" source_ip_protocol = "SourceIPProtocol" -class ProbeProtocol(Enum): +class ProbeProtocol(str, Enum): http = "Http" tcp = "Tcp" -class NetworkOperationStatus(Enum): +class NetworkOperationStatus(str, Enum): in_progress = "InProgress" succeeded = "Succeeded" failed = "Failed" -class EffectiveRouteSource(Enum): +class EffectiveRouteSource(str, Enum): unknown = "Unknown" user = "User" @@ -195,13 +195,13 @@ class EffectiveRouteSource(Enum): default = "Default" -class EffectiveRouteState(Enum): +class EffectiveRouteState(str, Enum): active = "Active" invalid = "Invalid" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): succeeded = "Succeeded" updating = "Updating" @@ -209,31 +209,31 @@ class ProvisioningState(Enum): failed = "Failed" -class AssociationType(Enum): +class AssociationType(str, Enum): associated = "Associated" contains = "Contains" -class Direction(Enum): +class Direction(str, Enum): inbound = "Inbound" outbound = "Outbound" -class Protocol(Enum): +class Protocol(str, Enum): tcp = "TCP" udp = "UDP" -class Access(Enum): +class Access(str, Enum): allow = "Allow" deny = "Deny" -class NextHopType(Enum): +class NextHopType(str, Enum): internet = "Internet" virtual_appliance = "VirtualAppliance" @@ -243,14 +243,14 @@ class NextHopType(Enum): none = "None" -class PcProtocol(Enum): +class PcProtocol(str, Enum): tcp = "TCP" udp = "UDP" any = "Any" -class PcStatus(Enum): +class PcStatus(str, Enum): not_started = "NotStarted" running = "Running" @@ -259,7 +259,7 @@ class PcStatus(Enum): unknown = "Unknown" -class PcError(Enum): +class PcError(str, Enum): internal_error = "InternalError" agent_stopped = "AgentStopped" @@ -268,26 +268,26 @@ class PcError(Enum): storage_failed = "StorageFailed" -class VirtualNetworkPeeringState(Enum): +class VirtualNetworkPeeringState(str, Enum): initiated = "Initiated" connected = "Connected" disconnected = "Disconnected" -class VirtualNetworkGatewayType(Enum): +class VirtualNetworkGatewayType(str, Enum): vpn = "Vpn" express_route = "ExpressRoute" -class VpnType(Enum): +class VpnType(str, Enum): policy_based = "PolicyBased" route_based = "RouteBased" -class VirtualNetworkGatewaySkuName(Enum): +class VirtualNetworkGatewaySkuName(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -295,7 +295,7 @@ class VirtualNetworkGatewaySkuName(Enum): ultra_performance = "UltraPerformance" -class VirtualNetworkGatewaySkuTier(Enum): +class VirtualNetworkGatewaySkuTier(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -303,7 +303,7 @@ class VirtualNetworkGatewaySkuTier(Enum): ultra_performance = "UltraPerformance" -class BgpPeerState(Enum): +class BgpPeerState(str, Enum): unknown = "Unknown" stopped = "Stopped" @@ -312,13 +312,13 @@ class BgpPeerState(Enum): connected = "Connected" -class ProcessorArchitecture(Enum): +class ProcessorArchitecture(str, Enum): amd64 = "Amd64" x86 = "X86" -class VirtualNetworkGatewayConnectionStatus(Enum): +class VirtualNetworkGatewayConnectionStatus(str, Enum): unknown = "Unknown" connecting = "Connecting" @@ -326,7 +326,7 @@ class VirtualNetworkGatewayConnectionStatus(Enum): not_connected = "NotConnected" -class VirtualNetworkGatewayConnectionType(Enum): +class VirtualNetworkGatewayConnectionType(str, Enum): ipsec = "IPsec" vnet2_vnet = "Vnet2Vnet" diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_security_group.py index 4a006ce519bd..515cb71ad03d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_security_group.py @@ -75,12 +75,12 @@ class NetworkSecurityGroup(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, security_rules=None, default_security_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags) - self.security_rules = security_rules - self.default_security_rules = default_security_rules + def __init__(self, **kwargs): + super(NetworkSecurityGroup, self).__init__(**kwargs) + self.security_rules = kwargs.get('security_rules', None) + self.default_security_rules = kwargs.get('default_security_rules', None) self.network_interfaces = None self.subnets = None - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_security_group_py3.py new file mode 100644 index 000000000000..10ccc1f2f077 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_security_group_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkSecurityGroup(Resource): + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param security_rules: A collection of security rules of the network + security group. + :type security_rules: + list[~azure.mgmt.network.v2016_09_01.models.SecurityRule] + :param default_security_rules: The default security rules of network + security group. + :type default_security_rules: + list[~azure.mgmt.network.v2016_09_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network + interfaces. + :vartype network_interfaces: + list[~azure.mgmt.network.v2016_09_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2016_09_01.models.Subnet] + :param resource_guid: The resource GUID property of the network security + group resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, + 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, security_rules=None, default_security_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.security_rules = security_rules + self.default_security_rules = default_security_rules + self.network_interfaces = None + self.subnets = None + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_watcher.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_watcher.py index 83e5b8718c77..eb12e7f52c2a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_watcher.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_watcher.py @@ -53,7 +53,7 @@ class NetworkWatcher(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, etag=None): - super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags) - self.etag = etag + def __init__(self, **kwargs): + super(NetworkWatcher, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_watcher_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_watcher_py3.py new file mode 100644 index 000000000000..403ff63d8640 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/network_watcher_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkWatcher(Resource): + """Network watcher in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.network.v2016_09_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, etag: str=None, **kwargs) -> None: + super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = etag + self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_parameters.py index 3e1478409a0a..54d8674c8884 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_parameters.py @@ -15,12 +15,14 @@ class NextHopParameters(Model): """Parameters that define the source and destination endpoint. - :param target_resource_id: The resource identifier of the target resource - against which the action is to be performed. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. :type target_resource_id: str - :param source_ip_address: The source IP address. + :param source_ip_address: Required. The source IP address. :type source_ip_address: str - :param destination_ip_address: The destination IP address. + :param destination_ip_address: Required. The destination IP address. :type destination_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be @@ -41,9 +43,9 @@ class NextHopParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, source_ip_address, destination_ip_address, target_nic_resource_id=None): - super(NextHopParameters, self).__init__() - self.target_resource_id = target_resource_id - self.source_ip_address = source_ip_address - self.destination_ip_address = destination_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.source_ip_address = kwargs.get('source_ip_address', None) + self.destination_ip_address = kwargs.get('destination_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_parameters_py3.py new file mode 100644 index 000000000000..50ee3d334e91 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_parameters_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopParameters(Model): + """Parameters that define the source and destination endpoint. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. + :type target_resource_id: str + :param source_ip_address: Required. The source IP address. + :type source_ip_address: str + :param destination_ip_address: Required. The destination IP address. + :type destination_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of the nics, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'source_ip_address': {'required': True}, + 'destination_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, + 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, source_ip_address: str, destination_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.source_ip_address = source_ip_address + self.destination_ip_address = destination_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_result.py index 645ae73c4519..4b75c6666fd1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_result.py @@ -35,8 +35,8 @@ class NextHopResult(Model): 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, } - def __init__(self, next_hop_type=None, next_hop_ip_address=None, route_table_id=None): - super(NextHopResult, self).__init__() - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.route_table_id = route_table_id + def __init__(self, **kwargs): + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.route_table_id = kwargs.get('route_table_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_result_py3.py new file mode 100644 index 000000000000..648de03fb284 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/next_hop_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopResult(Model): + """The information about next hop from the specified VM. + + :param next_hop_type: Next hop type. Possible values include: 'Internet', + 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', + 'HyperNetGateway', 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2016_09_01.models.NextHopType + :param next_hop_ip_address: Next hop IP Address + :type next_hop_ip_address: str + :param route_table_id: The resource identifier for the route table + associated with the route being returned. If the route being returned does + not correspond to any user created routes then this field will be the + string 'System Route'. + :type route_table_id: str + """ + + _attribute_map = { + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type=None, next_hop_ip_address: str=None, route_table_id: str=None, **kwargs) -> None: + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.route_table_id = route_table_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/outbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/outbound_nat_rule.py index e5cabaaa6703..8a24652c3571 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/outbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/outbound_nat_rule.py @@ -15,6 +15,8 @@ class OutboundNatRule(SubResource): """Outbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param allocated_outbound_ports: The number of outbound ports to be used @@ -24,8 +26,8 @@ class OutboundNatRule(SubResource): balancer. :type frontend_ip_configurations: list[~azure.mgmt.network.v2016_09_01.models.SubResource] - :param backend_address_pool: A reference to a pool of DIPs. Outbound - traffic is randomly load balanced across IPs in the backend IPs. + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. :type backend_address_pool: ~azure.mgmt.network.v2016_09_01.models.SubResource :param provisioning_state: Gets the provisioning state of the PublicIP @@ -53,11 +55,11 @@ class OutboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, backend_address_pool, id=None, allocated_outbound_ports=None, frontend_ip_configurations=None, provisioning_state=None, name=None, etag=None): - super(OutboundNatRule, self).__init__(id=id) - self.allocated_outbound_ports = allocated_outbound_ports - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pool = backend_address_pool - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(OutboundNatRule, self).__init__(**kwargs) + self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/outbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/outbound_nat_rule_py3.py new file mode 100644 index 000000000000..cb308af4ec8d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/outbound_nat_rule_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class OutboundNatRule(SubResource): + """Outbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param allocated_outbound_ports: The number of outbound ports to be used + for NAT. + :type allocated_outbound_ports: int + :param frontend_ip_configurations: The Frontend IP addresses of the load + balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2016_09_01.models.SubResource] + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_address_pool': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, backend_address_pool, id: str=None, allocated_outbound_ports: int=None, frontend_ip_configurations=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(OutboundNatRule, self).__init__(id=id, **kwargs) + self.allocated_outbound_ports = allocated_outbound_ports + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pool = backend_address_pool + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture.py index a940d3ff556f..ad244ec8a06f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture.py @@ -15,8 +15,10 @@ class PacketCapture(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCapture(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2016_09_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCapture(Model): 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCapture, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCapture, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_filter.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_filter.py index 4ea1e0bd05ad..fdb0405f9d1d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_filter.py @@ -51,10 +51,10 @@ class PacketCaptureFilter(Model): 'remote_port': {'key': 'remotePort', 'type': 'str'}, } - def __init__(self, protocol="Any", local_ip_address=None, remote_ip_address=None, local_port=None, remote_port=None): - super(PacketCaptureFilter, self).__init__() - self.protocol = protocol - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.local_port = local_port - self.remote_port = remote_port + def __init__(self, **kwargs): + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', "Any") + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_filter_py3.py new file mode 100644 index 000000000000..7f854c515840 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_filter_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureFilter(Model): + """Filter that is applied to packet capture request. Multiple filters can be + applied. + + :param protocol: Protocol to be filtered on. Possible values include: + 'TCP', 'UDP', 'Any'. Default value: "Any" . + :type protocol: str or ~azure.mgmt.network.v2016_09_01.models.PcProtocol + :param local_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type local_ip_address: str + :param remote_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type remote_ip_address: str + :param local_port: Local port to be filtered on. Notation: "80" for single + port entry."80-85" for range. "80;443;" for multiple entries. Multiple + ranges not currently supported. Mixing ranges with multiple entries not + currently supported. Default = null. + :type local_port: str + :param remote_port: Remote port to be filtered on. Notation: "80" for + single port entry."80-85" for range. "80;443;" for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple + entries not currently supported. Default = null. + :type remote_port: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + } + + def __init__(self, *, protocol="Any", local_ip_address: str=None, remote_ip_address: str=None, local_port: str=None, remote_port: str=None, **kwargs) -> None: + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = protocol + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.local_port = local_port + self.remote_port = remote_port diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_parameters.py index e643fc93902f..fa5910dee91a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_parameters.py @@ -15,8 +15,10 @@ class PacketCaptureParameters(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCaptureParameters(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2016_09_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCaptureParameters(Model): 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCaptureParameters, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_parameters_py3.py new file mode 100644 index 000000000000..89fc88c44e2d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_parameters_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureParameters(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2016_09_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2016_09_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_py3.py new file mode 100644 index 000000000000..336c4605db4a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCapture(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2016_09_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2016_09_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCapture, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_query_status_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_query_status_result.py index d0636567ae72..9c2f7967c189 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_query_status_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_query_status_result.py @@ -43,11 +43,11 @@ class PacketCaptureQueryStatusResult(Model): 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, } - def __init__(self, name=None, id=None, capture_start_time=None, packet_capture_status=None, stop_reason=None, packet_capture_error=None): - super(PacketCaptureQueryStatusResult, self).__init__() - self.name = name - self.id = id - self.capture_start_time = capture_start_time - self.packet_capture_status = packet_capture_status - self.stop_reason = stop_reason - self.packet_capture_error = packet_capture_error + def __init__(self, **kwargs): + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.capture_start_time = kwargs.get('capture_start_time', None) + self.packet_capture_status = kwargs.get('packet_capture_status', None) + self.stop_reason = kwargs.get('stop_reason', None) + self.packet_capture_error = kwargs.get('packet_capture_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_query_status_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_query_status_result_py3.py new file mode 100644 index 000000000000..24f16dd34d6f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_query_status_result_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureQueryStatusResult(Model): + """Status of packet capture session. + + :param name: The name of the packet capture resource. + :type name: str + :param id: The ID of the packet capture resource. + :type id: str + :param capture_start_time: The start time of the packet capture session. + :type capture_start_time: datetime + :param packet_capture_status: The status of the packet capture session. + Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', + 'Unknown' + :type packet_capture_status: str or + ~azure.mgmt.network.v2016_09_01.models.PcStatus + :param stop_reason: The reason the current packet capture session was + stopped. + :type stop_reason: str + :param packet_capture_error: List of errors of packet capture session. + :type packet_capture_error: list[str or + ~azure.mgmt.network.v2016_09_01.models.PcError] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, + 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, + 'stop_reason': {'key': 'stopReason', 'type': 'str'}, + 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, id: str=None, capture_start_time=None, packet_capture_status=None, stop_reason: str=None, packet_capture_error=None, **kwargs) -> None: + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = name + self.id = id + self.capture_start_time = capture_start_time + self.packet_capture_status = packet_capture_status + self.stop_reason = stop_reason + self.packet_capture_error = packet_capture_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_result.py index d4949f4636fc..214a301e929c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_result.py @@ -18,6 +18,8 @@ class PacketCaptureResult(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar name: Name of the packet capture session. :vartype name: str :ivar id: ID of the packet capture operation. @@ -25,8 +27,8 @@ class PacketCaptureResult(Model): :param etag: Default value: "A unique read-only string that changes whenever the resource is updated." . :type etag: str - :param target: The ID of the targeted resource, only VM is currently - supported. + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -37,7 +39,7 @@ class PacketCaptureResult(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2016_09_01.models.PacketCaptureStorageLocation :param filters: @@ -70,15 +72,15 @@ class PacketCaptureResult(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, target, storage_location, etag="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None, provisioning_state=None): - super(PacketCaptureResult, self).__init__() + def __init__(self, **kwargs): + super(PacketCaptureResult, self).__init__(**kwargs) self.name = None self.id = None - self.etag = etag - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters - self.provisioning_state = provisioning_state + self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_result_py3.py new file mode 100644 index 000000000000..5ece8faecc9b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_result_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureResult(Model): + """Information about packet capture session. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the packet capture session. + :vartype name: str + :ivar id: ID of the packet capture operation. + :vartype id: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2016_09_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2016_09_01.models.PacketCaptureFilter] + :param provisioning_state: The provisioning state of the packet capture + session. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2016_09_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, target: str, storage_location, etag: str="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, provisioning_state=None, **kwargs) -> None: + super(PacketCaptureResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = etag + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_storage_location.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_storage_location.py index 773b04d22501..62ed83d592b3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_storage_location.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_storage_location.py @@ -35,8 +35,8 @@ class PacketCaptureStorageLocation(Model): 'file_path': {'key': 'filePath', 'type': 'str'}, } - def __init__(self, storage_id=None, storage_path=None, file_path=None): - super(PacketCaptureStorageLocation, self).__init__() - self.storage_id = storage_id - self.storage_path = storage_path - self.file_path = file_path + def __init__(self, **kwargs): + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) + self.file_path = kwargs.get('file_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_storage_location_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_storage_location_py3.py new file mode 100644 index 000000000000..6925dd4f9bdf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_storage_location_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureStorageLocation(Model): + """Describes the storage location for a packet capture session. + + :param storage_id: The ID of the storage account to save the packet + capture session. Required if no local file path is provided. + :type storage_id: str + :param storage_path: The URI of the storage path to save the packet + capture. Must be a well-formed URI describing the location to save the + packet capture. + :type storage_path: str + :param file_path: A valid local path on the targeting VM. Must include the + name of the capture file (*.cap). For linux virtual machine it must start + with /var/captures. Required if no storage ID is provided, otherwise + optional. + :type file_path: str + """ + + _attribute_map = { + 'storage_id': {'key': 'storageId', 'type': 'str'}, + 'storage_path': {'key': 'storagePath', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + } + + def __init__(self, *, storage_id: str=None, storage_path: str=None, file_path: str=None, **kwargs) -> None: + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = storage_id + self.storage_path = storage_path + self.file_path = file_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/probe.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/probe.py index 02ccf61b3fd5..57cec47c5709 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/probe.py @@ -18,20 +18,22 @@ class Probe(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar load_balancing_rules: The load balancer rules that use this probe. :vartype load_balancing_rules: list[~azure.mgmt.network.v2016_09_01.models.SubResource] - :param protocol: The protocol of the end point. Possible values are: - 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the - probe to be successful. If 'Http' is specified, a 200 OK response from the - specifies URI is required for the probe to be successful. Possible values - include: 'Http', 'Tcp' + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2016_09_01.models.ProbeProtocol - :param port: The port for communicating the probe. Possible values range - from 1 to 65535, inclusive. + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. :type port: int :param interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is @@ -78,14 +80,14 @@ class Probe(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, port, id=None, interval_in_seconds=None, number_of_probes=None, request_path=None, provisioning_state=None, name=None, etag=None): - super(Probe, self).__init__(id=id) + def __init__(self, **kwargs): + super(Probe, self).__init__(**kwargs) self.load_balancing_rules = None - self.protocol = protocol - self.port = port - self.interval_in_seconds = interval_in_seconds - self.number_of_probes = number_of_probes - self.request_path = request_path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.port = kwargs.get('port', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.number_of_probes = kwargs.get('number_of_probes', None) + self.request_path = kwargs.get('request_path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/probe_py3.py new file mode 100644 index 000000000000..5cee98697b59 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Probe(SubResource): + """A load balancer probe. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar load_balancing_rules: The load balancer rules that use this probe. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2016_09_01.models.SubResource] + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2016_09_01.models.ProbeProtocol + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. + :type port: int + :param interval_in_seconds: The interval, in seconds, for how frequently + to probe the endpoint for health status. Typically, the interval is + slightly less than half the allocated timeout period (in seconds) which + allows two full probes before taking the instance out of rotation. The + default value is 15, the minimum value is 5. + :type interval_in_seconds: int + :param number_of_probes: The number of probes where if no response, will + result in stopping further traffic from being delivered to the endpoint. + This values allows endpoints to be taken out of rotation faster or slower + than the typical times used in Azure. + :type number_of_probes: int + :param request_path: The URI used for requesting health status from the + VM. Path is required if a protocol is set to http. Otherwise, it is not + allowed. There is no default value. + :type request_path: str + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'load_balancing_rules': {'readonly': True}, + 'protocol': {'required': True}, + 'port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, + 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, port: int, id: str=None, interval_in_seconds: int=None, number_of_probes: int=None, request_path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Probe, self).__init__(id=id, **kwargs) + self.load_balancing_rules = None + self.protocol = protocol + self.port = port + self.interval_in_seconds = interval_in_seconds + self.number_of_probes = number_of_probes + self.request_path = request_path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address.py index e6f10b685f31..39db09505fc7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address.py @@ -82,14 +82,14 @@ class PublicIPAddress(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address=None, idle_timeout_in_minutes=None, resource_guid=None, provisioning_state=None, etag=None): - super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags) - self.public_ip_allocation_method = public_ip_allocation_method - self.public_ip_address_version = public_ip_address_version + def __init__(self, **kwargs): + super(PublicIPAddress, self).__init__(**kwargs) + self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) + self.public_ip_address_version = kwargs.get('public_ip_address_version', None) self.ip_configuration = None - self.dns_settings = dns_settings - self.ip_address = ip_address - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_address = kwargs.get('ip_address', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address_dns_settings.py index a248461f05d7..07dfe30433a6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address_dns_settings.py @@ -38,8 +38,8 @@ class PublicIPAddressDnsSettings(Model): 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, } - def __init__(self, domain_name_label=None, fqdn=None, reverse_fqdn=None): - super(PublicIPAddressDnsSettings, self).__init__() - self.domain_name_label = domain_name_label - self.fqdn = fqdn - self.reverse_fqdn = reverse_fqdn + def __init__(self, **kwargs): + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) + self.fqdn = kwargs.get('fqdn', None) + self.reverse_fqdn = kwargs.get('reverse_fqdn', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address_dns_settings_py3.py new file mode 100644 index 000000000000..e84aa9c10bf5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address_dns_settings_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressDnsSettings(Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :param domain_name_label: Gets or sets the Domain name label.The + concatenation of the domain name label and the regionalized DNS zone make + up the fully qualified domain name associated with the public IP address. + If a domain name label is specified, an A DNS record is created for the + public IP in the Microsoft Azure DNS system. + :type domain_name_label: str + :param fqdn: Gets the FQDN, Fully qualified domain name of the A DNS + record associated with the public IP. This is the concatenation of the + domainNameLabel and the regionalized DNS zone. + :type fqdn: str + :param reverse_fqdn: Gets or Sets the Reverse FQDN. A user-visible, fully + qualified domain name that resolves to this public IP address. If the + reverseFqdn is specified, then a PTR DNS record is created pointing from + the IP address in the in-addr.arpa domain to the reverse FQDN. + :type reverse_fqdn: str + """ + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, + } + + def __init__(self, *, domain_name_label: str=None, fqdn: str=None, reverse_fqdn: str=None, **kwargs) -> None: + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label + self.fqdn = fqdn + self.reverse_fqdn = reverse_fqdn diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address_py3.py new file mode 100644 index 000000000000..354ed2b11e95 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/public_ip_address_py3.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PublicIPAddress(Resource): + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param public_ip_allocation_method: The public IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type public_ip_allocation_method: str or + ~azure.mgmt.network.v2016_09_01.models.IPAllocationMethod + :param public_ip_address_version: The public IP address version. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + :type public_ip_address_version: str or + ~azure.mgmt.network.v2016_09_01.models.IPVersion + :ivar ip_configuration: + :vartype ip_configuration: + ~azure.mgmt.network.v2016_09_01.models.IPConfiguration + :param dns_settings: The FQDN of the DNS record associated with the public + IP address. + :type dns_settings: + ~azure.mgmt.network.v2016_09_01.models.PublicIPAddressDnsSettings + :param ip_address: + :type ip_address: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param resource_guid: The resource GUID property of the public IP + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address: str=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.public_ip_allocation_method = public_ip_allocation_method + self.public_ip_address_version = public_ip_address_version + self.ip_configuration = None + self.dns_settings = dns_settings + self.ip_address = ip_address + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/query_troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/query_troubleshooting_parameters.py index 9b6801eb7b63..6ae1924916c6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/query_troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/query_troubleshooting_parameters.py @@ -15,7 +15,9 @@ class QueryTroubleshootingParameters(Model): """Parameters that define the resource to query the troubleshooting result. - :param target_resource_id: The target resource ID to query the + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the troubleshooting result. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class QueryTroubleshootingParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(QueryTroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/query_troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/query_troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..b5fccb87857c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/query_troubleshooting_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryTroubleshootingParameters(Model): + """Parameters that define the resource to query the troubleshooting result. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the + troubleshooting result. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource.py index 5dfb000318bf..b12801be9996 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource.py @@ -43,10 +43,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, location=None, tags=None): - super(Resource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource_navigation_link.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource_navigation_link.py index 9b4484be654a..705698f513f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource_navigation_link.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource_navigation_link.py @@ -49,10 +49,10 @@ class ResourceNavigationLink(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, linked_resource_type=None, link=None, name=None): - super(ResourceNavigationLink, self).__init__(id=id) - self.linked_resource_type = linked_resource_type - self.link = link + def __init__(self, **kwargs): + super(ResourceNavigationLink, self).__init__(**kwargs) + self.linked_resource_type = kwargs.get('linked_resource_type', None) + self.link = kwargs.get('link', None) self.provisioning_state = None - self.name = name + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource_navigation_link_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource_navigation_link_py3.py new file mode 100644 index 000000000000..5cb22d347836 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource_navigation_link_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ResourceNavigationLink(SubResource): + """ResourceNavigationLink resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource + :type link: str + :ivar provisioning_state: Provisioning state of the ResourceNavigationLink + resource. + :vartype provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, linked_resource_type: str=None, link: str=None, name: str=None, **kwargs) -> None: + super(ResourceNavigationLink, self).__init__(id=id, **kwargs) + self.linked_resource_type = linked_resource_type + self.link = link + self.provisioning_state = None + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource_py3.py new file mode 100644 index 000000000000..0678b03d46f5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/resource_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/retention_policy_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/retention_policy_parameters.py index 102f4c5c3b4c..28cb43056d47 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/retention_policy_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/retention_policy_parameters.py @@ -26,7 +26,7 @@ class RetentionPolicyParameters(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, days=0, enabled=False): - super(RetentionPolicyParameters, self).__init__() - self.days = days - self.enabled = enabled + def __init__(self, **kwargs): + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = kwargs.get('days', 0) + self.enabled = kwargs.get('enabled', False) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/retention_policy_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/retention_policy_parameters_py3.py new file mode 100644 index 000000000000..3b2ffc5e741e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/retention_policy_parameters_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RetentionPolicyParameters(Model): + """Parameters that define the retention policy for flow log. + + :param days: Number of days to retain flow log records. Default value: 0 . + :type days: int + :param enabled: Flag to enable/disable retention. Default value: False . + :type enabled: bool + """ + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, days: int=0, enabled: bool=False, **kwargs) -> None: + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = days + self.enabled = enabled diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route.py index f792b8a26e17..e13d844cb058 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route.py @@ -15,13 +15,15 @@ class Route(SubResource): """Route resource. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param address_prefix: The destination CIDR to which the route applies. :type address_prefix: str - :param next_hop_type: The type of Azure hop the packet should be sent to. - Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - 'VirtualAppliance', and 'None'. Possible values include: + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' :type next_hop_type: str or @@ -55,11 +57,11 @@ class Route(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, next_hop_type, id=None, address_prefix=None, next_hop_ip_address=None, provisioning_state=None, name=None, etag=None): - super(Route, self).__init__(id=id) - self.address_prefix = address_prefix - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(Route, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route_py3.py new file mode 100644 index 000000000000..3efc08b400f2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Route(SubResource): + """Route resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param address_prefix: The destination CIDR to which the route applies. + :type address_prefix: str + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2016_09_01.models.RouteNextHopType + :param next_hop_ip_address: The IP address packets should be forwarded to. + Next hop values are only allowed in routes where the next hop type is + VirtualAppliance. + :type next_hop_ip_address: str + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'next_hop_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type, id: str=None, address_prefix: str=None, next_hop_ip_address: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Route, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route_table.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route_table.py index 9e5e0a0dcc66..56f7bcb2b068 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route_table.py @@ -58,9 +58,9 @@ class RouteTable(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, routes=None, provisioning_state=None, etag=None): - super(RouteTable, self).__init__(id=id, location=location, tags=tags) - self.routes = routes + def __init__(self, **kwargs): + super(RouteTable, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) self.subnets = None - self.provisioning_state = provisioning_state - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route_table_py3.py new file mode 100644 index 000000000000..2b36d6d26920 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/route_table_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteTable(Resource): + """Route table resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param routes: Collection of routes contained within a route table. + :type routes: list[~azure.mgmt.network.v2016_09_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2016_09_01.models.Subnet] + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'routes': {'key': 'properties.routes', 'type': '[Route]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, routes=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(RouteTable, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.routes = routes + self.subnets = None + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_network_interface.py index e00822ea9856..d0209adfd7d9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_network_interface.py @@ -27,7 +27,7 @@ class SecurityGroupNetworkInterface(Model): 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, } - def __init__(self, id=None, security_rule_associations=None): - super(SecurityGroupNetworkInterface, self).__init__() - self.id = id - self.security_rule_associations = security_rule_associations + def __init__(self, **kwargs): + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.security_rule_associations = kwargs.get('security_rule_associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_network_interface_py3.py new file mode 100644 index 000000000000..a1d5a07e71a4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_network_interface_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupNetworkInterface(Model): + """Network interface and all its associated security rules. + + :param id: ID of the network interface. + :type id: str + :param security_rule_associations: + :type security_rule_associations: + ~azure.mgmt.network.v2016_09_01.models.SecurityRuleAssociations + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, + } + + def __init__(self, *, id: str=None, security_rule_associations=None, **kwargs) -> None: + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = id + self.security_rule_associations = security_rule_associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_parameters.py index 5c0972e5d55e..1d547b0b0e2b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_parameters.py @@ -15,7 +15,9 @@ class SecurityGroupViewParameters(Model): """Parameters that define the VM to check security groups for. - :param target_resource_id: ID of the target VM. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. :type target_resource_id: str """ @@ -27,6 +29,6 @@ class SecurityGroupViewParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(SecurityGroupViewParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_parameters_py3.py new file mode 100644 index 000000000000..7ccc48017444 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_parameters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewParameters(Model): + """Parameters that define the VM to check security groups for. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_result.py index 52c1cc83015c..2e14f63dc9e6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_result.py @@ -24,6 +24,6 @@ class SecurityGroupViewResult(Model): 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, } - def __init__(self, network_interfaces=None): - super(SecurityGroupViewResult, self).__init__() - self.network_interfaces = network_interfaces + def __init__(self, **kwargs): + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_result_py3.py new file mode 100644 index 000000000000..94709ec8b0b5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_group_view_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewResult(Model): + """The information about security rules applied to the specified VM. + + :param network_interfaces: List of network interfaces on the specified VM. + :type network_interfaces: + list[~azure.mgmt.network.v2016_09_01.models.SecurityGroupNetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule.py index 3afd639b6054..4819068cebaf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule.py @@ -15,12 +15,15 @@ class SecurityRule(SubResource): """Network security rule. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param description: A description for this rule. Restricted to 140 chars. :type description: str - :param protocol: Network protocol this rule applies to. Possible values - are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*' + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' :type protocol: str or ~azure.mgmt.network.v2016_09_01.models.SecurityRuleProtocol :param source_port_range: The source port or range. Integer or range @@ -30,18 +33,19 @@ class SecurityRule(SubResource): range between 0 and 65535. Asterix '*' can also be used to match all ports. :type destination_port_range: str - :param source_address_prefix: The CIDR or source IP range. Asterix '*' can - also be used to match all source IPs. Default tags such as + :param source_address_prefix: Required. The CIDR or source IP range. + Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. :type source_address_prefix: str - :param destination_address_prefix: The destination address prefix. CIDR or - source IP range. Asterix '*' can also be used to match all source IPs. - Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - can also be used. + :param destination_address_prefix: Required. The destination address + prefix. CIDR or source IP range. Asterix '*' can also be used to match all + source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. :type destination_address_prefix: str - :param access: The network traffic is allowed or denied. Possible values - are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' :type access: str or ~azure.mgmt.network.v2016_09_01.models.SecurityRuleAccess :param priority: The priority of the rule. The value can be between 100 @@ -49,10 +53,10 @@ class SecurityRule(SubResource): collection. The lower the priority number, the higher the priority of the rule. :type priority: int - :param direction: The direction of the rule. The direction specifies if - rule will be evaluated on incoming or outcoming traffic. Possible values - are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', - 'Outbound' + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2016_09_01.models.SecurityRuleDirection :param provisioning_state: The provisioning state of the public IP @@ -90,17 +94,17 @@ class SecurityRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, source_address_prefix, destination_address_prefix, access, direction, id=None, description=None, source_port_range=None, destination_port_range=None, priority=None, provisioning_state=None, name=None, etag=None): - super(SecurityRule, self).__init__(id=id) - self.description = description - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_address_prefix = source_address_prefix - self.destination_address_prefix = destination_address_prefix - self.access = access - self.priority = priority - self.direction = direction - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(SecurityRule, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule_associations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule_associations.py index 3b4647d5ee03..778c1e9f8900 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule_associations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule_associations.py @@ -37,9 +37,9 @@ class SecurityRuleAssociations(Model): 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, } - def __init__(self, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None): - super(SecurityRuleAssociations, self).__init__() - self.network_interface_association = network_interface_association - self.subnet_association = subnet_association - self.default_security_rules = default_security_rules - self.effective_security_rules = effective_security_rules + def __init__(self, **kwargs): + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = kwargs.get('network_interface_association', None) + self.subnet_association = kwargs.get('subnet_association', None) + self.default_security_rules = kwargs.get('default_security_rules', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule_associations_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule_associations_py3.py new file mode 100644 index 000000000000..2632b1c65dc1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule_associations_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityRuleAssociations(Model): + """All security rules associated with the network interface. + + :param network_interface_association: + :type network_interface_association: + ~azure.mgmt.network.v2016_09_01.models.NetworkInterfaceAssociation + :param subnet_association: + :type subnet_association: + ~azure.mgmt.network.v2016_09_01.models.SubnetAssociation + :param default_security_rules: Collection of default security rules of the + network security group. + :type default_security_rules: + list[~azure.mgmt.network.v2016_09_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2016_09_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, + 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, + 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__(self, *, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None, **kwargs) -> None: + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = network_interface_association + self.subnet_association = subnet_association + self.default_security_rules = default_security_rules + self.effective_security_rules = effective_security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule_py3.py new file mode 100644 index 000000000000..eaded5daca6f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/security_rule_py3.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class SecurityRule(SubResource): + """Network security rule. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2016_09_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. Integer or range + between 0 and 65535. Asterix '*' can also be used to match all ports. + :type source_port_range: str + :param destination_port_range: The destination port or range. Integer or + range between 0 and 65535. Asterix '*' can also be used to match all + ports. + :type destination_port_range: str + :param source_address_prefix: Required. The CIDR or source IP range. + Asterix '*' can also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + this is an ingress rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param destination_address_prefix: Required. The destination address + prefix. CIDR or source IP range. Asterix '*' can also be used to match all + source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. + :type destination_address_prefix: str + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' + :type access: str or + ~azure.mgmt.network.v2016_09_01.models.SecurityRuleAccess + :param priority: The priority of the rule. The value can be between 100 + and 4096. The priority number must be unique for each rule in the + collection. The lower the priority number, the higher the priority of the + rule. + :type priority: int + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2016_09_01.models.SecurityRuleDirection + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'source_address_prefix': {'required': True}, + 'destination_address_prefix': {'required': True}, + 'access': {'required': True}, + 'direction': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, source_address_prefix: str, destination_address_prefix: str, access, direction, id: str=None, description: str=None, source_port_range: str=None, destination_port_range: str=None, priority: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(SecurityRule, self).__init__(id=id, **kwargs) + self.description = description + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/sub_resource.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/sub_resource.py index d4a564864add..3210cb8c9187 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/sub_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/sub_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/sub_resource_py3.py new file mode 100644 index 000000000000..25ef1e7dc9a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """SubResource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet.py index 50ed057f80f1..28037dec82d4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet.py @@ -62,13 +62,13 @@ class Subnet(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, address_prefix=None, network_security_group=None, route_table=None, resource_navigation_links=None, provisioning_state=None, name=None, etag=None): - super(Subnet, self).__init__(id=id) - self.address_prefix = address_prefix - self.network_security_group = network_security_group - self.route_table = route_table + def __init__(self, **kwargs): + super(Subnet, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.route_table = kwargs.get('route_table', None) self.ip_configurations = None - self.resource_navigation_links = resource_navigation_links - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.resource_navigation_links = kwargs.get('resource_navigation_links', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet_association.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet_association.py index 167903071a1f..d7a43ee00ac3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet_association.py @@ -34,7 +34,7 @@ class SubnetAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(SubnetAssociation, self).__init__() + def __init__(self, **kwargs): + super(SubnetAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet_association_py3.py new file mode 100644 index 000000000000..001562de1ae2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Subnet ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2016_09_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(SubnetAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet_py3.py new file mode 100644 index 000000000000..9e80621eb2b3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/subnet_py3.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Subnet(SubResource): + """Subnet in a virtual network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param address_prefix: The address prefix for the subnet. + :type address_prefix: str + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2016_09_01.models.NetworkSecurityGroup + :param route_table: The reference of the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2016_09_01.models.RouteTable + :ivar ip_configurations: Gets an array of references to the network + interface IP configurations using subnet. + :vartype ip_configurations: + list[~azure.mgmt.network.v2016_09_01.models.IPConfiguration] + :param resource_navigation_links: Gets an array of references to the + external resources using subnet. + :type resource_navigation_links: + list[~azure.mgmt.network.v2016_09_01.models.ResourceNavigationLink] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'ip_configurations': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, + 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, address_prefix: str=None, network_security_group=None, route_table=None, resource_navigation_links=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Subnet, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.network_security_group = network_security_group + self.route_table = route_table + self.ip_configurations = None + self.resource_navigation_links = resource_navigation_links + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology.py index 832ddf22919b..b71feaf05ed8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology.py @@ -43,9 +43,9 @@ class Topology(Model): 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, } - def __init__(self, resources=None): - super(Topology, self).__init__() + def __init__(self, **kwargs): + super(Topology, self).__init__(**kwargs) self.id = None self.created_date_time = None self.last_modified = None - self.resources = resources + self.resources = kwargs.get('resources', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_association.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_association.py index 0a5739195e06..7f66378ca106 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_association.py @@ -33,8 +33,8 @@ class TopologyAssociation(Model): 'association_type': {'key': 'associationType', 'type': 'str'}, } - def __init__(self, name=None, resource_id=None, association_type=None): - super(TopologyAssociation, self).__init__() - self.name = name - self.resource_id = resource_id - self.association_type = association_type + def __init__(self, **kwargs): + super(TopologyAssociation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.resource_id = kwargs.get('resource_id', None) + self.association_type = kwargs.get('association_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_association_py3.py new file mode 100644 index 000000000000..50d2d131c062 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyAssociation(Model): + """Resources that have an association with the parent resource. + + :param name: The name of the resource that is associated with the parent + resource. + :type name: str + :param resource_id: The ID of the resource that is associated with the + parent resource. + :type resource_id: str + :param association_type: The association type of the child resource to the + parent resource. Possible values include: 'Associated', 'Contains' + :type association_type: str or + ~azure.mgmt.network.v2016_09_01.models.AssociationType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'association_type': {'key': 'associationType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, resource_id: str=None, association_type=None, **kwargs) -> None: + super(TopologyAssociation, self).__init__(**kwargs) + self.name = name + self.resource_id = resource_id + self.association_type = association_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_parameters.py index 04920dc9665d..c7065ef57c09 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_parameters.py @@ -15,8 +15,10 @@ class TopologyParameters(Model): """Parameters that define the representation of topology. - :param target_resource_group_name: The name of the target resource group - to perform topology on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_group_name: Required. The name of the target + resource group to perform topology on. :type target_resource_group_name: str """ @@ -28,6 +30,6 @@ class TopologyParameters(Model): 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, } - def __init__(self, target_resource_group_name): - super(TopologyParameters, self).__init__() - self.target_resource_group_name = target_resource_group_name + def __init__(self, **kwargs): + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = kwargs.get('target_resource_group_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_parameters_py3.py new file mode 100644 index 000000000000..90c2365d8dba --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyParameters(Model): + """Parameters that define the representation of topology. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group_name: Required. The name of the target + resource group to perform topology on. + :type target_resource_group_name: str + """ + + _validation = { + 'target_resource_group_name': {'required': True}, + } + + _attribute_map = { + 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, + } + + def __init__(self, *, target_resource_group_name: str, **kwargs) -> None: + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = target_resource_group_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_py3.py new file mode 100644 index 000000000000..8a16e00ab30a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Topology(Model): + """Topology of the specified resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: GUID representing the operation id. + :vartype id: str + :ivar created_date_time: The datetime when the topology was initially + created for the resource group. + :vartype created_date_time: datetime + :ivar last_modified: The datetime when the topology was last modified. + :vartype last_modified: datetime + :param resources: + :type resources: + list[~azure.mgmt.network.v2016_09_01.models.TopologyResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, + } + + def __init__(self, *, resources=None, **kwargs) -> None: + super(Topology, self).__init__(**kwargs) + self.id = None + self.created_date_time = None + self.last_modified = None + self.resources = resources diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_resource.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_resource.py index b9f2d8fb25f5..81de6d857761 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_resource.py @@ -34,9 +34,9 @@ class TopologyResource(Model): 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, } - def __init__(self, name=None, id=None, location=None, associations=None): - super(TopologyResource, self).__init__() - self.name = name - self.id = id - self.location = location - self.associations = associations + def __init__(self, **kwargs): + super(TopologyResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.associations = kwargs.get('associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_resource_py3.py new file mode 100644 index 000000000000..861b2f6c012c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/topology_resource_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyResource(Model): + """The network resource topology information for the given resource group. + + :param name: Name of the resource. + :type name: str + :param id: ID of the resource. + :type id: str + :param location: Resource location. + :type location: str + :param associations: Holds the associations the resource has with other + resources in the resource group. + :type associations: + list[~azure.mgmt.network.v2016_09_01.models.TopologyAssociation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, + } + + def __init__(self, *, name: str=None, id: str=None, location: str=None, associations=None, **kwargs) -> None: + super(TopologyResource, self).__init__(**kwargs) + self.name = name + self.id = id + self.location = location + self.associations = associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_details.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_details.py index ef6f5487fa6e..7de588e3354a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_details.py @@ -36,10 +36,10 @@ class TroubleshootingDetails(Model): 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, } - def __init__(self, id=None, reason_type=None, summary=None, detail=None, recommended_actions=None): - super(TroubleshootingDetails, self).__init__() - self.id = id - self.reason_type = reason_type - self.summary = summary - self.detail = detail - self.recommended_actions = recommended_actions + def __init__(self, **kwargs): + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.reason_type = kwargs.get('reason_type', None) + self.summary = kwargs.get('summary', None) + self.detail = kwargs.get('detail', None) + self.recommended_actions = kwargs.get('recommended_actions', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_details_py3.py new file mode 100644 index 000000000000..25e7ef426477 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_details_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingDetails(Model): + """Information gained from troubleshooting of specified resource. + + :param id: The id of the get troubleshoot operation. + :type id: str + :param reason_type: Reason type of failure. + :type reason_type: str + :param summary: A summary of troubleshooting. + :type summary: str + :param detail: Details on troubleshooting results. + :type detail: str + :param recommended_actions: List of recommended actions. + :type recommended_actions: + list[~azure.mgmt.network.v2016_09_01.models.TroubleshootingRecommendedActions] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'reason_type': {'key': 'reasonType', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'detail': {'key': 'detail', 'type': 'str'}, + 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, + } + + def __init__(self, *, id: str=None, reason_type: str=None, summary: str=None, detail: str=None, recommended_actions=None, **kwargs) -> None: + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = id + self.reason_type = reason_type + self.summary = summary + self.detail = detail + self.recommended_actions = recommended_actions diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_parameters.py index c4833fb8eeb3..6b11d3eb5ffc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_parameters.py @@ -15,13 +15,15 @@ class TroubleshootingParameters(Model): """Parameters that define the resource to troubleshoot. - :param target_resource_id: The target resource to troubleshoot. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. :type target_resource_id: str - :param storage_id: The ID for the storage account to save the troubleshoot - result. + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. :type storage_id: str - :param storage_path: The path to the blob to save the troubleshoot result - in. + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. :type storage_path: str """ @@ -37,8 +39,8 @@ class TroubleshootingParameters(Model): 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, } - def __init__(self, target_resource_id, storage_id, storage_path): - super(TroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.storage_path = storage_path + def __init__(self, **kwargs): + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..e010b7bdc9de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_parameters_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingParameters(Model): + """Parameters that define the resource to troubleshoot. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. + :type target_resource_id: str + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. + :type storage_id: str + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. + :type storage_path: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'storage_path': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, storage_path: str, **kwargs) -> None: + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.storage_path = storage_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_recommended_actions.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_recommended_actions.py index cbc5e31177c7..be395be4ad54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_recommended_actions.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_recommended_actions.py @@ -34,9 +34,9 @@ class TroubleshootingRecommendedActions(Model): 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, } - def __init__(self, action_id=None, action_text=None, action_uri=None, action_uri_text=None): - super(TroubleshootingRecommendedActions, self).__init__() - self.action_id = action_id - self.action_text = action_text - self.action_uri = action_uri - self.action_uri_text = action_uri_text + def __init__(self, **kwargs): + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = kwargs.get('action_id', None) + self.action_text = kwargs.get('action_text', None) + self.action_uri = kwargs.get('action_uri', None) + self.action_uri_text = kwargs.get('action_uri_text', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_recommended_actions_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_recommended_actions_py3.py new file mode 100644 index 000000000000..05c3f654353b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_recommended_actions_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingRecommendedActions(Model): + """Recommended actions based on discovered issues. + + :param action_id: ID of the recommended action. + :type action_id: str + :param action_text: Description of recommended actions. + :type action_text: str + :param action_uri: The uri linking to a documentation for the recommended + troubleshooting actions. + :type action_uri: str + :param action_uri_text: The information from the URI for the recommended + troubleshooting actions. + :type action_uri_text: str + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'action_text': {'key': 'actionText', 'type': 'str'}, + 'action_uri': {'key': 'actionUri', 'type': 'str'}, + 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, + } + + def __init__(self, *, action_id: str=None, action_text: str=None, action_uri: str=None, action_uri_text: str=None, **kwargs) -> None: + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = action_id + self.action_text = action_text + self.action_uri = action_uri + self.action_uri_text = action_uri_text diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_result.py index 62625db5e184..b561f18d4d53 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_result.py @@ -33,9 +33,9 @@ class TroubleshootingResult(Model): 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, } - def __init__(self, start_time=None, end_time=None, code=None, results=None): - super(TroubleshootingResult, self).__init__() - self.start_time = start_time - self.end_time = end_time - self.code = code - self.results = results + def __init__(self, **kwargs): + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.code = kwargs.get('code', None) + self.results = kwargs.get('results', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_result_py3.py new file mode 100644 index 000000000000..8c1e6280375b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/troubleshooting_result_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingResult(Model): + """Troubleshooting information gained from specified resource. + + :param start_time: The start time of the troubleshooting. + :type start_time: datetime + :param end_time: The end time of the troubleshooting. + :type end_time: datetime + :param code: The result code of the troubleshooting. + :type code: str + :param results: Information from troubleshooting. + :type results: + list[~azure.mgmt.network.v2016_09_01.models.TroubleshootingDetails] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, + } + + def __init__(self, *, start_time=None, end_time=None, code: str=None, results=None, **kwargs) -> None: + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.code = code + self.results = results diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/tunnel_connection_health.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/tunnel_connection_health.py index c5fd3f94d6dd..6508cb7e5179 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/tunnel_connection_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/tunnel_connection_health.py @@ -52,8 +52,8 @@ class TunnelConnectionHealth(Model): 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, } - def __init__(self): - super(TunnelConnectionHealth, self).__init__() + def __init__(self, **kwargs): + super(TunnelConnectionHealth, self).__init__(**kwargs) self.tunnel = None self.connection_status = None self.ingress_bytes_transferred = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/tunnel_connection_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/tunnel_connection_health_py3.py new file mode 100644 index 000000000000..b339c26677b5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/tunnel_connection_health_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TunnelConnectionHealth(Model): + """VirtualNetworkGatewayConnection properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tunnel: Tunnel name. + :vartype tunnel: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values include: 'Unknown', 'Connecting', 'Connected', + 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayConnectionStatus + :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this + connection + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: The Egress Bytes Transferred in this + connection + :vartype egress_bytes_transferred: long + :ivar last_connection_established_utc_time: The time at which connection + was established in Utc format. + :vartype last_connection_established_utc_time: str + """ + + _validation = { + 'tunnel': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'last_connection_established_utc_time': {'readonly': True}, + } + + _attribute_map = { + 'tunnel': {'key': 'tunnel', 'type': 'str'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TunnelConnectionHealth, self).__init__(**kwargs) + self.tunnel = None + self.connection_status = None + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.last_connection_established_utc_time = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage.py index 48067220a610..ddec46224466 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage.py @@ -18,14 +18,16 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar unit: An enum describing the unit of measurement. Default value: - "Count" . + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . :vartype unit: str - :param current_value: The current value of the usage. + :param current_value: Required. The current value of the usage. :type current_value: long - :param limit: The limit of usage. + :param limit: Required. The limit of usage. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.network.v2016_09_01.models.UsageName """ @@ -45,8 +47,8 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() - self.current_value = current_value - self.limit = limit - self.name = name + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage_name.py index df7f344bfb9b..bd1813944fdc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage_name_py3.py new file mode 100644 index 000000000000..4e5e3e10de15 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage_py3.py new file mode 100644 index 000000000000..65f8530df4b3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes network resource usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . + :vartype unit: str + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.network.v2016_09_01.models.UsageName + """ + + _validation = { + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_parameters.py index 18b4363a4f2c..d5aa02a49273 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_parameters.py @@ -15,28 +15,30 @@ class VerificationIPFlowParameters(Model): """Parameters that define the IP flow to be verified. - :param target_resource_id: The ID of the target resource to perform - next-hop on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. :type target_resource_id: str - :param direction: The direction of the packet represented as a 5-tuple. - Possible values include: 'Inbound', 'Outbound' + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2016_09_01.models.Direction - :param protocol: Protocol to be verified on. Possible values include: - 'TCP', 'UDP' + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' :type protocol: str or ~azure.mgmt.network.v2016_09_01.models.Protocol - :param local_port: The local port. Acceptable values are a single integer - in the range (0-65535). Support for * for the source port, which depends - on the direction. + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type local_port: str - :param remote_port: The remote port. Acceptable values are a single - integer in the range (0-65535). Support for * for the source port, which - depends on the direction. + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type remote_port: str - :param local_ip_address: The local IP address. Acceptable values are valid - IPv4 addresses. + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. :type local_ip_address: str - :param remote_ip_address: The remote IP address. Acceptable values are - valid IPv4 addresses. + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. :type remote_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be @@ -65,13 +67,13 @@ class VerificationIPFlowParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, direction, protocol, local_port, remote_port, local_ip_address, remote_ip_address, target_nic_resource_id=None): - super(VerificationIPFlowParameters, self).__init__() - self.target_resource_id = target_resource_id - self.direction = direction - self.protocol = protocol - self.local_port = local_port - self.remote_port = remote_port - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.direction = kwargs.get('direction', None) + self.protocol = kwargs.get('protocol', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_parameters_py3.py new file mode 100644 index 000000000000..5d0cad5cd12f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_parameters_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowParameters(Model): + """Parameters that define the IP flow to be verified. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. + :type target_resource_id: str + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' + :type direction: str or ~azure.mgmt.network.v2016_09_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' + :type protocol: str or ~azure.mgmt.network.v2016_09_01.models.Protocol + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type local_port: str + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type remote_port: str + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. + :type local_ip_address: str + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. + :type remote_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of them, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'local_port': {'required': True}, + 'remote_port': {'required': True}, + 'local_ip_address': {'required': True}, + 'remote_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, direction, protocol, local_port: str, remote_port: str, local_ip_address: str, remote_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.direction = direction + self.protocol = protocol + self.local_port = local_port + self.remote_port = remote_port + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_result.py index 246a7c1b37f2..e6bb15e14307 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_result.py @@ -28,7 +28,7 @@ class VerificationIPFlowResult(Model): 'rule_name': {'key': 'ruleName', 'type': 'str'}, } - def __init__(self, access=None, rule_name=None): - super(VerificationIPFlowResult, self).__init__() - self.access = access - self.rule_name = rule_name + def __init__(self, **kwargs): + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.rule_name = kwargs.get('rule_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_result_py3.py new file mode 100644 index 000000000000..fc43a64e37c7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/verification_ip_flow_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowResult(Model): + """Results of IP flow verification on the target resource. + + :param access: Indicates whether the traffic is allowed or denied. + Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2016_09_01.models.Access + :param rule_name: Name of the rule. If input is not matched against any + security rule, it is not displayed. + :type rule_name: str + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + } + + def __init__(self, *, access=None, rule_name: str=None, **kwargs) -> None: + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = access + self.rule_name = rule_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network.py index f72427b5389f..1a0f5f23dfd3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network.py @@ -70,12 +70,12 @@ class VirtualNetwork(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid=None, provisioning_state=None, etag=None): - super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags) - self.address_space = address_space - self.dhcp_options = dhcp_options - self.subnets = subnets - self.virtual_network_peerings = virtual_network_peerings - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetwork, self).__init__(**kwargs) + self.address_space = kwargs.get('address_space', None) + self.dhcp_options = kwargs.get('dhcp_options', None) + self.subnets = kwargs.get('subnets', None) + self.virtual_network_peerings = kwargs.get('virtual_network_peerings', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway.py index 93ba2087a90d..5734461ec52b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway.py @@ -18,6 +18,8 @@ class VirtualNetworkGateway(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -28,17 +30,18 @@ class VirtualNetworkGateway(Resource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :param ip_configurations: IP configurations for virtual network gateway. + :param ip_configurations: Required. IP configurations for virtual network + gateway. :type ip_configurations: list[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayIPConfiguration] - :param gateway_type: The type of this virtual network gateway. Possible - values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', - 'ExpressRoute' + :param gateway_type: Required. The type of this virtual network gateway. + Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: + 'Vpn', 'ExpressRoute' :type gateway_type: str or ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayType - :param vpn_type: The type of this virtual network gateway. Possible values - are: 'PolicyBased' and 'RouteBased'. Possible values include: - 'PolicyBased', 'RouteBased' + :param vpn_type: Required. The type of this virtual network gateway. + Possible values are: 'PolicyBased' and 'RouteBased'. Possible values + include: 'PolicyBased', 'RouteBased' :type vpn_type: str or ~azure.mgmt.network.v2016_09_01.models.VpnType :param enable_bgp: Whether BGP is enabled for this virtual network gateway or not. @@ -101,17 +104,17 @@ class VirtualNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, ip_configurations, gateway_type, vpn_type, id=None, location=None, tags=None, enable_bgp=None, active_active=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid=None, etag=None): - super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.ip_configurations = ip_configurations - self.gateway_type = gateway_type - self.vpn_type = vpn_type - self.enable_bgp = enable_bgp - self.active_active = active_active - self.gateway_default_site = gateway_default_site - self.sku = sku - self.vpn_client_configuration = vpn_client_configuration - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(VirtualNetworkGateway, self).__init__(**kwargs) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.gateway_type = kwargs.get('gateway_type', None) + self.vpn_type = kwargs.get('vpn_type', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.active_active = kwargs.get('active_active', None) + self.gateway_default_site = kwargs.get('gateway_default_site', None) + self.sku = kwargs.get('sku', None) + self.vpn_client_configuration = kwargs.get('vpn_client_configuration', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_connection.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_connection.py index eafc299d2454..30473aa18182 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_connection.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_connection.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayConnection(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -30,7 +32,7 @@ class VirtualNetworkGatewayConnection(Resource): :type tags: dict[str, str] :param authorization_key: The authorizationKey. :type authorization_key: str - :param virtual_network_gateway1: + :param virtual_network_gateway1: Required. :type virtual_network_gateway1: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway :param virtual_network_gateway2: @@ -39,8 +41,8 @@ class VirtualNetworkGatewayConnection(Resource): :param local_network_gateway2: :type local_network_gateway2: ~azure.mgmt.network.v2016_09_01.models.LocalNetworkGateway - :param connection_type: Gateway connection type. Possible values are: - 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' :type connection_type: str or ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayConnectionType @@ -116,21 +118,21 @@ class VirtualNetworkGatewayConnection(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, virtual_network_gateway1, connection_type, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight=None, shared_key=None, peer=None, enable_bgp=None, resource_guid=None, etag=None): - super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnection, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) self.connection_status = None self.tunnel_connection_status = None self.egress_bytes_transferred = None self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.resource_guid = resource_guid + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_connection_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_connection_py3.py new file mode 100644 index 000000000000..af4971f8d82d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_connection_py3.py @@ -0,0 +1,138 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnection(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: + :type virtual_network_gateway2: + ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway + :param local_network_gateway2: + :type local_network_gateway2: + ~azure.mgmt.network.v2016_09_01.models.LocalNetworkGateway + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2016_09_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2016_09_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_ip_configuration.py index 932a6f39be49..17a483af1357 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_ip_configuration.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayIPConfiguration(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param private_ip_allocation_method: The private IP allocation method. @@ -25,9 +27,10 @@ class VirtualNetworkGatewayIPConfiguration(SubResource): 'Static', 'Dynamic' :type private_ip_allocation_method: str or ~azure.mgmt.network.v2016_09_01.models.IPAllocationMethod - :param subnet: The reference of the subnet resource. + :param subnet: Required. The reference of the subnet resource. :type subnet: ~azure.mgmt.network.v2016_09_01.models.SubResource - :param public_ip_address: The reference of the public IP resource. + :param public_ip_address: Required. The reference of the public IP + resource. :type public_ip_address: ~azure.mgmt.network.v2016_09_01.models.SubResource :ivar provisioning_state: The provisioning state of the public IP @@ -57,11 +60,11 @@ class VirtualNetworkGatewayIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, subnet, public_ip_address, id=None, private_ip_allocation_method=None, name=None, etag=None): - super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id) - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address + def __init__(self, **kwargs): + super(VirtualNetworkGatewayIPConfiguration, self).__init__(**kwargs) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..db69ea37f691 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_ip_configuration_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2016_09_01.models.IPAllocationMethod + :param subnet: Required. The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2016_09_01.models.SubResource + :param public_ip_address: Required. The reference of the public IP + resource. + :type public_ip_address: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'subnet': {'required': True}, + 'public_ip_address': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, subnet, public_ip_address, id: str=None, private_ip_allocation_method=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_py3.py new file mode 100644 index 000000000000..9f31aae9d00d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_py3.py @@ -0,0 +1,120 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param ip_configurations: Required. IP configurations for virtual network + gateway. + :type ip_configurations: + list[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: Required. The type of this virtual network gateway. + Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: + 'Vpn', 'ExpressRoute' + :type gateway_type: str or + ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayType + :param vpn_type: Required. The type of this virtual network gateway. + Possible values are: 'PolicyBased' and 'RouteBased'. Possible values + include: 'PolicyBased', 'RouteBased' + :type vpn_type: str or ~azure.mgmt.network.v2016_09_01.models.VpnType + :param enable_bgp: Whether BGP is enabled for this virtual network gateway + or not. + :type enable_bgp: bool + :param active_active: ActiveActive flag + :type active_active: bool + :param gateway_default_site: The reference of the LocalNetworkGateway + resource which represents local network site having default routes. Assign + Null value in case of removing existing default site setting. + :type gateway_default_site: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param sku: The reference of the VirtualNetworkGatewaySku resource which + represents the SKU selected for Virtual network gateway. + :type sku: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewaySku + :param vpn_client_configuration: The reference of the + VpnClientConfiguration resource which represents the P2S VpnClient + configurations. + :type vpn_client_configuration: + ~azure.mgmt.network.v2016_09_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2016_09_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + VirtualNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGateway resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'ip_configurations': {'required': True}, + 'gateway_type': {'required': True}, + 'vpn_type': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, + 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, + 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'active_active': {'key': 'properties.activeActive', 'type': 'bool'}, + 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, + 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, + 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, ip_configurations, gateway_type, vpn_type, id: str=None, location: str=None, tags=None, enable_bgp: bool=None, active_active: bool=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.ip_configurations = ip_configurations + self.gateway_type = gateway_type + self.vpn_type = vpn_type + self.enable_bgp = enable_bgp + self.active_active = active_active + self.gateway_default_site = gateway_default_site + self.sku = sku + self.vpn_client_configuration = vpn_client_configuration + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_sku.py index d458232bd0ab..c8d17b168c15 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_sku.py @@ -15,12 +15,14 @@ class VirtualNetworkGatewaySku(Model): """VirtualNetworkGatewaySku details. - :param name: Gateway SKU name. Possible values are: 'Basic', + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gateway SKU name. Possible values are: 'Basic', 'HighPerformance','Standard', and 'UltraPerformance'. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance' :type name: str or ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewaySkuName - :param tier: Gateway SKU tier. Possible values are: 'Basic', + :param tier: Required. Gateway SKU tier. Possible values are: 'Basic', 'HighPerformance','Standard', and 'UltraPerformance'. Possible values include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance' :type tier: str or @@ -40,8 +42,8 @@ class VirtualNetworkGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name, tier, capacity=None): - super(VirtualNetworkGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_sku_py3.py new file mode 100644 index 000000000000..ec00dfa2b8bd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_gateway_sku_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkGatewaySku(Model): + """VirtualNetworkGatewaySku details. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gateway SKU name. Possible values are: 'Basic', + 'HighPerformance','Standard', and 'UltraPerformance'. Possible values + include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance' + :type name: str or + ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewaySkuName + :param tier: Required. Gateway SKU tier. Possible values are: 'Basic', + 'HighPerformance','Standard', and 'UltraPerformance'. Possible values + include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance' + :type tier: str or + ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewaySkuTier + :param capacity: The capacity. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name, tier, capacity: int=None, **kwargs) -> None: + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_peering.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_peering.py index e2ed2031fdba..908cb16299c0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_peering.py @@ -65,14 +65,14 @@ class VirtualNetworkPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, allow_virtual_network_access=None, allow_forwarded_traffic=None, allow_gateway_transit=None, use_remote_gateways=None, remote_virtual_network=None, peering_state=None, provisioning_state=None, name=None, etag=None): - super(VirtualNetworkPeering, self).__init__(id=id) - self.allow_virtual_network_access = allow_virtual_network_access - self.allow_forwarded_traffic = allow_forwarded_traffic - self.allow_gateway_transit = allow_gateway_transit - self.use_remote_gateways = use_remote_gateways - self.remote_virtual_network = remote_virtual_network - self.peering_state = peering_state - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetworkPeering, self).__init__(**kwargs) + self.allow_virtual_network_access = kwargs.get('allow_virtual_network_access', None) + self.allow_forwarded_traffic = kwargs.get('allow_forwarded_traffic', None) + self.allow_gateway_transit = kwargs.get('allow_gateway_transit', None) + self.use_remote_gateways = kwargs.get('use_remote_gateways', None) + self.remote_virtual_network = kwargs.get('remote_virtual_network', None) + self.peering_state = kwargs.get('peering_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_peering_py3.py new file mode 100644 index 000000000000..d7a81d4058a0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_peering_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkPeering(SubResource): + """Peerings in a virtual network resource. + + :param id: Resource ID. + :type id: str + :param allow_virtual_network_access: Whether the VMs in the linked virtual + network space would be able to access all the VMs in local Virtual network + space. + :type allow_virtual_network_access: bool + :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs + in the remote virtual network will be allowed/disallowed. + :type allow_forwarded_traffic: bool + :param allow_gateway_transit: If gateway links can be used in remote + virtual networking to link to this virtual network. + :type allow_gateway_transit: bool + :param use_remote_gateways: If remote gateways can be used on this virtual + network. If the flag is set to true, and allowGatewayTransit on remote + peering is also true, virtual network will use gateways of remote virtual + network for transit. Only one peering can have this flag set to true. This + flag cannot be set if virtual network already has a gateway. + :type use_remote_gateways: bool + :param remote_virtual_network: The reference of the remote virtual + network. + :type remote_virtual_network: + ~azure.mgmt.network.v2016_09_01.models.SubResource + :param peering_state: The status of the virtual network peering. Possible + values are 'Initiated', 'Connected', and 'Disconnected'. Possible values + include: 'Initiated', 'Connected', 'Disconnected' + :type peering_state: str or + ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkPeeringState + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, + 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, + 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, + 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, allow_virtual_network_access: bool=None, allow_forwarded_traffic: bool=None, allow_gateway_transit: bool=None, use_remote_gateways: bool=None, remote_virtual_network=None, peering_state=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkPeering, self).__init__(id=id, **kwargs) + self.allow_virtual_network_access = allow_virtual_network_access + self.allow_forwarded_traffic = allow_forwarded_traffic + self.allow_gateway_transit = allow_gateway_transit + self.use_remote_gateways = use_remote_gateways + self.remote_virtual_network = remote_virtual_network + self.peering_state = peering_state + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_py3.py new file mode 100644 index 000000000000..566c0eeaf85c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/virtual_network_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetwork(Resource): + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param address_space: The AddressSpace that contains an array of IP + address ranges that can be used by subnets. + :type address_space: ~azure.mgmt.network.v2016_09_01.models.AddressSpace + :param dhcp_options: The dhcpOptions that contains an array of DNS servers + available to VMs deployed in the virtual network. + :type dhcp_options: ~azure.mgmt.network.v2016_09_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2016_09_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkPeering] + :param resource_guid: The resourceGuid property of the Virtual Network + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.address_space = address_space + self.dhcp_options = dhcp_options + self.subnets = subnets + self.virtual_network_peerings = virtual_network_peerings + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_configuration.py index 817e1d4903cc..3be0ba03d093 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_configuration.py @@ -35,8 +35,8 @@ class VpnClientConfiguration(Model): 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, } - def __init__(self, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None): - super(VpnClientConfiguration, self).__init__() - self.vpn_client_address_pool = vpn_client_address_pool - self.vpn_client_root_certificates = vpn_client_root_certificates - self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + def __init__(self, **kwargs): + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = kwargs.get('vpn_client_address_pool', None) + self.vpn_client_root_certificates = kwargs.get('vpn_client_root_certificates', None) + self.vpn_client_revoked_certificates = kwargs.get('vpn_client_revoked_certificates', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_configuration_py3.py new file mode 100644 index 000000000000..f4707cd24440 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_configuration_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientConfiguration(Model): + """VpnClientConfiguration for P2S client. + + :param vpn_client_address_pool: The reference of the address space + resource which represents Address space for P2S VpnClient. + :type vpn_client_address_pool: + ~azure.mgmt.network.v2016_09_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual + network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2016_09_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for + Virtual network gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2016_09_01.models.VpnClientRevokedCertificate] + """ + + _attribute_map = { + 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, + 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, + } + + def __init__(self, *, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, **kwargs) -> None: + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = vpn_client_address_pool + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_parameters.py index 3691e9bf0cc9..3717f5bf3d1d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_parameters.py @@ -15,8 +15,11 @@ class VpnClientParameters(Model): """VpnClientParameters. - :param processor_architecture: VPN client Processor Architecture. Possible - values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' + All required parameters must be populated in order to send to Azure. + + :param processor_architecture: Required. VPN client Processor + Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + include: 'Amd64', 'X86' :type processor_architecture: str or ~azure.mgmt.network.v2016_09_01.models.ProcessorArchitecture """ @@ -29,6 +32,6 @@ class VpnClientParameters(Model): 'processor_architecture': {'key': 'ProcessorArchitecture', 'type': 'str'}, } - def __init__(self, processor_architecture): - super(VpnClientParameters, self).__init__() - self.processor_architecture = processor_architecture + def __init__(self, **kwargs): + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = kwargs.get('processor_architecture', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_parameters_py3.py new file mode 100644 index 000000000000..1cc61a98311a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_parameters_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientParameters(Model): + """VpnClientParameters. + + All required parameters must be populated in order to send to Azure. + + :param processor_architecture: Required. VPN client Processor + Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + include: 'Amd64', 'X86' + :type processor_architecture: str or + ~azure.mgmt.network.v2016_09_01.models.ProcessorArchitecture + """ + + _validation = { + 'processor_architecture': {'required': True}, + } + + _attribute_map = { + 'processor_architecture': {'key': 'ProcessorArchitecture', 'type': 'str'}, + } + + def __init__(self, *, processor_architecture, **kwargs) -> None: + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = processor_architecture diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_revoked_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_revoked_certificate.py index ebd6a4bbba2f..1fa6f6a1ef23 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_revoked_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_revoked_certificate.py @@ -46,9 +46,9 @@ class VpnClientRevokedCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, thumbprint=None, name=None, etag=None): - super(VpnClientRevokedCertificate, self).__init__(id=id) - self.thumbprint = thumbprint + def __init__(self, **kwargs): + super(VpnClientRevokedCertificate, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_revoked_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_revoked_certificate_py3.py new file mode 100644 index 000000000000..7c1e05f283a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_revoked_certificate_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + :ivar provisioning_state: The provisioning state of the VPN client revoked + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, thumbprint: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRevokedCertificate, self).__init__(id=id, **kwargs) + self.thumbprint = thumbprint + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_root_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_root_certificate.py index 6d820d3a8c11..48c7033d42ec 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_root_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_root_certificate.py @@ -18,9 +18,11 @@ class VpnClientRootCertificate(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param public_cert_data: The certificate public data. + :param public_cert_data: Required. The certificate public data. :type public_cert_data: str :ivar provisioning_state: The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and @@ -47,9 +49,9 @@ class VpnClientRootCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, public_cert_data, id=None, name=None, etag=None): - super(VpnClientRootCertificate, self).__init__(id=id) - self.public_cert_data = public_cert_data + def __init__(self, **kwargs): + super(VpnClientRootCertificate, self).__init__(**kwargs) + self.public_cert_data = kwargs.get('public_cert_data', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_root_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_root_certificate_py3.py new file mode 100644 index 000000000000..db8a1e547705 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/vpn_client_root_certificate_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param public_cert_data: Required. The certificate public data. + :type public_cert_data: str + :ivar provisioning_state: The provisioning state of the VPN client root + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'public_cert_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, public_cert_data: str, id: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRootCertificate, self).__init__(id=id, **kwargs) + self.public_cert_data = public_cert_data + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/network_management_client.py index d7ab67cf7142..42cc01c5a2db 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/network_management_client.py @@ -15,7 +15,8 @@ from .version import VERSION from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.network_interfaces_operations import NetworkInterfacesOperations from .operations.application_gateways_operations import ApplicationGatewaysOperations @@ -211,7 +212,7 @@ def check_dns_name_availability( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability' + url = self.check_dns_name_availability.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -253,3 +254,4 @@ def check_dns_name_availability( return client_raw_response return deserialized + check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/application_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/application_gateways_operations.py index 3c11bf73f5f0..4ea2842f82cb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/application_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/application_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ApplicationGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def get( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def _create_or_update_initial( self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_09_01.models.ApplicationGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.ApplicationGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.ApplicationGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ApplicationGateway', response) if raw: @@ -312,12 +276,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -339,7 +305,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -385,6 +351,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -404,7 +371,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -449,12 +416,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} def _start_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -490,7 +458,7 @@ def _start_initial( return client_raw_response def start( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -498,12 +466,14 @@ def start( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -513,46 +483,26 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} def _stop_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -588,7 +538,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -596,12 +546,14 @@ def stop( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -611,46 +563,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} def _backend_health_initial( self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth' + url = self.backend_health.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -695,7 +627,7 @@ def _backend_health_initial( return deserialized def backend_health( - self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the backend health of the specified application gateway in a resource group. @@ -707,13 +639,17 @@ def backend_health( referenced in backend health. :type expand: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGatewayBackendHealth or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApplicationGatewayBackendHealth or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendHealth] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.ApplicationGatewayBackendHealth]] :raises: :class:`CloudError` """ raw_result = self._backend_health_initial( @@ -724,30 +660,8 @@ def backend_health( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ApplicationGatewayBackendHealth', response) if raw: @@ -756,9 +670,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_circuit_authorizations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_circuit_authorizations_operations.py index 2d5f0502637c..7ad58db0065c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_circuit_authorizations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_circuit_authorizations_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified authorization from the specified express route circuit. @@ -91,12 +91,14 @@ def delete( :param authorization_name: The name of the authorization. :type authorization_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def get( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): @@ -166,7 +148,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an authorization in the specified express route circuit. @@ -278,13 +261,17 @@ def create_or_update( :type authorization_parameters: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitAuthorization :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitAuthorization or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitAuthorization or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitAuthorization] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitAuthorization]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -296,30 +283,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitAuthorization', response) if raw: @@ -328,12 +293,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +324,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -404,3 +371,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_circuit_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_circuit_peerings_operations.py index 1bed3a43e3b5..4670c7e5700c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_circuit_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_circuit_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param peering_name: The name of the peering. :type peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def get( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -275,13 +258,17 @@ def create_or_update( :type peering_parameters: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitPeering or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitPeering', response) if raw: @@ -325,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -401,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_circuits_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_circuits_operations.py index 9bd1e8091965..951787d29d44 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_circuits_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_circuits_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param circuit_name: The name of the express route circuit. :type circuit_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def get( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuit :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuit or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuit] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuit]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuit', response) if raw: @@ -312,18 +276,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _list_arp_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}' + url = self.list_arp_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -368,7 +334,7 @@ def _list_arp_table_initial( return deserialized def list_arp_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -381,14 +347,17 @@ def list_arp_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsArpTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsArpTableListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitsArpTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitsArpTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_arp_table_initial( @@ -400,30 +369,8 @@ def list_arp_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', response) if raw: @@ -432,18 +379,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} def _list_routes_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}' + url = self.list_routes_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -488,7 +437,7 @@ def _list_routes_table_initial( return deserialized def list_routes_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -501,14 +450,18 @@ def list_routes_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitsRoutesTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitsRoutesTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_initial( @@ -520,30 +473,8 @@ def list_routes_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', response) if raw: @@ -552,18 +483,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} def _list_routes_table_summary_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}' + url = self.list_routes_table_summary.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -608,7 +541,7 @@ def _list_routes_table_summary_initial( return deserialized def list_routes_table_summary( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -621,14 +554,18 @@ def list_routes_table_summary( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableSummaryListResult or ClientRawResponse - if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableSummaryListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_summary_initial( @@ -640,30 +577,8 @@ def list_routes_table_summary( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', response) if raw: @@ -672,12 +587,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} def get_stats( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -699,7 +616,7 @@ def get_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats' + url = self.get_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -740,6 +657,7 @@ def get_stats( return client_raw_response return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} def get_peering_stats( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -763,7 +681,7 @@ def get_peering_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats' + url = self.get_peering_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -805,6 +723,7 @@ def get_peering_stats( return client_raw_response return deserialized + get_peering_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -826,7 +745,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -872,6 +791,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -891,7 +811,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -936,3 +856,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_service_providers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_service_providers_operations.py index 6798649a9c29..37c544f65b84 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_service_providers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_service_providers_operations.py @@ -22,7 +22,7 @@ class ExpressRouteServiceProvidersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/load_balancers_operations.py index d9428ec724f8..7d23e1e73bee 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/load_balancers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param load_balancer_name: The name of the load balancer. :type load_balancer_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def get( self, resource_group_name, load_balancer_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( balancer operation. :type parameters: ~azure.mgmt.network.v2016_09_01.models.LoadBalancer :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns LoadBalancer - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.LoadBalancer] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.LoadBalancer]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LoadBalancer', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -340,7 +306,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -385,6 +351,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -406,7 +373,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -452,3 +419,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/local_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/local_network_gateways_operations.py index a520208b2a81..e4fd468ce9dc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/local_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/local_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LocalNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a local network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_09_01.models.LocalNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - LocalNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.LocalNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.LocalNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LocalNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def get( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def _delete_initial( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type local_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +309,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -389,3 +355,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/network_interfaces_operations.py index 40180720be2f..21941f2292ab 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/network_interfaces_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -65,7 +65,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces' + url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -113,6 +113,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} def list_virtual_machine_scale_set_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -137,7 +138,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces' + url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -184,6 +185,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} def get_virtual_machine_scale_set_network_interface( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -211,7 +213,7 @@ def get_virtual_machine_scale_set_network_interface( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}' + url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -256,12 +258,13 @@ def get_virtual_machine_scale_set_network_interface( return client_raw_response return deserialized + get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} def _delete_initial( self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -297,7 +300,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -305,12 +308,14 @@ def delete( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -320,40 +325,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def get( self, resource_group_name, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -376,7 +361,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -419,12 +404,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def _create_or_update_initial( self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -473,7 +459,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -485,13 +471,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_09_01.models.NetworkInterface :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkInterface or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.NetworkInterface] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.NetworkInterface]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -502,30 +491,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkInterface', response) if raw: @@ -534,12 +501,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -559,7 +528,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -604,6 +573,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -625,7 +595,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -671,12 +641,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} def _get_effective_route_table_initial( self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable' + url = self.get_effective_route_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -719,7 +690,7 @@ def _get_effective_route_table_initial( return deserialized def get_effective_route_table( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -727,13 +698,17 @@ def get_effective_route_table( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveRouteListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.EffectiveRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.EffectiveRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_effective_route_table_initial( @@ -743,30 +718,8 @@ def get_effective_route_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveRouteListResult', response) if raw: @@ -775,18 +728,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_effective_route_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} def _list_effective_network_security_groups_initial( self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups' + url = self.list_effective_network_security_groups.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -829,7 +784,7 @@ def _list_effective_network_security_groups_initial( return deserialized def list_effective_network_security_groups( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -837,14 +792,18 @@ def list_effective_network_security_groups( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveNetworkSecurityGroupListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveNetworkSecurityGroupListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.EffectiveNetworkSecurityGroupListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.EffectiveNetworkSecurityGroupListResult]] :raises: :class:`CloudError` """ raw_result = self._list_effective_network_security_groups_initial( @@ -854,30 +813,8 @@ def list_effective_network_security_groups( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', response) if raw: @@ -886,9 +823,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_effective_network_security_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/network_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/network_security_groups_operations.py index 07f3c4f3e039..cfc14a0b8786 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/network_security_groups_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/network_security_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkSecurityGroupsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -88,12 +88,14 @@ def delete( group. :type network_security_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -103,40 +105,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def get( self, resource_group_name, network_security_group_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -203,12 +185,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -257,7 +240,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network security group in the specified resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_09_01.models.NetworkSecurityGroup :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.NetworkSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.NetworkSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkSecurityGroup', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -345,7 +311,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -390,6 +356,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -411,7 +378,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -457,3 +424,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/network_watchers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/network_watchers_operations.py index 59aefe69d03a..9cfdce42a401 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/network_watchers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/network_watchers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkWatchersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -62,7 +62,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -109,6 +109,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def get( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -170,12 +171,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def _delete_initial( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -211,7 +213,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -219,12 +221,14 @@ def delete( :param network_watcher_name: The name of the network watcher. :type network_watcher_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -234,40 +238,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -289,7 +273,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -335,6 +319,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -354,7 +339,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -399,6 +384,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'} def get_topology( self, resource_group_name, network_watcher_name, target_resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -424,7 +410,7 @@ def get_topology( parameters = models.TopologyParameters(target_resource_group_name=target_resource_group_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology' + url = self.get_topology.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -469,12 +455,13 @@ def get_topology( return client_raw_response return deserialized + get_topology.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'} def _verify_ip_flow_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify' + url = self.verify_ip_flow.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -523,7 +510,7 @@ def _verify_ip_flow_initial( return deserialized def verify_ip_flow( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Verify IP flow from the specified VM to a location given the currently configured NSG rules. @@ -535,13 +522,17 @@ def verify_ip_flow( :type parameters: ~azure.mgmt.network.v2016_09_01.models.VerificationIPFlowParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VerificationIPFlowResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VerificationIPFlowResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.VerificationIPFlowResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.VerificationIPFlowResult]] :raises: :class:`CloudError` """ raw_result = self._verify_ip_flow_initial( @@ -552,30 +543,8 @@ def verify_ip_flow( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VerificationIPFlowResult', response) if raw: @@ -584,18 +553,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + verify_ip_flow.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} def _get_next_hop_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop' + url = self.get_next_hop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -644,7 +615,7 @@ def _get_next_hop_initial( return deserialized def get_next_hop( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -656,13 +627,16 @@ def get_next_hop( :type parameters: ~azure.mgmt.network.v2016_09_01.models.NextHopParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NextHopResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NextHopResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.NextHopResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.NextHopResult]] :raises: :class:`CloudError` """ raw_result = self._get_next_hop_initial( @@ -673,30 +647,8 @@ def get_next_hop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NextHopResult', response) if raw: @@ -705,12 +657,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_next_hop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} def _get_vm_security_rules_initial( @@ -718,7 +672,7 @@ def _get_vm_security_rules_initial( parameters = models.SecurityGroupViewParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView' + url = self.get_vm_security_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -767,7 +721,7 @@ def _get_vm_security_rules_initial( return deserialized def get_vm_security_rules( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the configured and effective security group rules on the specified VM. @@ -778,13 +732,16 @@ def get_vm_security_rules( :param target_resource_id: ID of the target VM. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - SecurityGroupViewResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityGroupViewResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.SecurityGroupViewResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.SecurityGroupViewResult]] :raises: :class:`CloudError` """ raw_result = self._get_vm_security_rules_initial( @@ -795,30 +752,8 @@ def get_vm_security_rules( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('SecurityGroupViewResult', response) if raw: @@ -827,18 +762,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vm_security_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} def _get_troubleshooting_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot' + url = self.get_troubleshooting.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -887,7 +824,7 @@ def _get_troubleshooting_initial( return deserialized def get_troubleshooting( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -899,13 +836,16 @@ def get_troubleshooting( :type parameters: ~azure.mgmt.network.v2016_09_01.models.TroubleshootingParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_initial( @@ -916,30 +856,8 @@ def get_troubleshooting( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -948,12 +866,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} def _get_troubleshooting_result_initial( @@ -961,7 +881,7 @@ def _get_troubleshooting_result_initial( parameters = models.QueryTroubleshootingParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult' + url = self.get_troubleshooting_result.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1010,7 +930,7 @@ def _get_troubleshooting_result_initial( return deserialized def get_troubleshooting_result( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,13 +941,16 @@ def get_troubleshooting_result( troubleshooting result. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_result_initial( @@ -1038,30 +961,8 @@ def get_troubleshooting_result( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -1070,18 +971,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} def _set_flow_log_configuration_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog' + url = self.set_flow_log_configuration.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1130,7 +1033,7 @@ def _set_flow_log_configuration_initial( return deserialized def set_flow_log_configuration( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1143,13 +1046,16 @@ def set_flow_log_configuration( :type parameters: ~azure.mgmt.network.v2016_09_01.models.FlowLogInformation :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._set_flow_log_configuration_initial( @@ -1160,30 +1066,8 @@ def set_flow_log_configuration( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1192,12 +1076,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_flow_log_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} def _get_flow_log_status_initial( @@ -1205,7 +1091,7 @@ def _get_flow_log_status_initial( parameters = models.FlowLogStatusParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus' + url = self.get_flow_log_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1254,7 +1140,7 @@ def _get_flow_log_status_initial( return deserialized def get_flow_log_status( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1266,13 +1152,16 @@ def get_flow_log_status( logging status. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._get_flow_log_status_initial( @@ -1283,30 +1172,8 @@ def get_flow_log_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1315,9 +1182,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_flow_log_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/packet_captures_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/packet_captures_operations.py index 50840abcb46e..8a2ed9a6fb63 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/packet_captures_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/packet_captures_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PacketCapturesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -91,7 +91,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -104,13 +104,16 @@ def create( operation. :type parameters: ~azure.mgmt.network.v2016_09_01.models.PacketCapture :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PacketCaptureResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.PacketCaptureResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.PacketCaptureResult]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -122,30 +125,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureResult', response) if raw: @@ -154,12 +135,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def get( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -224,12 +207,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _delete_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -266,7 +250,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -276,12 +260,14 @@ def delete( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -292,46 +278,26 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _stop_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -368,7 +334,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -378,12 +344,14 @@ def stop( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -394,46 +362,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} def _get_status_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus' + url = self.get_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -479,7 +427,7 @@ def _get_status_initial( return deserialized def get_status( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -490,13 +438,17 @@ def get_status( session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureQueryStatusResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PacketCaptureQueryStatusResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.PacketCaptureQueryStatusResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.PacketCaptureQueryStatusResult]] :raises: :class:`CloudError` """ raw_result = self._get_status_initial( @@ -507,30 +459,8 @@ def get_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureQueryStatusResult', response) if raw: @@ -539,12 +469,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} def list( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -568,7 +500,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -615,3 +547,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/public_ip_addresses_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/public_ip_addresses_operations.py index 0a68d94fa467..19b8bcf3d4e0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/public_ip_addresses_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/public_ip_addresses_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PublicIPAddressesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param public_ip_address_name: The name of the subnet. :type public_ip_address_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def get( self, resource_group_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def _create_or_update_initial( self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_09_01.models.PublicIPAddress :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PublicIPAddress or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.PublicIPAddress] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.PublicIPAddress]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('PublicIPAddress', response) if raw: @@ -316,12 +280,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -341,7 +307,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -386,6 +352,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -453,3 +420,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/route_tables_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/route_tables_operations.py index 12f6b4890960..e82d56d6ad54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/route_tables_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/route_tables_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteTablesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_table_name: The name of the route table. :type route_table_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def get( self, resource_group_name, route_table_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( table operation. :type parameters: ~azure.mgmt.network.v2016_09_01.models.RouteTable :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteTable - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.RouteTable] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.RouteTable]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteTable', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -342,7 +308,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -388,6 +354,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -452,3 +419,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/routes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/routes_operations.py index 5cd4192ad1e8..e6ee36947c44 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/routes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/routes_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RoutesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param route_name: The name of the route. :type route_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def get( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -272,13 +255,16 @@ def create_or_update( route operation. :type route_parameters: ~azure.mgmt.network.v2016_09_01.models.Route :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Route or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Route or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.Route] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.Route]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -290,30 +276,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Route', response) if raw: @@ -322,12 +286,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def list( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): @@ -351,7 +317,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -398,3 +364,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/security_rules_operations.py index a76c167a4788..1736b6b07741 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/security_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( :param security_rule_name: The name of the security rule. :type security_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def get( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a security rule in the specified network security group. @@ -277,13 +260,16 @@ def create_or_update( :type security_rule_parameters: ~azure.mgmt.network.v2016_09_01.models.SecurityRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns SecurityRule - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.SecurityRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.SecurityRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -295,30 +281,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('SecurityRule', response) if raw: @@ -327,12 +291,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def list( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +323,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -404,3 +370,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/subnets_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/subnets_operations.py index b8922554afc9..eb5bca99a683 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/subnets_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/subnets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SubnetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param subnet_name: The name of the subnet. :type subnet_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def get( self, resource_group_name, virtual_network_name, subnet_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -276,13 +259,16 @@ def create_or_update( subnet operation. :type subnet_parameters: ~azure.mgmt.network.v2016_09_01.models.Subnet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Subnet or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Subnet or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.Subnet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.Subnet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -294,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Subnet', response) if raw: @@ -326,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -355,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -402,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/usages_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/usages_operations.py index df00ab57578c..185d6149c659 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/usages_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/usages_operations.py @@ -22,7 +22,7 @@ class UsagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_network_gateway_connections_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_network_gateway_connections_operations.py index eaad1a73283e..e4b008ba2093 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_network_gateway_connections_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_network_gateway_connections_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway connection in the specified resource group. @@ -106,13 +106,17 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayConnection :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGatewayConnection or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnection or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayConnection] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGatewayConnection]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +127,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGatewayConnection', response) if raw: @@ -155,12 +137,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def get( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -185,7 +169,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -226,12 +210,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -267,7 +252,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -276,12 +261,14 @@ def delete( virtual network gateway connection. :type virtual_network_gateway_connection_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -291,40 +278,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _set_shared_key_initial( @@ -332,7 +299,7 @@ def _set_shared_key_initial( parameters = models.ConnectionSharedKey(value=value) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.set_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -381,7 +348,7 @@ def _set_shared_key_initial( return deserialized def set_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, polling=True, **operation_config): """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -395,13 +362,16 @@ def set_shared_key( :param value: The virtual network connection shared key value. :type value: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectionSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.ConnectionSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.ConnectionSharedKey]] :raises: :class:`CloudError` """ raw_result = self._set_shared_key_initial( @@ -412,30 +382,8 @@ def set_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ConnectionSharedKey', response) if raw: @@ -444,12 +392,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def get_shared_key( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -473,7 +423,7 @@ def get_shared_key( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.get_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -514,6 +464,7 @@ def get_shared_key( return client_raw_response return deserialized + get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -536,7 +487,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -582,6 +533,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} def _reset_shared_key_initial( @@ -589,7 +541,7 @@ def _reset_shared_key_initial( parameters = models.ConnectionResetSharedKey(key_length=key_length) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset' + url = self.reset_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -636,7 +588,7 @@ def _reset_shared_key_initial( return deserialized def reset_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, polling=True, **operation_config): """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -651,13 +603,17 @@ def reset_shared_key( length, should between 1 and 128. :type key_length: int :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionResetSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConnectionResetSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.ConnectionResetSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.ConnectionResetSharedKey]] :raises: :class:`CloudError` """ raw_result = self._reset_shared_key_initial( @@ -668,30 +624,8 @@ def reset_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectionResetSharedKey', response) if raw: @@ -700,9 +634,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_network_gateways_operations.py index af4cbf5ce252..8126f68ff709 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def get( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +309,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -389,12 +355,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} def _reset_initial( self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset' + url = self.reset.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -439,7 +406,7 @@ def _reset_initial( return deserialized def reset( - self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, polling=True, **operation_config): """Resets the primary of the virtual network gateway in the specified resource group. @@ -452,13 +419,16 @@ def reset( the begin reset of the active-active feature enabled gateway. :type gateway_vip: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._reset_initial( @@ -469,30 +439,8 @@ def reset( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -501,12 +449,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} def generatevpnclientpackage( self, resource_group_name, virtual_network_gateway_name, processor_architecture, custom_headers=None, raw=False, **operation_config): @@ -535,7 +485,7 @@ def generatevpnclientpackage( parameters = models.VpnClientParameters(processor_architecture=processor_architecture) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage' + url = self.generatevpnclientpackage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -580,12 +530,13 @@ def generatevpnclientpackage( return client_raw_response return deserialized + generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} def _get_bgp_peer_status_initial( self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus' + url = self.get_bgp_peer_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -630,7 +581,7 @@ def _get_bgp_peer_status_initial( return deserialized def get_bgp_peer_status( - self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, polling=True, **operation_config): """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -641,13 +592,16 @@ def get_bgp_peer_status( :param peer: The IP address of the peer to retrieve the status of. :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - BgpPeerStatusListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BgpPeerStatusListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.BgpPeerStatusListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.BgpPeerStatusListResult]] :raises: :class:`CloudError` """ raw_result = self._get_bgp_peer_status_initial( @@ -658,30 +612,8 @@ def get_bgp_peer_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('BgpPeerStatusListResult', response) if raw: @@ -690,18 +622,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_bgp_peer_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} def _get_learned_routes_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes' + url = self.get_learned_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -744,7 +678,7 @@ def _get_learned_routes_initial( return deserialized def get_learned_routes( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -754,13 +688,16 @@ def get_learned_routes( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_learned_routes_initial( @@ -770,30 +707,8 @@ def get_learned_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -802,18 +717,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} def _get_advertised_routes_initial( self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes' + url = self.get_advertised_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -857,7 +774,7 @@ def _get_advertised_routes_initial( return deserialized def get_advertised_routes( - self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -869,13 +786,16 @@ def get_advertised_routes( :param peer: The IP address of the peer :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_advertised_routes_initial( @@ -886,30 +806,8 @@ def get_advertised_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -918,9 +816,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_network_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_network_peerings_operations.py index 60de133a7c01..a88692fb6191 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_network_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_network_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( peering. :type virtual_network_peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def get( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -275,13 +258,16 @@ def create_or_update( :type virtual_network_peering_parameters: ~azure.mgmt.network.v2016_09_01.models.VirtualNetworkPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkPeering + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +279,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkPeering', response) if raw: @@ -325,12 +289,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +320,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -401,3 +367,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_networks_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_networks_operations.py index f11ea9d0cd96..a260c89ba0a7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_networks_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/virtual_networks_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworksOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param virtual_network_name: The name of the virtual network. :type virtual_network_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def get( self, resource_group_name, virtual_network_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_09_01.models.VirtualNetwork :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetwork or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_09_01.models.VirtualNetwork] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_09_01.models.VirtualNetwork]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetwork', response) if raw: @@ -316,12 +280,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -341,7 +307,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -386,6 +352,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -453,6 +420,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks'} def check_ip_address_availability( self, resource_group_name, virtual_network_name, ip_address=None, custom_headers=None, raw=False, **operation_config): @@ -476,7 +444,7 @@ def check_ip_address_availability( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability' + url = self.check_ip_address_availability.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -519,3 +487,4 @@ def check_ip_address_availability( return client_raw_response return deserialized + check_ip_address_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/__init__.py index 416f99b9e5b5..f91b4542a302 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/__init__.py @@ -9,134 +9,264 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource -from .network_interface_dns_settings import NetworkInterfaceDnsSettings -from .sub_resource import SubResource -from .public_ip_address_dns_settings import PublicIPAddressDnsSettings -from .resource_navigation_link import ResourceNavigationLink -from .route import Route -from .security_rule import SecurityRule -from .application_gateway_backend_address import ApplicationGatewayBackendAddress -from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool -from .backend_address_pool import BackendAddressPool -from .inbound_nat_rule import InboundNatRule -from .ip_configuration import IPConfiguration -from .public_ip_address import PublicIPAddress -from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration -from .network_interface import NetworkInterface -from .network_security_group import NetworkSecurityGroup -from .route_table import RouteTable -from .subnet import Subnet -from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining -from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings -from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer -from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings -from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool -from .application_gateway_backend_health import ApplicationGatewayBackendHealth -from .application_gateway_sku import ApplicationGatewaySku -from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy -from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration -from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate -from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate -from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration -from .application_gateway_frontend_port import ApplicationGatewayFrontendPort -from .application_gateway_http_listener import ApplicationGatewayHttpListener -from .application_gateway_path_rule import ApplicationGatewayPathRule -from .application_gateway_probe import ApplicationGatewayProbe -from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule -from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap -from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration -from .application_gateway import ApplicationGateway -from .dns_name_availability_result import DnsNameAvailabilityResult -from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization -from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig -from .express_route_circuit_stats import ExpressRouteCircuitStats -from .route_filter_rule import RouteFilterRule -from .express_route_circuit_peering import ExpressRouteCircuitPeering -from .route_filter import RouteFilter -from .express_route_circuit_sku import ExpressRouteCircuitSku -from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties -from .express_route_circuit import ExpressRouteCircuit -from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable -from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult -from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable -from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult -from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary -from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult -from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered -from .express_route_service_provider import ExpressRouteServiceProvider -from .frontend_ip_configuration import FrontendIPConfiguration -from .load_balancing_rule import LoadBalancingRule -from .probe import Probe -from .inbound_nat_pool import InboundNatPool -from .outbound_nat_rule import OutboundNatRule -from .load_balancer import LoadBalancer -from .error_details import ErrorDetails -from .error import Error -from .azure_async_operation_result import AzureAsyncOperationResult -from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation -from .effective_network_security_rule import EffectiveNetworkSecurityRule -from .effective_network_security_group import EffectiveNetworkSecurityGroup -from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult -from .effective_route import EffectiveRoute -from .effective_route_list_result import EffectiveRouteListResult -from .network_watcher import NetworkWatcher -from .topology_parameters import TopologyParameters -from .topology_association import TopologyAssociation -from .topology_resource import TopologyResource -from .topology import Topology -from .verification_ip_flow_parameters import VerificationIPFlowParameters -from .verification_ip_flow_result import VerificationIPFlowResult -from .next_hop_parameters import NextHopParameters -from .next_hop_result import NextHopResult -from .security_group_view_parameters import SecurityGroupViewParameters -from .network_interface_association import NetworkInterfaceAssociation -from .subnet_association import SubnetAssociation -from .security_rule_associations import SecurityRuleAssociations -from .security_group_network_interface import SecurityGroupNetworkInterface -from .security_group_view_result import SecurityGroupViewResult -from .packet_capture_storage_location import PacketCaptureStorageLocation -from .packet_capture_filter import PacketCaptureFilter -from .packet_capture_parameters import PacketCaptureParameters -from .packet_capture import PacketCapture -from .packet_capture_result import PacketCaptureResult -from .packet_capture_query_status_result import PacketCaptureQueryStatusResult -from .troubleshooting_parameters import TroubleshootingParameters -from .query_troubleshooting_parameters import QueryTroubleshootingParameters -from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions -from .troubleshooting_details import TroubleshootingDetails -from .troubleshooting_result import TroubleshootingResult -from .retention_policy_parameters import RetentionPolicyParameters -from .flow_log_status_parameters import FlowLogStatusParameters -from .flow_log_information import FlowLogInformation -from .patch_route_filter_rule import PatchRouteFilterRule -from .patch_route_filter import PatchRouteFilter -from .bgp_community import BGPCommunity -from .bgp_service_community import BgpServiceCommunity -from .usage_name import UsageName -from .usage import Usage -from .virtual_network_peering import VirtualNetworkPeering -from .address_space import AddressSpace -from .dhcp_options import DhcpOptions -from .virtual_network import VirtualNetwork -from .ip_address_availability_result import IPAddressAvailabilityResult -from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration -from .virtual_network_gateway_sku import VirtualNetworkGatewaySku -from .vpn_client_root_certificate import VpnClientRootCertificate -from .vpn_client_revoked_certificate import VpnClientRevokedCertificate -from .vpn_client_configuration import VpnClientConfiguration -from .bgp_settings import BgpSettings -from .bgp_peer_status import BgpPeerStatus -from .gateway_route import GatewayRoute -from .virtual_network_gateway import VirtualNetworkGateway -from .vpn_client_parameters import VpnClientParameters -from .bgp_peer_status_list_result import BgpPeerStatusListResult -from .gateway_route_list_result import GatewayRouteListResult -from .tunnel_connection_health import TunnelConnectionHealth -from .local_network_gateway import LocalNetworkGateway -from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection -from .connection_reset_shared_key import ConnectionResetSharedKey -from .connection_shared_key import ConnectionSharedKey +try: + from .resource_py3 import Resource + from .network_interface_dns_settings_py3 import NetworkInterfaceDnsSettings + from .sub_resource_py3 import SubResource + from .public_ip_address_dns_settings_py3 import PublicIPAddressDnsSettings + from .resource_navigation_link_py3 import ResourceNavigationLink + from .route_py3 import Route + from .security_rule_py3 import SecurityRule + from .application_gateway_backend_address_py3 import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool_py3 import ApplicationGatewayBackendAddressPool + from .backend_address_pool_py3 import BackendAddressPool + from .inbound_nat_rule_py3 import InboundNatRule + from .ip_configuration_py3 import IPConfiguration + from .public_ip_address_py3 import PublicIPAddress + from .network_interface_ip_configuration_py3 import NetworkInterfaceIPConfiguration + from .network_interface_py3 import NetworkInterface + from .network_security_group_py3 import NetworkSecurityGroup + from .route_table_py3 import RouteTable + from .subnet_py3 import Subnet + from .application_gateway_connection_draining_py3 import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings_py3 import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server_py3 import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings_py3 import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool_py3 import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health_py3 import ApplicationGatewayBackendHealth + from .application_gateway_sku_py3 import ApplicationGatewaySku + from .application_gateway_ssl_policy_py3 import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration_py3 import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate_py3 import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate_py3 import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration_py3 import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port_py3 import ApplicationGatewayFrontendPort + from .application_gateway_http_listener_py3 import ApplicationGatewayHttpListener + from .application_gateway_path_rule_py3 import ApplicationGatewayPathRule + from .application_gateway_probe_py3 import ApplicationGatewayProbe + from .application_gateway_request_routing_rule_py3 import ApplicationGatewayRequestRoutingRule + from .application_gateway_url_path_map_py3 import ApplicationGatewayUrlPathMap + from .application_gateway_web_application_firewall_configuration_py3 import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway_py3 import ApplicationGateway + from .dns_name_availability_result_py3 import DnsNameAvailabilityResult + from .express_route_circuit_authorization_py3 import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config_py3 import ExpressRouteCircuitPeeringConfig + from .express_route_circuit_stats_py3 import ExpressRouteCircuitStats + from .route_filter_rule_py3 import RouteFilterRule + from .express_route_circuit_peering_py3 import ExpressRouteCircuitPeering + from .route_filter_py3 import RouteFilter + from .express_route_circuit_sku_py3 import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties_py3 import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit_py3 import ExpressRouteCircuit + from .express_route_circuit_arp_table_py3 import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result_py3 import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table_py3 import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result_py3 import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary_py3 import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result_py3 import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered_py3 import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider_py3 import ExpressRouteServiceProvider + from .frontend_ip_configuration_py3 import FrontendIPConfiguration + from .load_balancing_rule_py3 import LoadBalancingRule + from .probe_py3 import Probe + from .inbound_nat_pool_py3 import InboundNatPool + from .outbound_nat_rule_py3 import OutboundNatRule + from .load_balancer_py3 import LoadBalancer + from .error_details_py3 import ErrorDetails + from .error_py3 import Error + from .azure_async_operation_result_py3 import AzureAsyncOperationResult + from .effective_network_security_group_association_py3 import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule_py3 import EffectiveNetworkSecurityRule + from .effective_network_security_group_py3 import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result_py3 import EffectiveNetworkSecurityGroupListResult + from .effective_route_py3 import EffectiveRoute + from .effective_route_list_result_py3 import EffectiveRouteListResult + from .network_watcher_py3 import NetworkWatcher + from .topology_parameters_py3 import TopologyParameters + from .topology_association_py3 import TopologyAssociation + from .topology_resource_py3 import TopologyResource + from .topology_py3 import Topology + from .verification_ip_flow_parameters_py3 import VerificationIPFlowParameters + from .verification_ip_flow_result_py3 import VerificationIPFlowResult + from .next_hop_parameters_py3 import NextHopParameters + from .next_hop_result_py3 import NextHopResult + from .security_group_view_parameters_py3 import SecurityGroupViewParameters + from .network_interface_association_py3 import NetworkInterfaceAssociation + from .subnet_association_py3 import SubnetAssociation + from .security_rule_associations_py3 import SecurityRuleAssociations + from .security_group_network_interface_py3 import SecurityGroupNetworkInterface + from .security_group_view_result_py3 import SecurityGroupViewResult + from .packet_capture_storage_location_py3 import PacketCaptureStorageLocation + from .packet_capture_filter_py3 import PacketCaptureFilter + from .packet_capture_parameters_py3 import PacketCaptureParameters + from .packet_capture_py3 import PacketCapture + from .packet_capture_result_py3 import PacketCaptureResult + from .packet_capture_query_status_result_py3 import PacketCaptureQueryStatusResult + from .troubleshooting_parameters_py3 import TroubleshootingParameters + from .query_troubleshooting_parameters_py3 import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions_py3 import TroubleshootingRecommendedActions + from .troubleshooting_details_py3 import TroubleshootingDetails + from .troubleshooting_result_py3 import TroubleshootingResult + from .retention_policy_parameters_py3 import RetentionPolicyParameters + from .flow_log_status_parameters_py3 import FlowLogStatusParameters + from .flow_log_information_py3 import FlowLogInformation + from .patch_route_filter_rule_py3 import PatchRouteFilterRule + from .patch_route_filter_py3 import PatchRouteFilter + from .bgp_community_py3 import BGPCommunity + from .bgp_service_community_py3 import BgpServiceCommunity + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .virtual_network_peering_py3 import VirtualNetworkPeering + from .address_space_py3 import AddressSpace + from .dhcp_options_py3 import DhcpOptions + from .virtual_network_py3 import VirtualNetwork + from .ip_address_availability_result_py3 import IPAddressAvailabilityResult + from .virtual_network_gateway_ip_configuration_py3 import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku_py3 import VirtualNetworkGatewaySku + from .vpn_client_root_certificate_py3 import VpnClientRootCertificate + from .vpn_client_revoked_certificate_py3 import VpnClientRevokedCertificate + from .vpn_client_configuration_py3 import VpnClientConfiguration + from .bgp_settings_py3 import BgpSettings + from .bgp_peer_status_py3 import BgpPeerStatus + from .gateway_route_py3 import GatewayRoute + from .virtual_network_gateway_py3 import VirtualNetworkGateway + from .vpn_client_parameters_py3 import VpnClientParameters + from .bgp_peer_status_list_result_py3 import BgpPeerStatusListResult + from .gateway_route_list_result_py3 import GatewayRouteListResult + from .tunnel_connection_health_py3 import TunnelConnectionHealth + from .local_network_gateway_py3 import LocalNetworkGateway + from .virtual_network_gateway_connection_py3 import VirtualNetworkGatewayConnection + from .connection_reset_shared_key_py3 import ConnectionResetSharedKey + from .connection_shared_key_py3 import ConnectionSharedKey +except (SyntaxError, ImportError): + from .resource import Resource + from .network_interface_dns_settings import NetworkInterfaceDnsSettings + from .sub_resource import SubResource + from .public_ip_address_dns_settings import PublicIPAddressDnsSettings + from .resource_navigation_link import ResourceNavigationLink + from .route import Route + from .security_rule import SecurityRule + from .application_gateway_backend_address import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool + from .backend_address_pool import BackendAddressPool + from .inbound_nat_rule import InboundNatRule + from .ip_configuration import IPConfiguration + from .public_ip_address import PublicIPAddress + from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration + from .network_interface import NetworkInterface + from .network_security_group import NetworkSecurityGroup + from .route_table import RouteTable + from .subnet import Subnet + from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health import ApplicationGatewayBackendHealth + from .application_gateway_sku import ApplicationGatewaySku + from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port import ApplicationGatewayFrontendPort + from .application_gateway_http_listener import ApplicationGatewayHttpListener + from .application_gateway_path_rule import ApplicationGatewayPathRule + from .application_gateway_probe import ApplicationGatewayProbe + from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule + from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap + from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway import ApplicationGateway + from .dns_name_availability_result import DnsNameAvailabilityResult + from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig + from .express_route_circuit_stats import ExpressRouteCircuitStats + from .route_filter_rule import RouteFilterRule + from .express_route_circuit_peering import ExpressRouteCircuitPeering + from .route_filter import RouteFilter + from .express_route_circuit_sku import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit import ExpressRouteCircuit + from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider import ExpressRouteServiceProvider + from .frontend_ip_configuration import FrontendIPConfiguration + from .load_balancing_rule import LoadBalancingRule + from .probe import Probe + from .inbound_nat_pool import InboundNatPool + from .outbound_nat_rule import OutboundNatRule + from .load_balancer import LoadBalancer + from .error_details import ErrorDetails + from .error import Error + from .azure_async_operation_result import AzureAsyncOperationResult + from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule import EffectiveNetworkSecurityRule + from .effective_network_security_group import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult + from .effective_route import EffectiveRoute + from .effective_route_list_result import EffectiveRouteListResult + from .network_watcher import NetworkWatcher + from .topology_parameters import TopologyParameters + from .topology_association import TopologyAssociation + from .topology_resource import TopologyResource + from .topology import Topology + from .verification_ip_flow_parameters import VerificationIPFlowParameters + from .verification_ip_flow_result import VerificationIPFlowResult + from .next_hop_parameters import NextHopParameters + from .next_hop_result import NextHopResult + from .security_group_view_parameters import SecurityGroupViewParameters + from .network_interface_association import NetworkInterfaceAssociation + from .subnet_association import SubnetAssociation + from .security_rule_associations import SecurityRuleAssociations + from .security_group_network_interface import SecurityGroupNetworkInterface + from .security_group_view_result import SecurityGroupViewResult + from .packet_capture_storage_location import PacketCaptureStorageLocation + from .packet_capture_filter import PacketCaptureFilter + from .packet_capture_parameters import PacketCaptureParameters + from .packet_capture import PacketCapture + from .packet_capture_result import PacketCaptureResult + from .packet_capture_query_status_result import PacketCaptureQueryStatusResult + from .troubleshooting_parameters import TroubleshootingParameters + from .query_troubleshooting_parameters import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions + from .troubleshooting_details import TroubleshootingDetails + from .troubleshooting_result import TroubleshootingResult + from .retention_policy_parameters import RetentionPolicyParameters + from .flow_log_status_parameters import FlowLogStatusParameters + from .flow_log_information import FlowLogInformation + from .patch_route_filter_rule import PatchRouteFilterRule + from .patch_route_filter import PatchRouteFilter + from .bgp_community import BGPCommunity + from .bgp_service_community import BgpServiceCommunity + from .usage_name import UsageName + from .usage import Usage + from .virtual_network_peering import VirtualNetworkPeering + from .address_space import AddressSpace + from .dhcp_options import DhcpOptions + from .virtual_network import VirtualNetwork + from .ip_address_availability_result import IPAddressAvailabilityResult + from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku import VirtualNetworkGatewaySku + from .vpn_client_root_certificate import VpnClientRootCertificate + from .vpn_client_revoked_certificate import VpnClientRevokedCertificate + from .vpn_client_configuration import VpnClientConfiguration + from .bgp_settings import BgpSettings + from .bgp_peer_status import BgpPeerStatus + from .gateway_route import GatewayRoute + from .virtual_network_gateway import VirtualNetworkGateway + from .vpn_client_parameters import VpnClientParameters + from .bgp_peer_status_list_result import BgpPeerStatusListResult + from .gateway_route_list_result import GatewayRouteListResult + from .tunnel_connection_health import TunnelConnectionHealth + from .local_network_gateway import LocalNetworkGateway + from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection + from .connection_reset_shared_key import ConnectionResetSharedKey + from .connection_shared_key import ConnectionSharedKey from .network_interface_paged import NetworkInterfacePaged from .application_gateway_paged import ApplicationGatewayPaged from .express_route_circuit_authorization_paged import ExpressRouteCircuitAuthorizationPaged diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/address_space.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/address_space.py index d7050c78a457..fbf42c9e0ade 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/address_space.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/address_space.py @@ -25,6 +25,6 @@ class AddressSpace(Model): 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, } - def __init__(self, address_prefixes=None): - super(AddressSpace, self).__init__() - self.address_prefixes = address_prefixes + def __init__(self, **kwargs): + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = kwargs.get('address_prefixes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/address_space_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/address_space_py3.py new file mode 100644 index 000000000000..9794cc805efa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/address_space_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AddressSpace(Model): + """AddressSpace contains an array of IP address ranges that can be used by + subnets of the virtual network. + + :param address_prefixes: A list of address blocks reserved for this + virtual network in CIDR notation. + :type address_prefixes: list[str] + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__(self, *, address_prefixes=None, **kwargs) -> None: + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = address_prefixes diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway.py index 6ce3a10ebc41..c9beb811f050 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway.py @@ -126,23 +126,23 @@ class ApplicationGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, web_application_firewall_configuration=None, resource_guid=None, provisioning_state=None, etag=None): - super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.ssl_policy = ssl_policy + def __init__(self, **kwargs): + super(ApplicationGateway, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.ssl_policy = kwargs.get('ssl_policy', None) self.operational_state = None - self.gateway_ip_configurations = gateway_ip_configurations - self.authentication_certificates = authentication_certificates - self.ssl_certificates = ssl_certificates - self.frontend_ip_configurations = frontend_ip_configurations - self.frontend_ports = frontend_ports - self.probes = probes - self.backend_address_pools = backend_address_pools - self.backend_http_settings_collection = backend_http_settings_collection - self.http_listeners = http_listeners - self.url_path_maps = url_path_maps - self.request_routing_rules = request_routing_rules - self.web_application_firewall_configuration = web_application_firewall_configuration - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.gateway_ip_configurations = kwargs.get('gateway_ip_configurations', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.ssl_certificates = kwargs.get('ssl_certificates', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.frontend_ports = kwargs.get('frontend_ports', None) + self.probes = kwargs.get('probes', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) + self.http_listeners = kwargs.get('http_listeners', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.web_application_firewall_configuration = kwargs.get('web_application_firewall_configuration', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_authentication_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_authentication_certificate.py index a492a39ca080..c7fb4d9a7226 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_authentication_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_authentication_certificate.py @@ -39,9 +39,9 @@ class ApplicationGatewayAuthenticationCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, data=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id) - self.data = data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayAuthenticationCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_authentication_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_authentication_certificate_py3.py new file mode 100644 index 000000000000..2ab1073a0e7d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_authentication_certificate_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayAuthenticationCertificate(SubResource): + """Authentication certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Certificate public data. + :type data: str + :param provisioning_state: Provisioning state of the authentication + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address.py index 6005027d0845..e7a61fe1705c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address.py @@ -26,7 +26,7 @@ class ApplicationGatewayBackendAddress(Model): 'ip_address': {'key': 'ipAddress', 'type': 'str'}, } - def __init__(self, fqdn=None, ip_address=None): - super(ApplicationGatewayBackendAddress, self).__init__() - self.fqdn = fqdn - self.ip_address = ip_address + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = kwargs.get('fqdn', None) + self.ip_address = kwargs.get('ip_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address_pool.py index 812def18b60f..8c33a4258461 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address_pool.py @@ -44,10 +44,10 @@ class ApplicationGatewayBackendAddressPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayBackendAddressPool, self).__init__(id=id) - self.backend_ip_configurations = backend_ip_configurations - self.backend_addresses = backend_addresses - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddressPool, self).__init__(**kwargs) + self.backend_ip_configurations = kwargs.get('backend_ip_configurations', None) + self.backend_addresses = kwargs.get('backend_addresses', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address_pool_py3.py new file mode 100644 index 000000000000..70845cea3d39 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address_pool_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + :param id: Resource ID. + :type id: str + :param backend_ip_configurations: Collection of references to IPs defined + in network interfaces. + :type backend_ip_configurations: + list[~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses + :type backend_addresses: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendAddress] + :param provisioning_state: Provisioning state of the backend address pool + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Resource that is unique within a resource group. This name + can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = backend_ip_configurations + self.backend_addresses = backend_addresses + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address_py3.py new file mode 100644 index 000000000000..d18e476244d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_address_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendAddress(Model): + """Backend address of an application gateway. + + :param fqdn: Fully qualified domain name (FQDN). + :type fqdn: str + :param ip_address: IP address + :type ip_address: str + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__(self, *, fqdn: str=None, ip_address: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = fqdn + self.ip_address = ip_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health.py index ba16d1e0414f..e5a0e171b52f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health.py @@ -24,6 +24,6 @@ class ApplicationGatewayBackendHealth(Model): 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, } - def __init__(self, backend_address_pools=None): - super(ApplicationGatewayBackendHealth, self).__init__() - self.backend_address_pools = backend_address_pools + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = kwargs.get('backend_address_pools', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_http_settings.py index d55db78f5faf..ebf9808dc3ad 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_http_settings.py @@ -29,7 +29,7 @@ class ApplicationGatewayBackendHealthHttpSettings(Model): 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, } - def __init__(self, backend_http_settings=None, servers=None): - super(ApplicationGatewayBackendHealthHttpSettings, self).__init__() - self.backend_http_settings = backend_http_settings - self.servers = servers + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.servers = kwargs.get('servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_http_settings_py3.py new file mode 100644 index 000000000000..6dbb8a4175be --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_http_settings_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthHttpSettings(Model): + """Application gateway BackendHealthHttp settings. + + :param backend_http_settings: Reference of an + ApplicationGatewayBackendHttpSettings resource. + :type backend_http_settings: + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendHealthServer] + """ + + _attribute_map = { + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, + 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, + } + + def __init__(self, *, backend_http_settings=None, servers=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = backend_http_settings + self.servers = servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_pool.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_pool.py index 3d5126c672f9..cac0d33f561a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_pool.py @@ -30,7 +30,7 @@ class ApplicationGatewayBackendHealthPool(Model): 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, } - def __init__(self, backend_address_pool=None, backend_http_settings_collection=None): - super(ApplicationGatewayBackendHealthPool, self).__init__() - self.backend_address_pool = backend_address_pool - self.backend_http_settings_collection = backend_http_settings_collection + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_pool_py3.py new file mode 100644 index 000000000000..6a13f259ddd2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_pool_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthPool(Model): + """Application gateway BackendHealth pool. + + :param backend_address_pool: Reference of an + ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of + ApplicationGatewayBackendHealthHttpSettings resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, + } + + def __init__(self, *, backend_address_pool=None, backend_http_settings_collection=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_http_settings_collection = backend_http_settings_collection diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_py3.py new file mode 100644 index 000000000000..6a9df0329b2a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealth(Model): + """List of ApplicationGatewayBackendHealthPool resources. + + :param backend_address_pools: + :type backend_address_pools: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendHealthPool] + """ + + _attribute_map = { + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, + } + + def __init__(self, *, backend_address_pools=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = backend_address_pools diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_server.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_server.py index 6173dd233d57..11b781d8a6d3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_server.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_server.py @@ -32,8 +32,8 @@ class ApplicationGatewayBackendHealthServer(Model): 'health': {'key': 'health', 'type': 'str'}, } - def __init__(self, address=None, ip_configuration=None, health=None): - super(ApplicationGatewayBackendHealthServer, self).__init__() - self.address = address - self.ip_configuration = ip_configuration - self.health = health + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + self.ip_configuration = kwargs.get('ip_configuration', None) + self.health = kwargs.get('health', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_server_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_server_py3.py new file mode 100644 index 000000000000..88dfd1ca4e75 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_server_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthServer(Model): + """Application gateway backendhealth http settings. + + :param address: IP address or FQDN of backend server. + :type address: str + :param ip_configuration: Reference of IP configuration of backend server. + :type ip_configuration: ~azure.mgmt.network.v2016_12_01.models.SubResource + :param health: Health of backend server. Possible values are: 'Unknown', + 'Up', 'Down', and 'Partial'. Possible values include: 'Unknown', 'Up', + 'Down', 'Partial' + :type health: str or + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendHealthServerHealth + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': 'SubResource'}, + 'health': {'key': 'health', 'type': 'str'}, + } + + def __init__(self, *, address: str=None, ip_configuration=None, health=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = address + self.ip_configuration = ip_configuration + self.health = health diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_http_settings.py index 50ed0ca7d826..c8e356fdc2f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_http_settings.py @@ -66,15 +66,15 @@ class ApplicationGatewayBackendHttpSettings(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, port=None, protocol=None, cookie_based_affinity=None, request_timeout=None, probe=None, authentication_certificates=None, provisioning_state=None, connection_draining=None, name=None, etag=None): - super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id) - self.port = port - self.protocol = protocol - self.cookie_based_affinity = cookie_based_affinity - self.request_timeout = request_timeout - self.probe = probe - self.authentication_certificates = authentication_certificates - self.provisioning_state = provisioning_state - self.connection_draining = connection_draining - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHttpSettings, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.protocol = kwargs.get('protocol', None) + self.cookie_based_affinity = kwargs.get('cookie_based_affinity', None) + self.request_timeout = kwargs.get('request_timeout', None) + self.probe = kwargs.get('probe', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.connection_draining = kwargs.get('connection_draining', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_http_settings_py3.py new file mode 100644 index 000000000000..b737cdb7d109 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_backend_http_settings_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendHttpSettings(SubResource): + """Backend address pool settings of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Port + :type port: int + :param protocol: Protocol. Possible values are: 'Http' and 'Https'. + Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayProtocol + :param cookie_based_affinity: Cookie based affinity. Possible values are: + 'Enabled' and 'Disabled'. Possible values include: 'Enabled', 'Disabled' + :type cookie_based_affinity: str or + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayCookieBasedAffinity + :param request_timeout: Request timeout in seconds. Application Gateway + will fail the request if response is not received within RequestTimeout. + Acceptable values are from 1 second to 86400 seconds. + :type request_timeout: int + :param probe: Probe resource of an application gateway. + :type probe: ~azure.mgmt.network.v2016_12_01.models.SubResource + :param authentication_certificates: Array of references to application + gateway authentication certificates. + :type authentication_certificates: + list[~azure.mgmt.network.v2016_12_01.models.SubResource] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param connection_draining: Connection draining of the backend http + settings resource. + :type connection_draining: + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayConnectionDraining + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, + 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'connection_draining': {'key': 'properties.connectionDraining', 'type': 'ApplicationGatewayConnectionDraining'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, protocol=None, cookie_based_affinity=None, request_timeout: int=None, probe=None, authentication_certificates=None, provisioning_state: str=None, connection_draining=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id, **kwargs) + self.port = port + self.protocol = protocol + self.cookie_based_affinity = cookie_based_affinity + self.request_timeout = request_timeout + self.probe = probe + self.authentication_certificates = authentication_certificates + self.provisioning_state = provisioning_state + self.connection_draining = connection_draining + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_connection_draining.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_connection_draining.py index 8f9b88b571e2..531b3cb05dd3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_connection_draining.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_connection_draining.py @@ -17,10 +17,12 @@ class ApplicationGatewayConnectionDraining(Model): active for a specified time after the backend server got removed from the configuration. - :param enabled: Whether connection draining is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. :type enabled: bool - :param drain_timeout_in_sec: The number of seconds connection draining is - active. Acceptable values are from 1 second to 3600 seconds. + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. :type drain_timeout_in_sec: int """ @@ -34,7 +36,7 @@ class ApplicationGatewayConnectionDraining(Model): 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, } - def __init__(self, enabled, drain_timeout_in_sec): - super(ApplicationGatewayConnectionDraining, self).__init__() - self.enabled = enabled - self.drain_timeout_in_sec = drain_timeout_in_sec + def __init__(self, **kwargs): + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.drain_timeout_in_sec = kwargs.get('drain_timeout_in_sec', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_connection_draining_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_connection_draining_py3.py new file mode 100644 index 000000000000..c46fb01cae72 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_connection_draining_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayConnectionDraining(Model): + """Connection draining allows open connections to a backend server to be + active for a specified time after the backend server got removed from the + configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. + :type enabled: bool + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. + :type drain_timeout_in_sec: int + """ + + _validation = { + 'enabled': {'required': True}, + 'drain_timeout_in_sec': {'required': True, 'maximum': 3600, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool, drain_timeout_in_sec: int, **kwargs) -> None: + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = enabled + self.drain_timeout_in_sec = drain_timeout_in_sec diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_ip_configuration.py index 475b6a23d5c9..691443729a2d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_ip_configuration.py @@ -52,12 +52,12 @@ class ApplicationGatewayFrontendIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..b74d68b34143 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_ip_configuration_py3.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): + """Frontend IP configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param private_ip_address: PrivateIPAddress of the network interface IP + Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: PrivateIP allocation method. Possible + values are: 'Static' and 'Dynamic'. Possible values include: 'Static', + 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2016_12_01.models.IPAllocationMethod + :param subnet: Reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2016_12_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param provisioning_state: Provisioning state of the public IP resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_port.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_port.py index 1555284f9949..a8c5b703f4e6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_port.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_port.py @@ -38,9 +38,9 @@ class ApplicationGatewayFrontendPort(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, port=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayFrontendPort, self).__init__(id=id) - self.port = port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendPort, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_port_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_port_py3.py new file mode 100644 index 000000000000..557923221748 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_frontend_port_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Frontend port + :type port: int + :param provisioning_state: Provisioning state of the frontend port + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendPort, self).__init__(id=id, **kwargs) + self.port = port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_http_listener.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_http_listener.py index b7d05fabb74c..8d5dffadb3f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_http_listener.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_http_listener.py @@ -59,14 +59,14 @@ class ApplicationGatewayHttpListener(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name=None, ssl_certificate=None, require_server_name_indication=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayHttpListener, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.frontend_port = frontend_port - self.protocol = protocol - self.host_name = host_name - self.ssl_certificate = ssl_certificate - self.require_server_name_indication = require_server_name_indication - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayHttpListener, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.protocol = kwargs.get('protocol', None) + self.host_name = kwargs.get('host_name', None) + self.ssl_certificate = kwargs.get('ssl_certificate', None) + self.require_server_name_indication = kwargs.get('require_server_name_indication', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_http_listener_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_http_listener_py3.py new file mode 100644 index 000000000000..2aabbc736c3d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_http_listener_py3.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayHttpListener(SubResource): + """Http listener of an application gateway. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: Frontend IP configuration resource of an + application gateway. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2016_12_01.models.SubResource + :param protocol: Protocol. Possible values are: 'Http' and 'Https'. + Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayProtocol + :param host_name: Host name of HTTP listener. + :type host_name: str + :param ssl_certificate: SSL certificate resource of an application + gateway. + :type ssl_certificate: ~azure.mgmt.network.v2016_12_01.models.SubResource + :param require_server_name_indication: Applicable only if protocol is + https. Enables SNI for multi-hosting. + :type require_server_name_indication: bool + :param provisioning_state: Provisioning state of the HTTP listener + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, + 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name: str=None, ssl_certificate=None, require_server_name_indication: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayHttpListener, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.frontend_port = frontend_port + self.protocol = protocol + self.host_name = host_name + self.ssl_certificate = ssl_certificate + self.require_server_name_indication = require_server_name_indication + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ip_configuration.py index 87ffa3f66063..69330ca6bc8e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ip_configuration.py @@ -41,9 +41,9 @@ class ApplicationGatewayIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, subnet=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayIPConfiguration, self).__init__(id=id) - self.subnet = subnet - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayIPConfiguration, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..b6f9529dbf27 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ip_configuration_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 + private IP configuration is allowed. + + :param id: Resource ID. + :type id: str + :param subnet: Reference of the subnet resource. A subnet from where + application gateway gets its private address. + :type subnet: ~azure.mgmt.network.v2016_12_01.models.SubResource + :param provisioning_state: Provisioning state of the application gateway + subnet resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, subnet=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.subnet = subnet + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_path_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_path_rule.py index 248d79bbe599..37d2777d80ed 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_path_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_path_rule.py @@ -48,11 +48,11 @@ class ApplicationGatewayPathRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, paths=None, backend_address_pool=None, backend_http_settings=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayPathRule, self).__init__(id=id) - self.paths = paths - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayPathRule, self).__init__(**kwargs) + self.paths = kwargs.get('paths', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_path_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_path_rule_py3.py new file mode 100644 index 000000000000..d15ae3fa6f95 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_path_rule_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayPathRule(SubResource): + """Path rule of URL path map of an application gateway. + + :param id: Resource ID. + :type id: str + :param paths: Path rules of URL path map. + :type paths: list[str] + :param backend_address_pool: Backend address pool resource of URL path + map. + :type backend_address_pool: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param backend_http_settings: Backend http settings resource of URL path + map. + :type backend_http_settings: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param provisioning_state: Path rule of URL path map resource. Possible + values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'paths': {'key': 'properties.paths', 'type': '[str]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, paths=None, backend_address_pool=None, backend_http_settings=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayPathRule, self).__init__(id=id, **kwargs) + self.paths = paths + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_probe.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_probe.py index 96c8b51e380e..1208d86ded07 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_probe.py @@ -62,14 +62,14 @@ class ApplicationGatewayProbe(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, protocol=None, host=None, path=None, interval=None, timeout=None, unhealthy_threshold=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayProbe, self).__init__(id=id) - self.protocol = protocol - self.host = host - self.path = path - self.interval = interval - self.timeout = timeout - self.unhealthy_threshold = unhealthy_threshold - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayProbe, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.host = kwargs.get('host', None) + self.path = kwargs.get('path', None) + self.interval = kwargs.get('interval', None) + self.timeout = kwargs.get('timeout', None) + self.unhealthy_threshold = kwargs.get('unhealthy_threshold', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_probe_py3.py new file mode 100644 index 000000000000..e378e240c909 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_probe_py3.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayProbe(SubResource): + """Probe of the application gateway. + + :param id: Resource ID. + :type id: str + :param protocol: Protocol. Possible values are: 'Http' and 'Https'. + Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is + sent to ://: + :type path: str + :param interval: The probing interval in seconds. This is the time + interval between two consecutive probes. Acceptable values are from 1 + second to 86400 seconds. + :type interval: int + :param timeout: the probe timeout in seconds. Probe marked as failed if + valid response is not received with this timeout period. Acceptable values + are from 1 second to 86400 seconds. + :type timeout: int + :param unhealthy_threshold: The probe retry count. Backend server is + marked down after consecutive probe failure count reaches + UnhealthyThreshold. Acceptable values are from 1 second to 20. + :type unhealthy_threshold: int + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host': {'key': 'properties.host', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, protocol=None, host: str=None, path: str=None, interval: int=None, timeout: int=None, unhealthy_threshold: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayProbe, self).__init__(id=id, **kwargs) + self.protocol = protocol + self.host = host + self.path = path + self.interval = interval + self.timeout = timeout + self.unhealthy_threshold = unhealthy_threshold + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_py3.py new file mode 100644 index 000000000000..27d0b9f55d96 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_py3.py @@ -0,0 +1,148 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGateway(Resource): + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewaySslPolicy + :ivar operational_state: Operational state of the application gateway + resource. Possible values are: 'Stopped', 'Started', 'Running', and + 'Stopping'. Possible values include: 'Stopped', 'Starting', 'Running', + 'Stopping' + :vartype operational_state: str or + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayOperationalState + :param gateway_ip_configurations: Subnets of application the gateway + resource. + :type gateway_ip_configurations: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayIPConfiguration] + :param authentication_certificates: Authentication certificates of the + application gateway resource. + :type authentication_certificates: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayAuthenticationCertificate] + :param ssl_certificates: SSL certificates of the application gateway + resource. + :type ssl_certificates: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewaySslCertificate] + :param frontend_ip_configurations: Frontend IP addresses of the + application gateway resource. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayFrontendIPConfiguration] + :param frontend_ports: Frontend ports of the application gateway resource. + :type frontend_ports: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayProbe] + :param backend_address_pools: Backend address pool of the application + gateway resource. + :type backend_address_pools: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendAddressPool] + :param backend_http_settings_collection: Backend http settings of the + application gateway resource. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendHttpSettings] + :param http_listeners: Http listeners of the application gateway resource. + :type http_listeners: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayHttpListener] + :param url_path_maps: URL path map of the application gateway resource. + :type url_path_maps: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application + gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayRequestRoutingRule] + :param web_application_firewall_configuration: Web application firewall + configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param resource_guid: Resource GUID property of the application gateway + resource. + :type resource_guid: str + :param provisioning_state: Provisioning state of the application gateway + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operational_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, + 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, + 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, + 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, + 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, + 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, web_application_firewall_configuration=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.ssl_policy = ssl_policy + self.operational_state = None + self.gateway_ip_configurations = gateway_ip_configurations + self.authentication_certificates = authentication_certificates + self.ssl_certificates = ssl_certificates + self.frontend_ip_configurations = frontend_ip_configurations + self.frontend_ports = frontend_ports + self.probes = probes + self.backend_address_pools = backend_address_pools + self.backend_http_settings_collection = backend_http_settings_collection + self.http_listeners = http_listeners + self.url_path_maps = url_path_maps + self.request_routing_rules = request_routing_rules + self.web_application_firewall_configuration = web_application_firewall_configuration + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_request_routing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_request_routing_rule.py index 56816a1bdc40..12b85bf44d62 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_request_routing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_request_routing_rule.py @@ -56,13 +56,13 @@ class ApplicationGatewayRequestRoutingRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id) - self.rule_type = rule_type - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.http_listener = http_listener - self.url_path_map = url_path_map - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayRequestRoutingRule, self).__init__(**kwargs) + self.rule_type = kwargs.get('rule_type', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.http_listener = kwargs.get('http_listener', None) + self.url_path_map = kwargs.get('url_path_map', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_request_routing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_request_routing_rule_py3.py new file mode 100644 index 000000000000..62086847d486 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_request_routing_rule_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRequestRoutingRule(SubResource): + """Request routing rule of an application gateway. + + :param id: Resource ID. + :type id: str + :param rule_type: Rule type. Possible values are: 'Basic' and + 'PathBasedRouting'. Possible values include: 'Basic', 'PathBasedRouting' + :type rule_type: str or + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayRequestRoutingRuleType + :param backend_address_pool: Backend address pool resource of the + application gateway. + :type backend_address_pool: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param backend_http_settings: Frontend port resource of the application + gateway. + :type backend_http_settings: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2016_12_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2016_12_01.models.SubResource + :param provisioning_state: Provisioning state of the request routing rule + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, + 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id, **kwargs) + self.rule_type = rule_type + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.http_listener = http_listener + self.url_path_map = url_path_map + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_sku.py index c902412327b8..4420e5da244d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_sku.py @@ -35,8 +35,8 @@ class ApplicationGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(ApplicationGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_sku_py3.py new file mode 100644 index 000000000000..af1a3eadcdd7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_sku_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySku(Model): + """SKU of an application gateway. + + :param name: Name of an application gateway SKU. Possible values are: + 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', and + 'WAF_Large'. Possible values include: 'Standard_Small', 'Standard_Medium', + 'Standard_Large', 'WAF_Medium', 'WAF_Large' + :type name: str or + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewaySkuName + :param tier: Tier of an application gateway. Possible values are: + 'Standard' and 'WAF'. Possible values include: 'Standard', 'WAF' + :type tier: str or + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayTier + :param capacity: Capacity (instance count) of an application gateway. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_certificate.py index b29e94104a25..b3538fc5d66b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_certificate.py @@ -47,11 +47,11 @@ class ApplicationGatewaySslCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, data=None, password=None, public_cert_data=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewaySslCertificate, self).__init__(id=id) - self.data = data - self.password = password - self.public_cert_data = public_cert_data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewaySslCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.password = kwargs.get('password', None) + self.public_cert_data = kwargs.get('public_cert_data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_certificate_py3.py new file mode 100644 index 000000000000..f00c4fb2302e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_certificate_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Base-64 encoded pfx certificate. Only applicable in PUT + Request. + :type data: str + :param password: Password for the pfx file specified in data. Only + applicable in PUT request. + :type password: str + :param public_cert_data: Base-64 encoded Public cert data corresponding to + pfx specified in data. Only applicable in GET request. + :type public_cert_data: str + :param provisioning_state: Provisioning state of the SSL certificate + resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, password: str=None, public_cert_data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewaySslCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.password = password + self.public_cert_data = public_cert_data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_policy.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_policy.py index f5109cc64c31..e4ab5ddf4429 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_policy.py @@ -25,6 +25,6 @@ class ApplicationGatewaySslPolicy(Model): 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, } - def __init__(self, disabled_ssl_protocols=None): - super(ApplicationGatewaySslPolicy, self).__init__() - self.disabled_ssl_protocols = disabled_ssl_protocols + def __init__(self, **kwargs): + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = kwargs.get('disabled_ssl_protocols', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_policy_py3.py new file mode 100644 index 000000000000..af90809ca730 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_ssl_policy_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySslPolicy(Model): + """Application gateway SSL policy. + + :param disabled_ssl_protocols: SSL protocols to be disabled on application + gateway. Possible values are: 'TLSv1_0', 'TLSv1_1', and 'TLSv1_2'. + :type disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewaySslProtocol] + """ + + _attribute_map = { + 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, + } + + def __init__(self, *, disabled_ssl_protocols=None, **kwargs) -> None: + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = disabled_ssl_protocols diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_url_path_map.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_url_path_map.py index 1bd236906c2e..59e8ed18c3ed 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_url_path_map.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_url_path_map.py @@ -50,11 +50,11 @@ class ApplicationGatewayUrlPathMap(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, default_backend_address_pool=None, default_backend_http_settings=None, path_rules=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayUrlPathMap, self).__init__(id=id) - self.default_backend_address_pool = default_backend_address_pool - self.default_backend_http_settings = default_backend_http_settings - self.path_rules = path_rules - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayUrlPathMap, self).__init__(**kwargs) + self.default_backend_address_pool = kwargs.get('default_backend_address_pool', None) + self.default_backend_http_settings = kwargs.get('default_backend_http_settings', None) + self.path_rules = kwargs.get('path_rules', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_url_path_map_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_url_path_map_py3.py new file mode 100644 index 000000000000..6c1e95fe7e92 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_url_path_map_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayUrlPathMap(SubResource): + """UrlPathMaps give a url path to the backend mapping information for + PathBasedRouting. + + :param id: Resource ID. + :type id: str + :param default_backend_address_pool: Default backend address pool resource + of URL path map. + :type default_backend_address_pool: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param default_backend_http_settings: Default backend http settings + resource of URL path map. + :type default_backend_http_settings: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayPathRule] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, + 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, default_backend_address_pool=None, default_backend_http_settings=None, path_rules=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayUrlPathMap, self).__init__(id=id, **kwargs) + self.default_backend_address_pool = default_backend_address_pool + self.default_backend_http_settings = default_backend_http_settings + self.path_rules = path_rules + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_web_application_firewall_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_web_application_firewall_configuration.py index 67920fde18bb..218f6edd2dcf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_web_application_firewall_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_web_application_firewall_configuration.py @@ -15,7 +15,10 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): """Application gateway web application firewall configuration. - :param enabled: Whether the web application firewall is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. :type enabled: bool :param firewall_mode: Web application firewall mode. Possible values are: 'Detection' and 'Prevention'. Possible values include: 'Detection', @@ -33,7 +36,7 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, } - def __init__(self, enabled, firewall_mode=None): - super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__() - self.enabled = enabled - self.firewall_mode = firewall_mode + def __init__(self, **kwargs): + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.firewall_mode = kwargs.get('firewall_mode', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_web_application_firewall_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_web_application_firewall_configuration_py3.py new file mode 100644 index 000000000000..1bba9dff61f4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/application_gateway_web_application_firewall_configuration_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayWebApplicationFirewallConfiguration(Model): + """Application gateway web application firewall configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. + :type enabled: bool + :param firewall_mode: Web application firewall mode. Possible values are: + 'Detection' and 'Prevention'. Possible values include: 'Detection', + 'Prevention' + :type firewall_mode: str or + ~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayFirewallMode + """ + + _validation = { + 'enabled': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool, firewall_mode=None, **kwargs) -> None: + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = enabled + self.firewall_mode = firewall_mode diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/azure_async_operation_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/azure_async_operation_result.py index d5eb8785314d..14a6dd0736af 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/azure_async_operation_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/azure_async_operation_result.py @@ -36,7 +36,7 @@ class AzureAsyncOperationResult(Model): 'error': {'key': 'error', 'type': 'Error'}, } - def __init__(self, status=None, error=None): - super(AzureAsyncOperationResult, self).__init__() - self.status = status - self.error = error + def __init__(self, **kwargs): + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/azure_async_operation_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/azure_async_operation_result_py3.py new file mode 100644 index 000000000000..b44bed58a4c3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/azure_async_operation_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureAsyncOperationResult(Model): + """The response body contains the status of the specified asynchronous + operation, indicating whether it has succeeded, is in progress, or has + failed. Note that this status is distinct from the HTTP status code + returned for the Get Operation Status operation itself. If the asynchronous + operation succeeded, the response body includes the HTTP status code for + the successful request. If the asynchronous operation failed, the response + body includes the HTTP status code for the failed request and error + information regarding the failure. + + :param status: Status of the Azure async operation. Possible values are: + 'InProgress', 'Succeeded', and 'Failed'. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or + ~azure.mgmt.network.v2016_12_01.models.NetworkOperationStatus + :param error: + :type error: ~azure.mgmt.network.v2016_12_01.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, status=None, error=None, **kwargs) -> None: + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/backend_address_pool.py index 14fdcaceaf0a..f540b093796a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/backend_address_pool.py @@ -59,11 +59,11 @@ class BackendAddressPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, provisioning_state=None, name=None, etag=None): - super(BackendAddressPool, self).__init__(id=id) + def __init__(self, **kwargs): + super(BackendAddressPool, self).__init__(**kwargs) self.backend_ip_configurations = None self.load_balancing_rules = None self.outbound_nat_rule = None - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/backend_address_pool_py3.py new file mode 100644 index 000000000000..e8e4610e434f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/backend_address_pool_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class BackendAddressPool(SubResource): + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar backend_ip_configurations: Gets collection of references to IP + addresses defined in network interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: Gets load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2016_12_01.models.SubResource] + :ivar outbound_nat_rule: Gets outbound rules that use this backend address + pool. + :vartype outbound_nat_rule: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param provisioning_state: Get provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configurations': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'outbound_nat_rule': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'outbound_nat_rule': {'key': 'properties.outboundNatRule', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(BackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = None + self.load_balancing_rules = None + self.outbound_nat_rule = None + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_community.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_community.py index a2162c1ecfec..fdb963cfc21f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_community.py @@ -35,9 +35,9 @@ class BGPCommunity(Model): 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, } - def __init__(self, service_supported_region=None, community_name=None, community_value=None, community_prefixes=None): - super(BGPCommunity, self).__init__() - self.service_supported_region = service_supported_region - self.community_name = community_name - self.community_value = community_value - self.community_prefixes = community_prefixes + def __init__(self, **kwargs): + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = kwargs.get('service_supported_region', None) + self.community_name = kwargs.get('community_name', None) + self.community_value = kwargs.get('community_value', None) + self.community_prefixes = kwargs.get('community_prefixes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_community_py3.py new file mode 100644 index 000000000000..da0a79772a08 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_community_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BGPCommunity(Model): + """Contains bgp community information offered in Service Community resources. + + :param service_supported_region: The region which the service support. + e.g. For O365, region is Global. + :type service_supported_region: str + :param community_name: The name of the bgp community. e.g. Skype. + :type community_name: str + :param community_value: The value of the bgp community. For more + information: + https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + :type community_value: str + :param community_prefixes: The prefixes that the bgp community contains. + :type community_prefixes: list[str] + """ + + _attribute_map = { + 'service_supported_region': {'key': 'serviceSupportedRegion', 'type': 'str'}, + 'community_name': {'key': 'communityName', 'type': 'str'}, + 'community_value': {'key': 'communityValue', 'type': 'str'}, + 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, + } + + def __init__(self, *, service_supported_region: str=None, community_name: str=None, community_value: str=None, community_prefixes=None, **kwargs) -> None: + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = service_supported_region + self.community_name = community_name + self.community_value = community_value + self.community_prefixes = community_prefixes diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status.py index edcdaa35ccae..c826e3ee02fa 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status.py @@ -59,8 +59,8 @@ class BgpPeerStatus(Model): 'messages_received': {'key': 'messagesReceived', 'type': 'int'}, } - def __init__(self): - super(BgpPeerStatus, self).__init__() + def __init__(self, **kwargs): + super(BgpPeerStatus, self).__init__(**kwargs) self.local_address = None self.neighbor = None self.asn = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status_list_result.py index 51c9e30f402f..d8306e6ef66e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status_list_result.py @@ -23,6 +23,6 @@ class BgpPeerStatusListResult(Model): 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, } - def __init__(self, value=None): - super(BgpPeerStatusListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status_list_result_py3.py new file mode 100644 index 000000000000..9e325c232d0f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatusListResult(Model): + """Response for list BGP peer status API service call. + + :param value: List of BGP peers + :type value: list[~azure.mgmt.network.v2016_12_01.models.BgpPeerStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status_py3.py new file mode 100644 index 000000000000..07c941ed2927 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_peer_status_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatus(Model): + """BgpPeerStatus. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The virtual network gateway's local address + :vartype local_address: str + :ivar neighbor: The remote BGP peer + :vartype neighbor: str + :ivar asn: The autonomous system number of the remote BGP peer + :vartype asn: int + :ivar state: The BGP peer state. Possible values include: 'Unknown', + 'Stopped', 'Idle', 'Connecting', 'Connected' + :vartype state: str or ~azure.mgmt.network.v2016_12_01.models.BgpPeerState + :ivar connected_duration: For how long the peering has been up + :vartype connected_duration: str + :ivar routes_received: The number of routes learned from this peer + :vartype routes_received: long + :ivar messages_sent: The number of BGP messages sent + :vartype messages_sent: long + :ivar messages_received: The number of BGP messages received + :vartype messages_received: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'neighbor': {'readonly': True}, + 'asn': {'readonly': True}, + 'state': {'readonly': True}, + 'connected_duration': {'readonly': True}, + 'routes_received': {'readonly': True}, + 'messages_sent': {'readonly': True}, + 'messages_received': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'str'}, + 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, + 'routes_received': {'key': 'routesReceived', 'type': 'long'}, + 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, + 'messages_received': {'key': 'messagesReceived', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(BgpPeerStatus, self).__init__(**kwargs) + self.local_address = None + self.neighbor = None + self.asn = None + self.state = None + self.connected_duration = None + self.routes_received = None + self.messages_sent = None + self.messages_received = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_service_community.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_service_community.py index 714d2d82c404..c37a78f35f42 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_service_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_service_community.py @@ -50,7 +50,7 @@ class BgpServiceCommunity(Resource): 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, } - def __init__(self, id=None, location=None, tags=None, service_name=None, bgp_communities=None): - super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags) - self.service_name = service_name - self.bgp_communities = bgp_communities + def __init__(self, **kwargs): + super(BgpServiceCommunity, self).__init__(**kwargs) + self.service_name = kwargs.get('service_name', None) + self.bgp_communities = kwargs.get('bgp_communities', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_service_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_service_community_py3.py new file mode 100644 index 000000000000..827a1906a32b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_service_community_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BgpServiceCommunity(Resource): + """Service Community Properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param service_name: The name of the bgp community. e.g. Skype. + :type service_name: str + :param bgp_communities: Get a list of bgp communities. + :type bgp_communities: + list[~azure.mgmt.network.v2016_12_01.models.BGPCommunity] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, + 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, service_name: str=None, bgp_communities=None, **kwargs) -> None: + super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.service_name = service_name + self.bgp_communities = bgp_communities diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_settings.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_settings.py index cd3f5e596a04..4560c0e4cfa4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_settings.py @@ -31,8 +31,8 @@ class BgpSettings(Model): 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, } - def __init__(self, asn=None, bgp_peering_address=None, peer_weight=None): - super(BgpSettings, self).__init__() - self.asn = asn - self.bgp_peering_address = bgp_peering_address - self.peer_weight = peer_weight + def __init__(self, **kwargs): + super(BgpSettings, self).__init__(**kwargs) + self.asn = kwargs.get('asn', None) + self.bgp_peering_address = kwargs.get('bgp_peering_address', None) + self.peer_weight = kwargs.get('peer_weight', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_settings_py3.py new file mode 100644 index 000000000000..1ac51b2b24a3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/bgp_settings_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpSettings(Model): + """BgpSettings. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of + this BGP speaker. + :type bgp_peering_address: str + :param peer_weight: The weight added to routes learned from this BGP + speaker. + :type peer_weight: int + """ + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, + } + + def __init__(self, *, asn: int=None, bgp_peering_address: str=None, peer_weight: int=None, **kwargs) -> None: + super(BgpSettings, self).__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + self.peer_weight = peer_weight diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_reset_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_reset_shared_key.py index c68ade7d79f5..47e448e2ffe7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_reset_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_reset_shared_key.py @@ -15,8 +15,10 @@ class ConnectionResetSharedKey(Model): """ConnectionResetSharedKey. - :param key_length: The virtual network connection reset shared key length, - should between 1 and 128. + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. :type key_length: int """ @@ -28,6 +30,6 @@ class ConnectionResetSharedKey(Model): 'key_length': {'key': 'keyLength', 'type': 'int'}, } - def __init__(self, key_length): - super(ConnectionResetSharedKey, self).__init__() - self.key_length = key_length + def __init__(self, **kwargs): + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = kwargs.get('key_length', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_reset_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_reset_shared_key_py3.py new file mode 100644 index 000000000000..b9d127d6fc61 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_reset_shared_key_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionResetSharedKey(Model): + """ConnectionResetSharedKey. + + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. + :type key_length: int + """ + + _validation = { + 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, + } + + _attribute_map = { + 'key_length': {'key': 'keyLength', 'type': 'int'}, + } + + def __init__(self, *, key_length: int, **kwargs) -> None: + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = key_length diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_shared_key.py index 2c1b0ed9a914..742f1cb15126 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_shared_key.py @@ -15,7 +15,9 @@ class ConnectionSharedKey(Model): """Response for GetConnectionSharedKey API service call. - :param value: The virtual network connection shared key value. + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. :type value: str """ @@ -27,6 +29,6 @@ class ConnectionSharedKey(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, value): - super(ConnectionSharedKey, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_shared_key_py3.py new file mode 100644 index 000000000000..11b88da35e17 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/connection_shared_key_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionSharedKey(Model): + """Response for GetConnectionSharedKey API service call. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, **kwargs) -> None: + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dhcp_options.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dhcp_options.py index 8744ba6fc9b1..93b68a7f037c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dhcp_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dhcp_options.py @@ -25,6 +25,6 @@ class DhcpOptions(Model): 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, } - def __init__(self, dns_servers=None): - super(DhcpOptions, self).__init__() - self.dns_servers = dns_servers + def __init__(self, **kwargs): + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dhcp_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dhcp_options_py3.py new file mode 100644 index 000000000000..7dc4651973a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dhcp_options_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DhcpOptions(Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in + the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + options. + + :param dns_servers: The list of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = dns_servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dns_name_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dns_name_availability_result.py index 15a0238e49a7..86ba19eb407b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dns_name_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dns_name_availability_result.py @@ -23,6 +23,6 @@ class DnsNameAvailabilityResult(Model): 'available': {'key': 'available', 'type': 'bool'}, } - def __init__(self, available=None): - super(DnsNameAvailabilityResult, self).__init__() - self.available = available + def __init__(self, **kwargs): + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dns_name_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dns_name_availability_result_py3.py new file mode 100644 index 000000000000..de0117c27715 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/dns_name_availability_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DnsNameAvailabilityResult(Model): + """Response for the CheckDnsNameAvailability API service call. + + :param available: Domain availability (True/False). + :type available: bool + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + } + + def __init__(self, *, available: bool=None, **kwargs) -> None: + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = available diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group.py index 7d6c1c186e45..a502aa00b943 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group.py @@ -33,8 +33,8 @@ class EffectiveNetworkSecurityGroup(Model): 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, } - def __init__(self, network_security_group=None, association=None, effective_security_rules=None): - super(EffectiveNetworkSecurityGroup, self).__init__() - self.network_security_group = network_security_group - self.association = association - self.effective_security_rules = effective_security_rules + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = kwargs.get('network_security_group', None) + self.association = kwargs.get('association', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_association.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_association.py index a54215cae7bf..656566f79425 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_association.py @@ -27,7 +27,7 @@ class EffectiveNetworkSecurityGroupAssociation(Model): 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, } - def __init__(self, subnet=None, network_interface=None): - super(EffectiveNetworkSecurityGroupAssociation, self).__init__() - self.subnet = subnet - self.network_interface = network_interface + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.network_interface = kwargs.get('network_interface', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_association_py3.py new file mode 100644 index 000000000000..bd6940e6be6b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_association_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupAssociation(Model): + """The effective network security group association. + + :param subnet: The ID of the subnet if assigned. + :type subnet: ~azure.mgmt.network.v2016_12_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: + ~azure.mgmt.network.v2016_12_01.models.SubResource + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, + } + + def __init__(self, *, subnet=None, network_interface=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = subnet + self.network_interface = network_interface diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_list_result.py index dbd1fa411beb..c0318c89f5be 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_list_result.py @@ -27,7 +27,7 @@ class EffectiveNetworkSecurityGroupListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(EffectiveNetworkSecurityGroupListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_list_result_py3.py new file mode 100644 index 000000000000..b6765dbf051d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_list_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupListResult(Model): + """Response for list effective network security groups API service call. + + :param value: A list of effective network security groups. + :type value: + list[~azure.mgmt.network.v2016_12_01.models.EffectiveNetworkSecurityGroup] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_py3.py new file mode 100644 index 000000000000..51635ebfd3c3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_group_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroup(Model): + """Effective network security group. + + :param network_security_group: The ID of network security group that is + applied. + :type network_security_group: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param association: + :type association: + ~azure.mgmt.network.v2016_12_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2016_12_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, + 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__(self, *, network_security_group=None, association=None, effective_security_rules=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = network_security_group + self.association = association + self.effective_security_rules = effective_security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_rule.py index 162a33447e2e..9a42deb5dd1d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_rule.py @@ -62,16 +62,16 @@ class EffectiveNetworkSecurityRule(Model): 'direction': {'key': 'direction', 'type': 'str'}, } - def __init__(self, name=None, protocol=None, source_port_range=None, destination_port_range=None, source_address_prefix=None, destination_address_prefix=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority=None, direction=None): - super(EffectiveNetworkSecurityRule, self).__init__() - self.name = name - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_address_prefix = source_address_prefix - self.destination_address_prefix = destination_address_prefix - self.expanded_source_address_prefix = expanded_source_address_prefix - self.expanded_destination_address_prefix = expanded_destination_address_prefix - self.access = access - self.priority = priority - self.direction = direction + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.expanded_source_address_prefix = kwargs.get('expanded_source_address_prefix', None) + self.expanded_destination_address_prefix = kwargs.get('expanded_destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_rule_py3.py new file mode 100644 index 000000000000..97a5c05d43c4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_network_security_rule_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityRule(Model): + """Effective network security rules. + + :param name: The name of the security rule specified by the user (if + created by the user). + :type name: str + :param protocol: The network protocol this rule applies to. Possible + values are: 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2016_12_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. + :type source_port_range: str + :param destination_port_range: The destination port or range. + :type destination_port_range: str + :param source_address_prefix: The source address prefix. + :type source_address_prefix: str + :param destination_address_prefix: The destination address prefix. + :type destination_address_prefix: str + :param expanded_source_address_prefix: The expanded source address prefix. + :type expanded_source_address_prefix: list[str] + :param expanded_destination_address_prefix: Expanded destination address + prefix. + :type expanded_destination_address_prefix: list[str] + :param access: Whether network traffic is allowed or denied. Possible + values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or + ~azure.mgmt.network.v2016_12_01.models.SecurityRuleAccess + :param priority: The priority of the rule. + :type priority: int + :param direction: The direction of the rule. Possible values are: 'Inbound + and Outbound'. Possible values include: 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2016_12_01.models.SecurityRuleDirection + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, + 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, + 'access': {'key': 'access', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, protocol=None, source_port_range: str=None, destination_port_range: str=None, source_address_prefix: str=None, destination_address_prefix: str=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority: int=None, direction=None, **kwargs) -> None: + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = name + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.expanded_source_address_prefix = expanded_source_address_prefix + self.expanded_destination_address_prefix = expanded_destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route.py index 6cfb1224f733..76ba777d7d25 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route.py @@ -50,11 +50,11 @@ class EffectiveRoute(Model): 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, } - def __init__(self, name=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None): - super(EffectiveRoute, self).__init__() - self.name = name - self.source = source - self.state = state - self.address_prefix = address_prefix - self.next_hop_ip_address = next_hop_ip_address - self.next_hop_type = next_hop_type + def __init__(self, **kwargs): + super(EffectiveRoute, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.next_hop_type = kwargs.get('next_hop_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route_list_result.py index c581ad0b6117..a72bc965a5ff 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route_list_result.py @@ -26,7 +26,7 @@ class EffectiveRouteListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(EffectiveRouteListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route_list_result_py3.py new file mode 100644 index 000000000000..f506da1ee3c2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route_list_result_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRouteListResult(Model): + """Response for list effective route API service call. + + :param value: A list of effective routes. + :type value: list[~azure.mgmt.network.v2016_12_01.models.EffectiveRoute] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route_py3.py new file mode 100644 index 000000000000..9b29b637c049 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/effective_route_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRoute(Model): + """Effective Route. + + :param name: The name of the user defined route. This is optional. + :type name: str + :param source: Who created the route. Possible values are: 'Unknown', + 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: + 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' + :type source: str or + ~azure.mgmt.network.v2016_12_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values are: 'Active' + and 'Invalid'. Possible values include: 'Active', 'Invalid' + :type state: str or + ~azure.mgmt.network.v2016_12_01.models.EffectiveRouteState + :param address_prefix: The address prefixes of the effective routes in + CIDR notation. + :type address_prefix: list[str] + :param next_hop_ip_address: The IP address of the next hop of the + effective route. + :type next_hop_ip_address: list[str] + :param next_hop_type: The type of Azure hop the packet should be sent to. + Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2016_12_01.models.RouteNextHopType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None, **kwargs) -> None: + super(EffectiveRoute, self).__init__(**kwargs) + self.name = name + self.source = source + self.state = state + self.address_prefix = address_prefix + self.next_hop_ip_address = next_hop_ip_address + self.next_hop_type = next_hop_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error.py index ed2dda4627c5..2d775936c5bb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error.py @@ -35,10 +35,10 @@ class Error(Model): 'inner_error': {'key': 'innerError', 'type': 'str'}, } - def __init__(self, code=None, message=None, target=None, details=None, inner_error=None): - super(Error, self).__init__() - self.code = code - self.message = message - self.target = target - self.details = details - self.inner_error = inner_error + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error_details.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error_details.py index 40bea00aa2fb..a8c4da6ba955 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error_details.py @@ -29,8 +29,8 @@ class ErrorDetails(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ErrorDetails, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error_details_py3.py new file mode 100644 index 000000000000..d791f0895345 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error_details_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """ErrorDetails. + + :param code: + :type code: str + :param target: + :type target: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error_py3.py new file mode 100644 index 000000000000..75e48a4ecdc3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(Model): + """Error. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.network.v2016_12_01.models.ErrorDetails] + :param inner_error: + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, inner_error: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit.py index 40f75ea809de..73b188d3e4ed 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit.py @@ -91,17 +91,17 @@ class ExpressRouteCircuit(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, allow_classic_operations=None, circuit_provisioning_state=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key=None, service_provider_notes=None, service_provider_properties=None, provisioning_state=None, gateway_manager_etag=None): - super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.allow_classic_operations = allow_classic_operations - self.circuit_provisioning_state = circuit_provisioning_state - self.service_provider_provisioning_state = service_provider_provisioning_state - self.authorizations = authorizations - self.peerings = peerings - self.service_key = service_key - self.service_provider_notes = service_provider_notes - self.service_provider_properties = service_provider_properties - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag + def __init__(self, **kwargs): + super(ExpressRouteCircuit, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.allow_classic_operations = kwargs.get('allow_classic_operations', None) + self.circuit_provisioning_state = kwargs.get('circuit_provisioning_state', None) + self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) + self.authorizations = kwargs.get('authorizations', None) + self.peerings = kwargs.get('peerings', None) + self.service_key = kwargs.get('service_key', None) + self.service_provider_notes = kwargs.get('service_provider_notes', None) + self.service_provider_properties = kwargs.get('service_provider_properties', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_arp_table.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_arp_table.py index ace325747ee5..826796619769 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_arp_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_arp_table.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitArpTable(Model): 'mac_address': {'key': 'macAddress', 'type': 'str'}, } - def __init__(self, age=None, interface=None, ip_address=None, mac_address=None): - super(ExpressRouteCircuitArpTable, self).__init__() - self.age = age - self.interface = interface - self.ip_address = ip_address - self.mac_address = mac_address + def __init__(self, **kwargs): + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = kwargs.get('age', None) + self.interface = kwargs.get('interface', None) + self.ip_address = kwargs.get('ip_address', None) + self.mac_address = kwargs.get('mac_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_arp_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_arp_table_py3.py new file mode 100644 index 000000000000..4401108c6001 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_arp_table_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitArpTable(Model): + """The ARP table associated with the ExpressRouteCircuit. + + :param age: Age + :type age: int + :param interface: Interface + :type interface: str + :param ip_address: The IP address. + :type ip_address: str + :param mac_address: The MAC address. + :type mac_address: str + """ + + _attribute_map = { + 'age': {'key': 'age', 'type': 'int'}, + 'interface': {'key': 'interface', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, *, age: int=None, interface: str=None, ip_address: str=None, mac_address: str=None, **kwargs) -> None: + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = age + self.interface = interface + self.ip_address = ip_address + self.mac_address = mac_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_authorization.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_authorization.py index 5730b26a6037..9e18b6d1a78d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_authorization.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_authorization.py @@ -51,10 +51,10 @@ class ExpressRouteCircuitAuthorization(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, authorization_key=None, authorization_use_status=None, provisioning_state=None, name=None): - super(ExpressRouteCircuitAuthorization, self).__init__(id=id) - self.authorization_key = authorization_key - self.authorization_use_status = authorization_use_status - self.provisioning_state = provisioning_state - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitAuthorization, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.authorization_use_status = kwargs.get('authorization_use_status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_authorization_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_authorization_py3.py new file mode 100644 index 000000000000..54e6063871d3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_authorization_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param authorization_use_status: AuthorizationUseStatus. Possible values + are: 'Available' and 'InUse'. Possible values include: 'Available', + 'InUse' + :type authorization_use_status: str or + ~azure.mgmt.network.v2016_12_01.models.AuthorizationUseStatus + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, authorization_key: str=None, authorization_use_status=None, provisioning_state: str=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitAuthorization, self).__init__(id=id, **kwargs) + self.authorization_key = authorization_key + self.authorization_use_status = authorization_use_status + self.provisioning_state = provisioning_state + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering.py index 090b37df9392..3cb25bdbe6f2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering.py @@ -96,23 +96,23 @@ class ExpressRouteCircuitPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, peering_type=None, state=None, azure_asn=None, peer_asn=None, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, primary_azure_port=None, secondary_azure_port=None, shared_key=None, vlan_id=None, microsoft_peering_config=None, stats=None, provisioning_state=None, gateway_manager_etag=None, last_modified_by=None, route_filter=None, name=None): - super(ExpressRouteCircuitPeering, self).__init__(id=id) - self.peering_type = peering_type - self.state = state - self.azure_asn = azure_asn - self.peer_asn = peer_asn - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.primary_azure_port = primary_azure_port - self.secondary_azure_port = secondary_azure_port - self.shared_key = shared_key - self.vlan_id = vlan_id - self.microsoft_peering_config = microsoft_peering_config - self.stats = stats - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag - self.last_modified_by = last_modified_by - self.route_filter = route_filter - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeering, self).__init__(**kwargs) + self.peering_type = kwargs.get('peering_type', None) + self.state = kwargs.get('state', None) + self.azure_asn = kwargs.get('azure_asn', None) + self.peer_asn = kwargs.get('peer_asn', None) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.primary_azure_port = kwargs.get('primary_azure_port', None) + self.secondary_azure_port = kwargs.get('secondary_azure_port', None) + self.shared_key = kwargs.get('shared_key', None) + self.vlan_id = kwargs.get('vlan_id', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.stats = kwargs.get('stats', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.route_filter = kwargs.get('route_filter', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering_config.py index e5a980202a4d..9d47e9b7ff53 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering_config.py @@ -38,9 +38,9 @@ class ExpressRouteCircuitPeeringConfig(Model): 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, } - def __init__(self, advertised_public_prefixes=None, advertised_public_prefixes_state=None, customer_asn=None, routing_registry_name=None): - super(ExpressRouteCircuitPeeringConfig, self).__init__() - self.advertised_public_prefixes = advertised_public_prefixes - self.advertised_public_prefixes_state = advertised_public_prefixes_state - self.customer_asn = customer_asn - self.routing_registry_name = routing_registry_name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = kwargs.get('advertised_public_prefixes', None) + self.advertised_public_prefixes_state = kwargs.get('advertised_public_prefixes_state', None) + self.customer_asn = kwargs.get('customer_asn', None) + self.routing_registry_name = kwargs.get('routing_registry_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..4fb01c97f28c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering_config_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitPeeringConfig(Model): + """Specifies the peering configuration. + + :param advertised_public_prefixes: The reference of + AdvertisedPublicPrefixes. + :type advertised_public_prefixes: list[str] + :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of + the Peering resource. Possible values are 'NotConfigured', 'Configuring', + 'Configured', and 'ValidationNeeded'. Possible values include: + 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' + :type advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :param customer_asn: The CustomerASN of the peering. + :type customer_asn: int + :param routing_registry_name: The RoutingRegistryName of the + configuration. + :type routing_registry_name: str + """ + + _attribute_map = { + 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, + 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, + 'customer_asn': {'key': 'customerASN', 'type': 'int'}, + 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, + } + + def __init__(self, *, advertised_public_prefixes=None, advertised_public_prefixes_state=None, customer_asn: int=None, routing_registry_name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = advertised_public_prefixes + self.advertised_public_prefixes_state = advertised_public_prefixes_state + self.customer_asn = customer_asn + self.routing_registry_name = routing_registry_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering_py3.py new file mode 100644 index 000000000000..5524e7423661 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_peering_py3.py @@ -0,0 +1,118 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitPeering(SubResource): + """Peering in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param peering_type: The PeeringType. Possible values are: + 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. + Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + 'MicrosoftPeering' + :type peering_type: str or + ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeeringType + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeeringState + :param azure_asn: The Azure ASN. + :type azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: int + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param primary_azure_port: The primary port. + :type primary_azure_port: str + :param secondary_azure_port: The secondary port. + :type secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeeringConfig + :param stats: Gets peering stats. + :type stats: + ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitStats + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :param last_modified_by: Gets whether the provider or the customer last + modified the peering. + :type last_modified_by: str + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2016_12_01.models.RouteFilter + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'int'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'route_filter': {'key': 'properties.routeFilter', 'type': 'RouteFilter'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, peering_type=None, state=None, azure_asn: int=None, peer_asn: int=None, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, primary_azure_port: str=None, secondary_azure_port: str=None, shared_key: str=None, vlan_id: int=None, microsoft_peering_config=None, stats=None, provisioning_state: str=None, gateway_manager_etag: str=None, last_modified_by: str=None, route_filter=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeering, self).__init__(id=id, **kwargs) + self.peering_type = peering_type + self.state = state + self.azure_asn = azure_asn + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = primary_azure_port + self.secondary_azure_port = secondary_azure_port + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.stats = stats + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.last_modified_by = last_modified_by + self.route_filter = route_filter + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_py3.py new file mode 100644 index 000000000000..1a5014d006ce --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteCircuit(Resource): + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The SKU. + :type sku: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitSku + :param allow_classic_operations: Allow classic operations + :type allow_classic_operations: bool + :param circuit_provisioning_state: The CircuitProvisioningState state of + the resource. + :type circuit_provisioning_state: str + :param service_provider_provisioning_state: The + ServiceProviderProvisioningState state of the resource. Possible values + are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + 'Deprovisioning' + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2016_12_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: + list[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeering] + :param service_key: The ServiceKey. + :type service_key: str + :param service_provider_notes: The ServiceProviderNotes. + :type service_provider_notes: str + :param service_provider_properties: The ServiceProviderProperties. + :type service_provider_properties: + ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitServiceProviderProperties + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, + 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, + 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, allow_classic_operations: bool=None, circuit_provisioning_state: str=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key: str=None, service_provider_notes: str=None, service_provider_properties=None, provisioning_state: str=None, gateway_manager_etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.allow_classic_operations = allow_classic_operations + self.circuit_provisioning_state = circuit_provisioning_state + self.service_provider_provisioning_state = service_provider_provisioning_state + self.authorizations = authorizations + self.peerings = peerings + self.service_key = service_key + self.service_provider_notes = service_provider_notes + self.service_provider_properties = service_provider_properties + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table.py index 804d29a2f9bb..7517e9867cfb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table.py @@ -35,10 +35,10 @@ class ExpressRouteCircuitRoutesTable(Model): 'path': {'key': 'path', 'type': 'str'}, } - def __init__(self, network=None, next_hop=None, loc_prf=None, weight=None, path=None): - super(ExpressRouteCircuitRoutesTable, self).__init__() - self.network = network - self.next_hop = next_hop - self.loc_prf = loc_prf - self.weight = weight - self.path = path + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = kwargs.get('network', None) + self.next_hop = kwargs.get('next_hop', None) + self.loc_prf = kwargs.get('loc_prf', None) + self.weight = kwargs.get('weight', None) + self.path = kwargs.get('path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table_py3.py new file mode 100644 index 000000000000..38ea85cf642d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTable(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param network: network + :type network: str + :param next_hop: nextHop + :type next_hop: str + :param loc_prf: locPrf + :type loc_prf: str + :param weight: weight. + :type weight: int + :param path: path + :type path: str + """ + + _attribute_map = { + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'loc_prf': {'key': 'locPrf', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, *, network: str=None, next_hop: str=None, loc_prf: str=None, weight: int=None, path: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = network + self.next_hop = next_hop + self.loc_prf = loc_prf + self.weight = weight + self.path = path diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table_summary.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table_summary.py index 6f5f89764dd4..577c3c2edd45 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table_summary.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table_summary.py @@ -37,10 +37,10 @@ class ExpressRouteCircuitRoutesTableSummary(Model): 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, } - def __init__(self, neighbor=None, v=None, as_property=None, up_down=None, state_pfx_rcd=None): - super(ExpressRouteCircuitRoutesTableSummary, self).__init__() - self.neighbor = neighbor - self.v = v - self.as_property = as_property - self.up_down = up_down - self.state_pfx_rcd = state_pfx_rcd + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = kwargs.get('neighbor', None) + self.v = kwargs.get('v', None) + self.as_property = kwargs.get('as_property', None) + self.up_down = kwargs.get('up_down', None) + self.state_pfx_rcd = kwargs.get('state_pfx_rcd', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table_summary_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table_summary_py3.py new file mode 100644 index 000000000000..e18d0051d218 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_routes_table_summary_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTableSummary(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: Neighbor + :type neighbor: str + :param v: BGP version number spoken to the neighbor. + :type v: int + :param as_property: Autonomous system number. + :type as_property: int + :param up_down: The length of time that the BGP session has been in the + Established state, or the current status if not in the Established state. + :type up_down: str + :param state_pfx_rcd: Current state of the BGP session, and the number of + prefixes that have been received from a neighbor or peer group. + :type state_pfx_rcd: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'v': {'key': 'v', 'type': 'int'}, + 'as_property': {'key': 'as', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, + } + + def __init__(self, *, neighbor: str=None, v: int=None, as_property: int=None, up_down: str=None, state_pfx_rcd: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = neighbor + self.v = v + self.as_property = as_property + self.up_down = up_down + self.state_pfx_rcd = state_pfx_rcd diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_service_provider_properties.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_service_provider_properties.py index 7a6b4ba96061..c51e6d8d653b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_service_provider_properties.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_service_provider_properties.py @@ -29,8 +29,8 @@ class ExpressRouteCircuitServiceProviderProperties(Model): 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, } - def __init__(self, service_provider_name=None, peering_location=None, bandwidth_in_mbps=None): - super(ExpressRouteCircuitServiceProviderProperties, self).__init__() - self.service_provider_name = service_provider_name - self.peering_location = peering_location - self.bandwidth_in_mbps = bandwidth_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = kwargs.get('service_provider_name', None) + self.peering_location = kwargs.get('peering_location', None) + self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_service_provider_properties_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_service_provider_properties_py3.py new file mode 100644 index 000000000000..ea701a54c3fe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_service_provider_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitServiceProviderProperties(Model): + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :param service_provider_name: The serviceProviderName. + :type service_provider_name: str + :param peering_location: The peering location. + :type peering_location: str + :param bandwidth_in_mbps: The BandwidthInMbps. + :type bandwidth_in_mbps: int + """ + + _attribute_map = { + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + } + + def __init__(self, *, service_provider_name: str=None, peering_location: str=None, bandwidth_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = service_provider_name + self.peering_location = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_sku.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_sku.py index 27ce0b6a17eb..e0679af121c1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_sku.py @@ -33,8 +33,8 @@ class ExpressRouteCircuitSku(Model): 'family': {'key': 'family', 'type': 'str'}, } - def __init__(self, name=None, tier=None, family=None): - super(ExpressRouteCircuitSku, self).__init__() - self.name = name - self.tier = tier - self.family = family + def __init__(self, **kwargs): + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.family = kwargs.get('family', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_sku_py3.py new file mode 100644 index 000000000000..a77750414d3f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_sku_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitSku(Model): + """Contains SKU in an ExpressRouteCircuit. + + :param name: The name of the SKU. + :type name: str + :param tier: The tier of the SKU. Possible values are 'Standard' and + 'Premium'. Possible values include: 'Standard', 'Premium' + :type tier: str or + ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values are: 'UnlimitedData' + and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' + :type family: str or + ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, tier=None, family=None, **kwargs) -> None: + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.family = family diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_stats.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_stats.py index e26f6f7d2f74..41c45ae2b19a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_stats.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_stats.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitStats(Model): 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, } - def __init__(self, primarybytes_in=None, primarybytes_out=None, secondarybytes_in=None, secondarybytes_out=None): - super(ExpressRouteCircuitStats, self).__init__() - self.primarybytes_in = primarybytes_in - self.primarybytes_out = primarybytes_out - self.secondarybytes_in = secondarybytes_in - self.secondarybytes_out = secondarybytes_out + def __init__(self, **kwargs): + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = kwargs.get('primarybytes_in', None) + self.primarybytes_out = kwargs.get('primarybytes_out', None) + self.secondarybytes_in = kwargs.get('secondarybytes_in', None) + self.secondarybytes_out = kwargs.get('secondarybytes_out', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_stats_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_stats_py3.py new file mode 100644 index 000000000000..f78335343544 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuit_stats_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitStats(Model): + """Contains stats associated with the peering. + + :param primarybytes_in: Gets BytesIn of the peering. + :type primarybytes_in: long + :param primarybytes_out: Gets BytesOut of the peering. + :type primarybytes_out: long + :param secondarybytes_in: Gets BytesIn of the peering. + :type secondarybytes_in: long + :param secondarybytes_out: Gets BytesOut of the peering. + :type secondarybytes_out: long + """ + + _attribute_map = { + 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, + 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, + 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, + 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, + } + + def __init__(self, *, primarybytes_in: int=None, primarybytes_out: int=None, secondarybytes_in: int=None, secondarybytes_out: int=None, **kwargs) -> None: + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = primarybytes_in + self.primarybytes_out = primarybytes_out + self.secondarybytes_in = secondarybytes_in + self.secondarybytes_out = secondarybytes_out diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_arp_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_arp_table_list_result.py index 5254157f1744..dba906617950 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_arp_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_arp_table_list_result.py @@ -27,7 +27,7 @@ class ExpressRouteCircuitsArpTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsArpTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_arp_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_arp_table_list_result_py3.py new file mode 100644 index 000000000000..069cf50e527b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_arp_table_list_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsArpTableListResult(Model): + """Response for ListArpTable associated with the Express Route Circuits API. + + :param value: Gets list of the ARP table. + :type value: + list[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitArpTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_list_result.py index 029cc8337a0d..442a194a63aa 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_list_result_py3.py new file mode 100644 index 000000000000..5220beac369f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: The list of routes table. + :type value: + list[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitRoutesTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_summary_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_summary_list_result.py index fc5e57caa4c0..07da68271a71 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_summary_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_summary_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_summary_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_summary_list_result_py3.py new file mode 100644 index 000000000000..a327948c22c5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_circuits_routes_table_summary_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: A list of the routes table. + :type value: + list[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitRoutesTableSummary] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider.py index 8e531c5000b5..6cd65afb20d2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider.py @@ -53,8 +53,8 @@ class ExpressRouteServiceProvider(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state=None): - super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags) - self.peering_locations = peering_locations - self.bandwidths_offered = bandwidths_offered - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ExpressRouteServiceProvider, self).__init__(**kwargs) + self.peering_locations = kwargs.get('peering_locations', None) + self.bandwidths_offered = kwargs.get('bandwidths_offered', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider_bandwidths_offered.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider_bandwidths_offered.py index 9cbba2fcfe97..b27622af42d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider_bandwidths_offered.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider_bandwidths_offered.py @@ -26,7 +26,7 @@ class ExpressRouteServiceProviderBandwidthsOffered(Model): 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, } - def __init__(self, offer_name=None, value_in_mbps=None): - super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__() - self.offer_name = offer_name - self.value_in_mbps = value_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = kwargs.get('offer_name', None) + self.value_in_mbps = kwargs.get('value_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider_bandwidths_offered_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider_bandwidths_offered_py3.py new file mode 100644 index 000000000000..88516a0dfcf8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider_bandwidths_offered_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteServiceProviderBandwidthsOffered(Model): + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :param offer_name: The OfferName. + :type offer_name: str + :param value_in_mbps: The ValueInMbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__(self, *, offer_name: str=None, value_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = offer_name + self.value_in_mbps = value_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider_py3.py new file mode 100644 index 000000000000..ca485a648357 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/express_route_service_provider_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param peering_locations: Get a list of peering locations. + :type peering_locations: list[str] + :param bandwidths_offered: Gets bandwidths offered. + :type bandwidths_offered: + list[~azure.mgmt.network.v2016_12_01.models.ExpressRouteServiceProviderBandwidthsOffered] + :param provisioning_state: Gets the provisioning state of the resource. + :type provisioning_state: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, + 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state: str=None, **kwargs) -> None: + super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.peering_locations = peering_locations + self.bandwidths_offered = bandwidths_offered + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_information.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_information.py index a6f70e598a6f..e36233e42057 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_information.py @@ -15,13 +15,15 @@ class FlowLogInformation(Model): """Information on the configuration of flow log. - :param target_resource_id: The ID of the resource to configure for flow - logging. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. :type target_resource_id: str - :param storage_id: ID of the storage account which is used to store the - flow log. + :param storage_id: Required. ID of the storage account which is used to + store the flow log. :type storage_id: str - :param enabled: Flag to enable/disable flow logging. + :param enabled: Required. Flag to enable/disable flow logging. :type enabled: bool :param retention_policy: :type retention_policy: @@ -41,9 +43,9 @@ class FlowLogInformation(Model): 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, } - def __init__(self, target_resource_id, storage_id, enabled, retention_policy=None): - super(FlowLogInformation, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.enabled = enabled - self.retention_policy = retention_policy + def __init__(self, **kwargs): + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.enabled = kwargs.get('enabled', None) + self.retention_policy = kwargs.get('retention_policy', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_information_py3.py new file mode 100644 index 000000000000..8709d1150f31 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_information_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogInformation(Model): + """Information on the configuration of flow log. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. + :type target_resource_id: str + :param storage_id: Required. ID of the storage account which is used to + store the flow log. + :type storage_id: str + :param enabled: Required. Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: + :type retention_policy: + ~azure.mgmt.network.v2016_12_01.models.RetentionPolicyParameters + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, enabled: bool, retention_policy=None, **kwargs) -> None: + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.enabled = enabled + self.retention_policy = retention_policy diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_status_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_status_parameters.py index 4cd22222bb45..5a48e938f2d6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_status_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_status_parameters.py @@ -15,8 +15,10 @@ class FlowLogStatusParameters(Model): """Parameters that define a resource to query flow log status. - :param target_resource_id: The target resource where getting the flow - logging status. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class FlowLogStatusParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(FlowLogStatusParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_status_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_status_parameters_py3.py new file mode 100644 index 000000000000..0768d2495150 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/flow_log_status_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogStatusParameters(Model): + """Parameters that define a resource to query flow log status. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/frontend_ip_configuration.py index 12e862df2c65..084d0bfd18ba 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/frontend_ip_configuration.py @@ -81,16 +81,16 @@ class FrontendIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(FrontendIPConfiguration, self).__init__(id=id) + def __init__(self, **kwargs): + super(FrontendIPConfiguration, self).__init__(**kwargs) self.inbound_nat_rules = None self.inbound_nat_pools = None self.outbound_nat_rules = None self.load_balancing_rules = None - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..5c46496bf26d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/frontend_ip_configuration_py3.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class FrontendIPConfiguration(SubResource): + """Frontend IP address of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar inbound_nat_rules: Read only. Inbound rules URIs that use this + frontend IP. + :vartype inbound_nat_rules: + list[~azure.mgmt.network.v2016_12_01.models.SubResource] + :ivar inbound_nat_pools: Read only. Inbound pools URIs that use this + frontend IP. + :vartype inbound_nat_pools: + list[~azure.mgmt.network.v2016_12_01.models.SubResource] + :ivar outbound_nat_rules: Read only. Outbound rules URIs that use this + frontend IP. + :vartype outbound_nat_rules: + list[~azure.mgmt.network.v2016_12_01.models.SubResource] + :ivar load_balancing_rules: Gets load balancing rules URIs that use this + frontend IP. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2016_12_01.models.SubResource] + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The Private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2016_12_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2016_12_01.models.Subnet + :param public_ip_address: The reference of the Public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2016_12_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'inbound_nat_rules': {'readonly': True}, + 'inbound_nat_pools': {'readonly': True}, + 'outbound_nat_rules': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[SubResource]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(FrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.inbound_nat_rules = None + self.inbound_nat_pools = None + self.outbound_nat_rules = None + self.load_balancing_rules = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route.py index b4e542466325..f49c0aa3433d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route.py @@ -54,8 +54,8 @@ class GatewayRoute(Model): 'weight': {'key': 'weight', 'type': 'int'}, } - def __init__(self): - super(GatewayRoute, self).__init__() + def __init__(self, **kwargs): + super(GatewayRoute, self).__init__(**kwargs) self.local_address = None self.network = None self.next_hop = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route_list_result.py index 3385aaffc672..7ed41164b983 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route_list_result.py @@ -23,6 +23,6 @@ class GatewayRouteListResult(Model): 'value': {'key': 'value', 'type': '[GatewayRoute]'}, } - def __init__(self, value=None): - super(GatewayRouteListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route_list_result_py3.py new file mode 100644 index 000000000000..bc43b8282757 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRouteListResult(Model): + """List of virtual network gateway routes. + + :param value: List of gateway routes + :type value: list[~azure.mgmt.network.v2016_12_01.models.GatewayRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayRoute]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route_py3.py new file mode 100644 index 000000000000..89d6acedbc58 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/gateway_route_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRoute(Model): + """GatewayRoute. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The gateway's local address + :vartype local_address: str + :ivar network: The route's network prefix + :vartype network: str + :ivar next_hop: The route's next hop + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from + :vartype source_peer: str + :ivar origin: The source this route was learned from + :vartype origin: str + :ivar as_path: The route's AS path sequence + :vartype as_path: str + :ivar weight: The route's weight + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(GatewayRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_pool.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_pool.py index 9fa942b480fe..147ffbe8e5bf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_pool.py @@ -15,25 +15,29 @@ class InboundNatPool(SubResource): """Inbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. :type frontend_ip_configuration: ~azure.mgmt.network.v2016_12_01.models.SubResource - :param protocol: The transport protocol for the endpoint. Possible values - are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :param protocol: Required. The transport protocol for the endpoint. + Possible values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2016_12_01.models.TransportProtocol - :param frontend_port_range_start: The first port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65534. + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. :type frontend_port_range_start: int - :param frontend_port_range_end: The last port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65535. + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. :type frontend_port_range_end: int - :param backend_port: The port used for internal connections on the - endpoint. Acceptable values are between 1 and 65535. + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. :type backend_port: int :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. @@ -65,13 +69,13 @@ class InboundNatPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port_range_start, frontend_port_range_end, backend_port, id=None, frontend_ip_configuration=None, provisioning_state=None, name=None, etag=None): - super(InboundNatPool, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.protocol = protocol - self.frontend_port_range_start = frontend_port_range_start - self.frontend_port_range_end = frontend_port_range_end - self.backend_port = backend_port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(InboundNatPool, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.protocol = kwargs.get('protocol', None) + self.frontend_port_range_start = kwargs.get('frontend_port_range_start', None) + self.frontend_port_range_end = kwargs.get('frontend_port_range_end', None) + self.backend_port = kwargs.get('backend_port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_pool_py3.py new file mode 100644 index 000000000000..dcdb097f852b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_pool_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatPool(SubResource): + """Inbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param protocol: Required. The transport protocol for the endpoint. + Possible values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2016_12_01.models.TransportProtocol + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. + :type frontend_port_range_start: int + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. + :type frontend_port_range_end: int + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port_range_start': {'required': True}, + 'frontend_port_range_end': {'required': True}, + 'backend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, + 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port_range_start: int, frontend_port_range_end: int, backend_port: int, id: str=None, frontend_ip_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatPool, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.protocol = protocol + self.frontend_port_range_start = frontend_port_range_start + self.frontend_port_range_end = frontend_port_range_end + self.backend_port = backend_port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_rule.py index c2a17e9208df..a83812a22842 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_rule.py @@ -78,15 +78,15 @@ class InboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, protocol=None, frontend_port=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(InboundNatRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration + def __init__(self, **kwargs): + super(InboundNatRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) self.backend_ip_configuration = None - self.protocol = protocol - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_rule_py3.py new file mode 100644 index 000000000000..2434b6d4d232 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/inbound_nat_rule_py3.py @@ -0,0 +1,92 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatRule(SubResource): + """Inbound NAT rule of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :ivar backend_ip_configuration: A reference to a private IP address + defined on a network interface of a VM. Traffic sent to the frontend port + of each of the frontend IP configurations is forwarded to the backed IP. + :vartype backend_ip_configuration: + ~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceIPConfiguration + :param protocol: The transport protocol for the endpoint. Possible values + are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2016_12_01.models.TransportProtocol + :param frontend_port: The port for the external endpoint. Port numbers for + each rule must be unique within the Load Balancer. Acceptable values range + from 1 to 65534. + :type frontend_port: int + :param backend_port: The port used for the internal endpoint. Acceptable + values range from 1 to 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, protocol=None, frontend_port: int=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_ip_configuration = None + self.protocol = protocol + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_address_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_address_availability_result.py index f2cb36a550ec..6bcf52275711 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_address_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_address_availability_result.py @@ -27,7 +27,7 @@ class IPAddressAvailabilityResult(Model): 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, } - def __init__(self, available=None, available_ip_addresses=None): - super(IPAddressAvailabilityResult, self).__init__() - self.available = available - self.available_ip_addresses = available_ip_addresses + def __init__(self, **kwargs): + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) + self.available_ip_addresses = kwargs.get('available_ip_addresses', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_address_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_address_availability_result_py3.py new file mode 100644 index 000000000000..e5fc4340d370 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_address_availability_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPAddressAvailabilityResult(Model): + """Response for CheckIPAddressAvailability API service call. + + :param available: Private IP address availability. + :type available: bool + :param available_ip_addresses: Contains other available private IP + addresses if the asked for address is taken. + :type available_ip_addresses: list[str] + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, + } + + def __init__(self, *, available: bool=None, available_ip_addresses=None, **kwargs) -> None: + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = available + self.available_ip_addresses = available_ip_addresses diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_configuration.py index 33e6a285177d..4b82418fb25d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_configuration.py @@ -51,12 +51,12 @@ class IPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(IPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(IPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_configuration_py3.py new file mode 100644 index 000000000000..681a4f7b1bc3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/ip_configuration_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class IPConfiguration(SubResource): + """IPConfiguration. + + :param id: Resource ID. + :type id: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2016_12_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2016_12_01.models.Subnet + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2016_12_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(IPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancer.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancer.py index 862064b91b3c..8badc970d276 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancer.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancer.py @@ -97,15 +97,15 @@ class LoadBalancer(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(LoadBalancer, self).__init__(id=id, location=location, tags=tags) - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pools = backend_address_pools - self.load_balancing_rules = load_balancing_rules - self.probes = probes - self.inbound_nat_rules = inbound_nat_rules - self.inbound_nat_pools = inbound_nat_pools - self.outbound_nat_rules = outbound_nat_rules - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancer, self).__init__(**kwargs) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.load_balancing_rules = kwargs.get('load_balancing_rules', None) + self.probes = kwargs.get('probes', None) + self.inbound_nat_rules = kwargs.get('inbound_nat_rules', None) + self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) + self.outbound_nat_rules = kwargs.get('outbound_nat_rules', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancer_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancer_py3.py new file mode 100644 index 000000000000..f40d9a5b636f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancer_py3.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LoadBalancer(Resource): + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param frontend_ip_configurations: Object representing the frontend IPs to + be used for the load balancer + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2016_12_01.models.FrontendIPConfiguration] + :param backend_address_pools: Collection of backend address pools used by + a load balancer + :type backend_address_pools: + list[~azure.mgmt.network.v2016_12_01.models.BackendAddressPool] + :param load_balancing_rules: Object collection representing the load + balancing rules Gets the provisioning + :type load_balancing_rules: + list[~azure.mgmt.network.v2016_12_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer + :type probes: list[~azure.mgmt.network.v2016_12_01.models.Probe] + :param inbound_nat_rules: Collection of inbound NAT Rules used by a load + balancer. Defining inbound NAT rules on your load balancer is mutually + exclusive with defining an inbound NAT pool. Inbound NAT pools are + referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an Inbound NAT pool. They + have to reference individual inbound NAT rules. + :type inbound_nat_rules: + list[~azure.mgmt.network.v2016_12_01.models.InboundNatRule] + :param inbound_nat_pools: Defines an external port range for inbound NAT + to a single backend port on NICs associated with a load balancer. Inbound + NAT rules are created automatically for each NIC associated with the Load + Balancer using an external port from this range. Defining an Inbound NAT + pool on your Load Balancer is mutually exclusive with defining inbound Nat + rules. Inbound NAT pools are referenced from virtual machine scale sets. + NICs that are associated with individual virtual machines cannot reference + an inbound NAT pool. They have to reference individual inbound NAT rules. + :type inbound_nat_pools: + list[~azure.mgmt.network.v2016_12_01.models.InboundNatPool] + :param outbound_nat_rules: The outbound NAT rules. + :type outbound_nat_rules: + list[~azure.mgmt.network.v2016_12_01.models.OutboundNatRule] + :param resource_guid: The resource GUID property of the load balancer + resource. + :type resource_guid: str + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, + 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[OutboundNatRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancer, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pools = backend_address_pools + self.load_balancing_rules = load_balancing_rules + self.probes = probes + self.inbound_nat_rules = inbound_nat_rules + self.inbound_nat_pools = inbound_nat_pools + self.outbound_nat_rules = outbound_nat_rules + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancing_rule.py index 020575f68f64..fe9d139b955b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancing_rule.py @@ -15,6 +15,8 @@ class LoadBalancingRule(SubResource): """A load balancing rule for a load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. @@ -27,8 +29,9 @@ class LoadBalancingRule(SubResource): :param probe: The reference of the load balancer probe used by the load balancing rule. :type probe: ~azure.mgmt.network.v2016_12_01.models.SubResource - :param protocol: The transport protocol for the external endpoint. - Possible values are 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :param protocol: Required. The transport protocol for the external + endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: + 'Udp', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2016_12_01.models.TransportProtocol :param load_distribution: The load distribution policy for this rule. @@ -36,9 +39,9 @@ class LoadBalancingRule(SubResource): Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' :type load_distribution: str or ~azure.mgmt.network.v2016_12_01.models.LoadDistribution - :param frontend_port: The port for the external endpoint. Port numbers for - each rule must be unique within the Load Balancer. Acceptable values are - between 1 and 65534. + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 1 and 65534. :type frontend_port: int :param backend_port: The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. @@ -85,17 +88,17 @@ class LoadBalancingRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port, id=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(LoadBalancingRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.backend_address_pool = backend_address_pool - self.probe = probe - self.protocol = protocol - self.load_distribution = load_distribution - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancingRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.probe = kwargs.get('probe', None) + self.protocol = kwargs.get('protocol', None) + self.load_distribution = kwargs.get('load_distribution', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancing_rule_py3.py new file mode 100644 index 000000000000..8e3beedfffe9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/load_balancing_rule_py3.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class LoadBalancingRule(SubResource): + """A load balancing rule for a load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param backend_address_pool: A reference to a pool of DIPs. Inbound + traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param probe: The reference of the load balancer probe used by the load + balancing rule. + :type probe: ~azure.mgmt.network.v2016_12_01.models.SubResource + :param protocol: Required. The transport protocol for the external + endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: + 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2016_12_01.models.TransportProtocol + :param load_distribution: The load distribution policy for this rule. + Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + :type load_distribution: str or + ~azure.mgmt.network.v2016_12_01.models.LoadDistribution + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 1 and 65534. + :type frontend_port: int + :param backend_port: The port used for internal connections on the + endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port: int, id: str=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancingRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_address_pool = backend_address_pool + self.probe = probe + self.protocol = protocol + self.load_distribution = load_distribution + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/local_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/local_network_gateway.py index 9f0c43fa845a..2af1e82d1ae4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/local_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/local_network_gateway.py @@ -67,11 +67,11 @@ class LocalNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, local_network_address_space=None, gateway_ip_address=None, bgp_settings=None, resource_guid=None, etag=None): - super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.local_network_address_space = local_network_address_space - self.gateway_ip_address = gateway_ip_address - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(LocalNetworkGateway, self).__init__(**kwargs) + self.local_network_address_space = kwargs.get('local_network_address_space', None) + self.gateway_ip_address = kwargs.get('gateway_ip_address', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/local_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/local_network_gateway_py3.py new file mode 100644 index 000000000000..19fe08e2b6c2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/local_network_gateway_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LocalNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param local_network_address_space: Local network site address space. + :type local_network_address_space: + ~azure.mgmt.network.v2016_12_01.models.AddressSpace + :param gateway_ip_address: IP address of local network gateway. + :type gateway_ip_address: str + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2016_12_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + LocalNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', + and 'Failed'. + :vartype provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, + 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, local_network_address_space=None, gateway_ip_address: str=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.local_network_address_space = local_network_address_space + self.gateway_ip_address = gateway_ip_address + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface.py index 588fa52fbcd1..7d38e1239926 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface.py @@ -87,16 +87,16 @@ class NetworkInterface(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address=None, primary=None, enable_accelerated_networking=None, enable_ip_forwarding=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkInterface, self).__init__(id=id, location=location, tags=tags) - self.virtual_machine = virtual_machine - self.network_security_group = network_security_group - self.ip_configurations = ip_configurations - self.dns_settings = dns_settings - self.mac_address = mac_address - self.primary = primary - self.enable_accelerated_networking = enable_accelerated_networking - self.enable_ip_forwarding = enable_ip_forwarding - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.virtual_machine = kwargs.get('virtual_machine', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.mac_address = kwargs.get('mac_address', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_association.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_association.py index c6f51377d0f8..3c6595847170 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_association.py @@ -34,7 +34,7 @@ class NetworkInterfaceAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(NetworkInterfaceAssociation, self).__init__() + def __init__(self, **kwargs): + super(NetworkInterfaceAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_association_py3.py new file mode 100644 index 000000000000..defd4c82a6a4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Network interface ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2016_12_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(NetworkInterfaceAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_dns_settings.py index 675a4a1eb08a..b6ee0ff40d51 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_dns_settings.py @@ -46,10 +46,10 @@ class NetworkInterfaceDnsSettings(Model): 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, } - def __init__(self, dns_servers=None, applied_dns_servers=None, internal_dns_name_label=None, internal_fqdn=None, internal_domain_name_suffix=None): - super(NetworkInterfaceDnsSettings, self).__init__() - self.dns_servers = dns_servers - self.applied_dns_servers = applied_dns_servers - self.internal_dns_name_label = internal_dns_name_label - self.internal_fqdn = internal_fqdn - self.internal_domain_name_suffix = internal_domain_name_suffix + def __init__(self, **kwargs): + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + self.applied_dns_servers = kwargs.get('applied_dns_servers', None) + self.internal_dns_name_label = kwargs.get('internal_dns_name_label', None) + self.internal_fqdn = kwargs.get('internal_fqdn', None) + self.internal_domain_name_suffix = kwargs.get('internal_domain_name_suffix', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_dns_settings_py3.py new file mode 100644 index 000000000000..ccdcc937def8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_dns_settings_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceDnsSettings(Model): + """DNS settings of a network interface. + + :param dns_servers: List of DNS servers IP addresses. Use + 'AzureProvidedDNS' to switch to azure provided DNS resolution. + 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + only value in dnsServers collection. + :type dns_servers: list[str] + :param applied_dns_servers: If the VM that uses this NIC is part of an + Availability Set, then this list will have the union of all DNS servers + from all NICs that are part of the Availability Set. This property is what + is configured on each of those VMs. + :type applied_dns_servers: list[str] + :param internal_dns_name_label: Relative DNS name for this NIC used for + internal communications between VMs in the same virtual network. + :type internal_dns_name_label: str + :param internal_fqdn: Fully qualified DNS name supporting internal + communications between VMs in the same virtual network. + :type internal_fqdn: str + :param internal_domain_name_suffix: Even if internalDnsNameLabel is not + specified, a DNS entry is created for the primary NIC of the VM. This DNS + name can be constructed by concatenating the VM name with the value of + internalDomainNameSuffix. + :type internal_domain_name_suffix: str + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, + 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, + } + + def __init__(self, *, dns_servers=None, applied_dns_servers=None, internal_dns_name_label: str=None, internal_fqdn: str=None, internal_domain_name_suffix: str=None, **kwargs) -> None: + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers + self.applied_dns_servers = applied_dns_servers + self.internal_dns_name_label = internal_dns_name_label + self.internal_fqdn = internal_fqdn + self.internal_domain_name_suffix = internal_domain_name_suffix diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_ip_configuration.py index 26301e84169b..d84e4df4977d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_ip_configuration.py @@ -76,17 +76,17 @@ class NetworkInterfaceIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(NetworkInterfaceIPConfiguration, self).__init__(id=id) - self.application_gateway_backend_address_pools = application_gateway_backend_address_pools - self.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.private_ip_address_version = private_ip_address_version - self.subnet = subnet - self.primary = primary - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterfaceIPConfiguration, self).__init__(**kwargs) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_rules = kwargs.get('load_balancer_inbound_nat_rules', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_ip_configuration_py3.py new file mode 100644 index 000000000000..da227a657d8a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_ip_configuration_py3.py @@ -0,0 +1,92 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class NetworkInterfaceIPConfiguration(SubResource): + """IPConfiguration in a network interface. + + :param id: Resource ID. + :type id: str + :param application_gateway_backend_address_pools: The reference of + ApplicationGatewayBackendAddressPool resource. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendAddressPool] + :param load_balancer_backend_address_pools: The reference of + LoadBalancerBackendAddressPool resource. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2016_12_01.models.BackendAddressPool] + :param load_balancer_inbound_nat_rules: A list of references of + LoadBalancerInboundNatRules. + :type load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2016_12_01.models.InboundNatRule] + :param private_ip_address: + :type private_ip_address: str + :param private_ip_allocation_method: Defines how a private IP address is + assigned. Possible values are: 'Static' and 'Dynamic'. Possible values + include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2016_12_01.models.IPAllocationMethod + :param private_ip_address_version: Available from Api-Version 2016-03-30 + onwards, it represents whether the specific ipconfiguration is IPv4 or + IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.network.v2016_12_01.models.IPVersion + :param subnet: + :type subnet: ~azure.mgmt.network.v2016_12_01.models.Subnet + :param primary: Gets whether this is a primary customer address on the + network interface. + :type primary: bool + :param public_ip_address: + :type public_ip_address: + ~azure.mgmt.network.v2016_12_01.models.PublicIPAddress + :param provisioning_state: + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address: str=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary: bool=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterfaceIPConfiguration, self).__init__(id=id, **kwargs) + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.private_ip_address_version = private_ip_address_version + self.subnet = subnet + self.primary = primary + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_py3.py new file mode 100644 index 000000000000..1635b08b8986 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_interface_py3.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkInterface(Resource): + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param virtual_machine: The reference of a virtual machine. + :type virtual_machine: ~azure.mgmt.network.v2016_12_01.models.SubResource + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2016_12_01.models.NetworkSecurityGroup + :param ip_configurations: A list of IPConfigurations of the network + interface. + :type ip_configurations: + list[~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceIPConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: + ~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceDnsSettings + :param mac_address: The MAC address of the network interface. + :type mac_address: str + :param primary: Gets whether this is a primary network interface on a + virtual machine. + :type primary: bool + :param enable_accelerated_networking: If the network interface is + accelerated networking enabled. + :type enable_accelerated_networking: bool + :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on + this network interface. + :type enable_ip_forwarding: bool + :param resource_guid: The resource GUID property of the network interface + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, + 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address: str=None, primary: bool=None, enable_accelerated_networking: bool=None, enable_ip_forwarding: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterface, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.virtual_machine = virtual_machine + self.network_security_group = network_security_group + self.ip_configurations = ip_configurations + self.dns_settings = dns_settings + self.mac_address = mac_address + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.enable_ip_forwarding = enable_ip_forwarding + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_management_client_enums.py index 4f5a411a8288..65dfa0acc4b9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_management_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class RouteNextHopType(Enum): +class RouteNextHopType(str, Enum): virtual_network_gateway = "VirtualNetworkGateway" vnet_local = "VnetLocal" @@ -21,56 +21,56 @@ class RouteNextHopType(Enum): none = "None" -class SecurityRuleProtocol(Enum): +class SecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" asterisk = "*" -class SecurityRuleAccess(Enum): +class SecurityRuleAccess(str, Enum): allow = "Allow" deny = "Deny" -class SecurityRuleDirection(Enum): +class SecurityRuleDirection(str, Enum): inbound = "Inbound" outbound = "Outbound" -class TransportProtocol(Enum): +class TransportProtocol(str, Enum): udp = "Udp" tcp = "Tcp" -class IPAllocationMethod(Enum): +class IPAllocationMethod(str, Enum): static = "Static" dynamic = "Dynamic" -class IPVersion(Enum): +class IPVersion(str, Enum): ipv4 = "IPv4" ipv6 = "IPv6" -class ApplicationGatewayProtocol(Enum): +class ApplicationGatewayProtocol(str, Enum): http = "Http" https = "Https" -class ApplicationGatewayCookieBasedAffinity(Enum): +class ApplicationGatewayCookieBasedAffinity(str, Enum): enabled = "Enabled" disabled = "Disabled" -class ApplicationGatewayBackendHealthServerHealth(Enum): +class ApplicationGatewayBackendHealthServerHealth(str, Enum): unknown = "Unknown" up = "Up" @@ -78,7 +78,7 @@ class ApplicationGatewayBackendHealthServerHealth(Enum): partial = "Partial" -class ApplicationGatewaySkuName(Enum): +class ApplicationGatewaySkuName(str, Enum): standard_small = "Standard_Small" standard_medium = "Standard_Medium" @@ -87,26 +87,26 @@ class ApplicationGatewaySkuName(Enum): waf_large = "WAF_Large" -class ApplicationGatewayTier(Enum): +class ApplicationGatewayTier(str, Enum): standard = "Standard" waf = "WAF" -class ApplicationGatewaySslProtocol(Enum): +class ApplicationGatewaySslProtocol(str, Enum): tl_sv1_0 = "TLSv1_0" tl_sv1_1 = "TLSv1_1" tl_sv1_2 = "TLSv1_2" -class ApplicationGatewayRequestRoutingRuleType(Enum): +class ApplicationGatewayRequestRoutingRuleType(str, Enum): basic = "Basic" path_based_routing = "PathBasedRouting" -class ApplicationGatewayOperationalState(Enum): +class ApplicationGatewayOperationalState(str, Enum): stopped = "Stopped" starting = "Starting" @@ -114,19 +114,19 @@ class ApplicationGatewayOperationalState(Enum): stopping = "Stopping" -class ApplicationGatewayFirewallMode(Enum): +class ApplicationGatewayFirewallMode(str, Enum): detection = "Detection" prevention = "Prevention" -class AuthorizationUseStatus(Enum): +class AuthorizationUseStatus(str, Enum): available = "Available" in_use = "InUse" -class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(str, Enum): not_configured = "NotConfigured" configuring = "Configuring" @@ -134,38 +134,38 @@ class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): validation_needed = "ValidationNeeded" -class ExpressRouteCircuitPeeringType(Enum): +class ExpressRouteCircuitPeeringType(str, Enum): azure_public_peering = "AzurePublicPeering" azure_private_peering = "AzurePrivatePeering" microsoft_peering = "MicrosoftPeering" -class ExpressRouteCircuitPeeringState(Enum): +class ExpressRouteCircuitPeeringState(str, Enum): disabled = "Disabled" enabled = "Enabled" -class Access(Enum): +class Access(str, Enum): allow = "Allow" deny = "Deny" -class ExpressRouteCircuitSkuTier(Enum): +class ExpressRouteCircuitSkuTier(str, Enum): standard = "Standard" premium = "Premium" -class ExpressRouteCircuitSkuFamily(Enum): +class ExpressRouteCircuitSkuFamily(str, Enum): unlimited_data = "UnlimitedData" metered_data = "MeteredData" -class ServiceProviderProvisioningState(Enum): +class ServiceProviderProvisioningState(str, Enum): not_provisioned = "NotProvisioned" provisioning = "Provisioning" @@ -173,27 +173,27 @@ class ServiceProviderProvisioningState(Enum): deprovisioning = "Deprovisioning" -class LoadDistribution(Enum): +class LoadDistribution(str, Enum): default = "Default" source_ip = "SourceIP" source_ip_protocol = "SourceIPProtocol" -class ProbeProtocol(Enum): +class ProbeProtocol(str, Enum): http = "Http" tcp = "Tcp" -class NetworkOperationStatus(Enum): +class NetworkOperationStatus(str, Enum): in_progress = "InProgress" succeeded = "Succeeded" failed = "Failed" -class EffectiveRouteSource(Enum): +class EffectiveRouteSource(str, Enum): unknown = "Unknown" user = "User" @@ -201,13 +201,13 @@ class EffectiveRouteSource(Enum): default = "Default" -class EffectiveRouteState(Enum): +class EffectiveRouteState(str, Enum): active = "Active" invalid = "Invalid" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): succeeded = "Succeeded" updating = "Updating" @@ -215,25 +215,25 @@ class ProvisioningState(Enum): failed = "Failed" -class AssociationType(Enum): +class AssociationType(str, Enum): associated = "Associated" contains = "Contains" -class Direction(Enum): +class Direction(str, Enum): inbound = "Inbound" outbound = "Outbound" -class Protocol(Enum): +class Protocol(str, Enum): tcp = "TCP" udp = "UDP" -class NextHopType(Enum): +class NextHopType(str, Enum): internet = "Internet" virtual_appliance = "VirtualAppliance" @@ -243,14 +243,14 @@ class NextHopType(Enum): none = "None" -class PcProtocol(Enum): +class PcProtocol(str, Enum): tcp = "TCP" udp = "UDP" any = "Any" -class PcStatus(Enum): +class PcStatus(str, Enum): not_started = "NotStarted" running = "Running" @@ -259,7 +259,7 @@ class PcStatus(Enum): unknown = "Unknown" -class PcError(Enum): +class PcError(str, Enum): internal_error = "InternalError" agent_stopped = "AgentStopped" @@ -268,26 +268,26 @@ class PcError(Enum): storage_failed = "StorageFailed" -class VirtualNetworkPeeringState(Enum): +class VirtualNetworkPeeringState(str, Enum): initiated = "Initiated" connected = "Connected" disconnected = "Disconnected" -class VirtualNetworkGatewayType(Enum): +class VirtualNetworkGatewayType(str, Enum): vpn = "Vpn" express_route = "ExpressRoute" -class VpnType(Enum): +class VpnType(str, Enum): policy_based = "PolicyBased" route_based = "RouteBased" -class VirtualNetworkGatewaySkuName(Enum): +class VirtualNetworkGatewaySkuName(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -295,7 +295,7 @@ class VirtualNetworkGatewaySkuName(Enum): ultra_performance = "UltraPerformance" -class VirtualNetworkGatewaySkuTier(Enum): +class VirtualNetworkGatewaySkuTier(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -303,7 +303,7 @@ class VirtualNetworkGatewaySkuTier(Enum): ultra_performance = "UltraPerformance" -class BgpPeerState(Enum): +class BgpPeerState(str, Enum): unknown = "Unknown" stopped = "Stopped" @@ -312,13 +312,13 @@ class BgpPeerState(Enum): connected = "Connected" -class ProcessorArchitecture(Enum): +class ProcessorArchitecture(str, Enum): amd64 = "Amd64" x86 = "X86" -class VirtualNetworkGatewayConnectionStatus(Enum): +class VirtualNetworkGatewayConnectionStatus(str, Enum): unknown = "Unknown" connecting = "Connecting" @@ -326,7 +326,7 @@ class VirtualNetworkGatewayConnectionStatus(Enum): not_connected = "NotConnected" -class VirtualNetworkGatewayConnectionType(Enum): +class VirtualNetworkGatewayConnectionType(str, Enum): ipsec = "IPsec" vnet2_vnet = "Vnet2Vnet" diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_security_group.py index 7b17499498eb..3cfd28bdd633 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_security_group.py @@ -75,12 +75,12 @@ class NetworkSecurityGroup(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, security_rules=None, default_security_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags) - self.security_rules = security_rules - self.default_security_rules = default_security_rules + def __init__(self, **kwargs): + super(NetworkSecurityGroup, self).__init__(**kwargs) + self.security_rules = kwargs.get('security_rules', None) + self.default_security_rules = kwargs.get('default_security_rules', None) self.network_interfaces = None self.subnets = None - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_security_group_py3.py new file mode 100644 index 000000000000..99d55d0d9d6f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_security_group_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkSecurityGroup(Resource): + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param security_rules: A collection of security rules of the network + security group. + :type security_rules: + list[~azure.mgmt.network.v2016_12_01.models.SecurityRule] + :param default_security_rules: The default security rules of network + security group. + :type default_security_rules: + list[~azure.mgmt.network.v2016_12_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network + interfaces. + :vartype network_interfaces: + list[~azure.mgmt.network.v2016_12_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2016_12_01.models.Subnet] + :param resource_guid: The resource GUID property of the network security + group resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, + 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, security_rules=None, default_security_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.security_rules = security_rules + self.default_security_rules = default_security_rules + self.network_interfaces = None + self.subnets = None + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_watcher.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_watcher.py index 3d7507b73ac1..219a99d82cbb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_watcher.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_watcher.py @@ -53,7 +53,7 @@ class NetworkWatcher(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, etag=None): - super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags) - self.etag = etag + def __init__(self, **kwargs): + super(NetworkWatcher, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_watcher_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_watcher_py3.py new file mode 100644 index 000000000000..0c844b80b3df --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/network_watcher_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkWatcher(Resource): + """Network watcher in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.network.v2016_12_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, etag: str=None, **kwargs) -> None: + super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = etag + self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_parameters.py index 3e1478409a0a..54d8674c8884 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_parameters.py @@ -15,12 +15,14 @@ class NextHopParameters(Model): """Parameters that define the source and destination endpoint. - :param target_resource_id: The resource identifier of the target resource - against which the action is to be performed. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. :type target_resource_id: str - :param source_ip_address: The source IP address. + :param source_ip_address: Required. The source IP address. :type source_ip_address: str - :param destination_ip_address: The destination IP address. + :param destination_ip_address: Required. The destination IP address. :type destination_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be @@ -41,9 +43,9 @@ class NextHopParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, source_ip_address, destination_ip_address, target_nic_resource_id=None): - super(NextHopParameters, self).__init__() - self.target_resource_id = target_resource_id - self.source_ip_address = source_ip_address - self.destination_ip_address = destination_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.source_ip_address = kwargs.get('source_ip_address', None) + self.destination_ip_address = kwargs.get('destination_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_parameters_py3.py new file mode 100644 index 000000000000..50ee3d334e91 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_parameters_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopParameters(Model): + """Parameters that define the source and destination endpoint. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. + :type target_resource_id: str + :param source_ip_address: Required. The source IP address. + :type source_ip_address: str + :param destination_ip_address: Required. The destination IP address. + :type destination_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of the nics, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'source_ip_address': {'required': True}, + 'destination_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, + 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, source_ip_address: str, destination_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.source_ip_address = source_ip_address + self.destination_ip_address = destination_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_result.py index 7b12ce6a69bd..99d76a71243c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_result.py @@ -35,8 +35,8 @@ class NextHopResult(Model): 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, } - def __init__(self, next_hop_type=None, next_hop_ip_address=None, route_table_id=None): - super(NextHopResult, self).__init__() - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.route_table_id = route_table_id + def __init__(self, **kwargs): + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.route_table_id = kwargs.get('route_table_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_result_py3.py new file mode 100644 index 000000000000..d78d1dd7121a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/next_hop_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopResult(Model): + """The information about next hop from the specified VM. + + :param next_hop_type: Next hop type. Possible values include: 'Internet', + 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', + 'HyperNetGateway', 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2016_12_01.models.NextHopType + :param next_hop_ip_address: Next hop IP Address + :type next_hop_ip_address: str + :param route_table_id: The resource identifier for the route table + associated with the route being returned. If the route being returned does + not correspond to any user created routes then this field will be the + string 'System Route'. + :type route_table_id: str + """ + + _attribute_map = { + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type=None, next_hop_ip_address: str=None, route_table_id: str=None, **kwargs) -> None: + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.route_table_id = route_table_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/outbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/outbound_nat_rule.py index 8e3f299fa42b..4444ac354363 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/outbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/outbound_nat_rule.py @@ -15,6 +15,8 @@ class OutboundNatRule(SubResource): """Outbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param allocated_outbound_ports: The number of outbound ports to be used @@ -24,8 +26,8 @@ class OutboundNatRule(SubResource): balancer. :type frontend_ip_configurations: list[~azure.mgmt.network.v2016_12_01.models.SubResource] - :param backend_address_pool: A reference to a pool of DIPs. Outbound - traffic is randomly load balanced across IPs in the backend IPs. + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. :type backend_address_pool: ~azure.mgmt.network.v2016_12_01.models.SubResource :param provisioning_state: Gets the provisioning state of the PublicIP @@ -53,11 +55,11 @@ class OutboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, backend_address_pool, id=None, allocated_outbound_ports=None, frontend_ip_configurations=None, provisioning_state=None, name=None, etag=None): - super(OutboundNatRule, self).__init__(id=id) - self.allocated_outbound_ports = allocated_outbound_ports - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pool = backend_address_pool - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(OutboundNatRule, self).__init__(**kwargs) + self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/outbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/outbound_nat_rule_py3.py new file mode 100644 index 000000000000..48f8e3039b3a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/outbound_nat_rule_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class OutboundNatRule(SubResource): + """Outbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param allocated_outbound_ports: The number of outbound ports to be used + for NAT. + :type allocated_outbound_ports: int + :param frontend_ip_configurations: The Frontend IP addresses of the load + balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2016_12_01.models.SubResource] + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_address_pool': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, backend_address_pool, id: str=None, allocated_outbound_ports: int=None, frontend_ip_configurations=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(OutboundNatRule, self).__init__(id=id, **kwargs) + self.allocated_outbound_ports = allocated_outbound_ports + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pool = backend_address_pool + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture.py index 9e553529baa2..c23063abda8f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture.py @@ -15,8 +15,10 @@ class PacketCapture(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCapture(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2016_12_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCapture(Model): 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCapture, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCapture, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_filter.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_filter.py index 158377603111..645c82611719 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_filter.py @@ -51,10 +51,10 @@ class PacketCaptureFilter(Model): 'remote_port': {'key': 'remotePort', 'type': 'str'}, } - def __init__(self, protocol="Any", local_ip_address=None, remote_ip_address=None, local_port=None, remote_port=None): - super(PacketCaptureFilter, self).__init__() - self.protocol = protocol - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.local_port = local_port - self.remote_port = remote_port + def __init__(self, **kwargs): + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', "Any") + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_filter_py3.py new file mode 100644 index 000000000000..a2b1dd6544f8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_filter_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureFilter(Model): + """Filter that is applied to packet capture request. Multiple filters can be + applied. + + :param protocol: Protocol to be filtered on. Possible values include: + 'TCP', 'UDP', 'Any'. Default value: "Any" . + :type protocol: str or ~azure.mgmt.network.v2016_12_01.models.PcProtocol + :param local_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type local_ip_address: str + :param remote_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type remote_ip_address: str + :param local_port: Local port to be filtered on. Notation: "80" for single + port entry."80-85" for range. "80;443;" for multiple entries. Multiple + ranges not currently supported. Mixing ranges with multiple entries not + currently supported. Default = null. + :type local_port: str + :param remote_port: Remote port to be filtered on. Notation: "80" for + single port entry."80-85" for range. "80;443;" for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple + entries not currently supported. Default = null. + :type remote_port: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + } + + def __init__(self, *, protocol="Any", local_ip_address: str=None, remote_ip_address: str=None, local_port: str=None, remote_port: str=None, **kwargs) -> None: + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = protocol + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.local_port = local_port + self.remote_port = remote_port diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_parameters.py index 948bad5adc71..820efd8da411 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_parameters.py @@ -15,8 +15,10 @@ class PacketCaptureParameters(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCaptureParameters(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2016_12_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCaptureParameters(Model): 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCaptureParameters, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_parameters_py3.py new file mode 100644 index 000000000000..66a65e71fb71 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_parameters_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureParameters(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2016_12_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2016_12_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_py3.py new file mode 100644 index 000000000000..a25e5b034ef7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCapture(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2016_12_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2016_12_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCapture, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_query_status_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_query_status_result.py index f87230ccb139..478ab81423b1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_query_status_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_query_status_result.py @@ -43,11 +43,11 @@ class PacketCaptureQueryStatusResult(Model): 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, } - def __init__(self, name=None, id=None, capture_start_time=None, packet_capture_status=None, stop_reason=None, packet_capture_error=None): - super(PacketCaptureQueryStatusResult, self).__init__() - self.name = name - self.id = id - self.capture_start_time = capture_start_time - self.packet_capture_status = packet_capture_status - self.stop_reason = stop_reason - self.packet_capture_error = packet_capture_error + def __init__(self, **kwargs): + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.capture_start_time = kwargs.get('capture_start_time', None) + self.packet_capture_status = kwargs.get('packet_capture_status', None) + self.stop_reason = kwargs.get('stop_reason', None) + self.packet_capture_error = kwargs.get('packet_capture_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_query_status_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_query_status_result_py3.py new file mode 100644 index 000000000000..d05799ee0b60 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_query_status_result_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureQueryStatusResult(Model): + """Status of packet capture session. + + :param name: The name of the packet capture resource. + :type name: str + :param id: The ID of the packet capture resource. + :type id: str + :param capture_start_time: The start time of the packet capture session. + :type capture_start_time: datetime + :param packet_capture_status: The status of the packet capture session. + Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', + 'Unknown' + :type packet_capture_status: str or + ~azure.mgmt.network.v2016_12_01.models.PcStatus + :param stop_reason: The reason the current packet capture session was + stopped. + :type stop_reason: str + :param packet_capture_error: List of errors of packet capture session. + :type packet_capture_error: list[str or + ~azure.mgmt.network.v2016_12_01.models.PcError] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, + 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, + 'stop_reason': {'key': 'stopReason', 'type': 'str'}, + 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, id: str=None, capture_start_time=None, packet_capture_status=None, stop_reason: str=None, packet_capture_error=None, **kwargs) -> None: + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = name + self.id = id + self.capture_start_time = capture_start_time + self.packet_capture_status = packet_capture_status + self.stop_reason = stop_reason + self.packet_capture_error = packet_capture_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_result.py index b685dc902176..b32dacc6cbae 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_result.py @@ -18,6 +18,8 @@ class PacketCaptureResult(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar name: Name of the packet capture session. :vartype name: str :ivar id: ID of the packet capture operation. @@ -25,8 +27,8 @@ class PacketCaptureResult(Model): :param etag: Default value: "A unique read-only string that changes whenever the resource is updated." . :type etag: str - :param target: The ID of the targeted resource, only VM is currently - supported. + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -37,7 +39,7 @@ class PacketCaptureResult(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2016_12_01.models.PacketCaptureStorageLocation :param filters: @@ -70,15 +72,15 @@ class PacketCaptureResult(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, target, storage_location, etag="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None, provisioning_state=None): - super(PacketCaptureResult, self).__init__() + def __init__(self, **kwargs): + super(PacketCaptureResult, self).__init__(**kwargs) self.name = None self.id = None - self.etag = etag - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters - self.provisioning_state = provisioning_state + self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_result_py3.py new file mode 100644 index 000000000000..87bd313bf67b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_result_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureResult(Model): + """Information about packet capture session. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the packet capture session. + :vartype name: str + :ivar id: ID of the packet capture operation. + :vartype id: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2016_12_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2016_12_01.models.PacketCaptureFilter] + :param provisioning_state: The provisioning state of the packet capture + session. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2016_12_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, target: str, storage_location, etag: str="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, provisioning_state=None, **kwargs) -> None: + super(PacketCaptureResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = etag + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_storage_location.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_storage_location.py index 773b04d22501..62ed83d592b3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_storage_location.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_storage_location.py @@ -35,8 +35,8 @@ class PacketCaptureStorageLocation(Model): 'file_path': {'key': 'filePath', 'type': 'str'}, } - def __init__(self, storage_id=None, storage_path=None, file_path=None): - super(PacketCaptureStorageLocation, self).__init__() - self.storage_id = storage_id - self.storage_path = storage_path - self.file_path = file_path + def __init__(self, **kwargs): + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) + self.file_path = kwargs.get('file_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_storage_location_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_storage_location_py3.py new file mode 100644 index 000000000000..6925dd4f9bdf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/packet_capture_storage_location_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureStorageLocation(Model): + """Describes the storage location for a packet capture session. + + :param storage_id: The ID of the storage account to save the packet + capture session. Required if no local file path is provided. + :type storage_id: str + :param storage_path: The URI of the storage path to save the packet + capture. Must be a well-formed URI describing the location to save the + packet capture. + :type storage_path: str + :param file_path: A valid local path on the targeting VM. Must include the + name of the capture file (*.cap). For linux virtual machine it must start + with /var/captures. Required if no storage ID is provided, otherwise + optional. + :type file_path: str + """ + + _attribute_map = { + 'storage_id': {'key': 'storageId', 'type': 'str'}, + 'storage_path': {'key': 'storagePath', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + } + + def __init__(self, *, storage_id: str=None, storage_path: str=None, file_path: str=None, **kwargs) -> None: + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = storage_id + self.storage_path = storage_path + self.file_path = file_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter.py index 9cb372615432..c834273c6b6b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter.py @@ -61,12 +61,12 @@ class PatchRouteFilter(SubResource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, rules=None, tags=None): - super(PatchRouteFilter, self).__init__(id=id) - self.rules = rules + def __init__(self, **kwargs): + super(PatchRouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) self.peerings = None self.provisioning_state = None self.name = None self.etag = None self.type = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter_py3.py new file mode 100644 index 000000000000..8f729e7f63e5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter_py3.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilter(SubResource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2016_12_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit + peerings. + :vartype peerings: + list[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'peerings': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, rules=None, tags=None, **kwargs) -> None: + super(PatchRouteFilter, self).__init__(id=id, **kwargs) + self.rules = rules + self.peerings = None + self.provisioning_state = None + self.name = None + self.etag = None + self.type = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter_rule.py index 4336e01e7a0b..5003b12ca79e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter_rule.py @@ -18,16 +18,18 @@ class PatchRouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2016_12_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -64,11 +66,11 @@ class PatchRouteFilterRule(SubResource): route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, tags=None): - super(PatchRouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(PatchRouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None self.name = None self.etag = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter_rule_py3.py new file mode 100644 index 000000000000..78386199a723 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/patch_route_filter_rule_py3.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2016_12_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, tags=None, **kwargs) -> None: + super(PatchRouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = None + self.etag = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/probe.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/probe.py index 4ccc632b8707..5e648a22427d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/probe.py @@ -18,20 +18,22 @@ class Probe(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar load_balancing_rules: The load balancer rules that use this probe. :vartype load_balancing_rules: list[~azure.mgmt.network.v2016_12_01.models.SubResource] - :param protocol: The protocol of the end point. Possible values are: - 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the - probe to be successful. If 'Http' is specified, a 200 OK response from the - specifies URI is required for the probe to be successful. Possible values - include: 'Http', 'Tcp' + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2016_12_01.models.ProbeProtocol - :param port: The port for communicating the probe. Possible values range - from 1 to 65535, inclusive. + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. :type port: int :param interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is @@ -78,14 +80,14 @@ class Probe(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, port, id=None, interval_in_seconds=None, number_of_probes=None, request_path=None, provisioning_state=None, name=None, etag=None): - super(Probe, self).__init__(id=id) + def __init__(self, **kwargs): + super(Probe, self).__init__(**kwargs) self.load_balancing_rules = None - self.protocol = protocol - self.port = port - self.interval_in_seconds = interval_in_seconds - self.number_of_probes = number_of_probes - self.request_path = request_path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.port = kwargs.get('port', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.number_of_probes = kwargs.get('number_of_probes', None) + self.request_path = kwargs.get('request_path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/probe_py3.py new file mode 100644 index 000000000000..c51245d279bb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Probe(SubResource): + """A load balancer probe. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar load_balancing_rules: The load balancer rules that use this probe. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2016_12_01.models.SubResource] + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2016_12_01.models.ProbeProtocol + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. + :type port: int + :param interval_in_seconds: The interval, in seconds, for how frequently + to probe the endpoint for health status. Typically, the interval is + slightly less than half the allocated timeout period (in seconds) which + allows two full probes before taking the instance out of rotation. The + default value is 15, the minimum value is 5. + :type interval_in_seconds: int + :param number_of_probes: The number of probes where if no response, will + result in stopping further traffic from being delivered to the endpoint. + This values allows endpoints to be taken out of rotation faster or slower + than the typical times used in Azure. + :type number_of_probes: int + :param request_path: The URI used for requesting health status from the + VM. Path is required if a protocol is set to http. Otherwise, it is not + allowed. There is no default value. + :type request_path: str + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'load_balancing_rules': {'readonly': True}, + 'protocol': {'required': True}, + 'port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, + 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, port: int, id: str=None, interval_in_seconds: int=None, number_of_probes: int=None, request_path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Probe, self).__init__(id=id, **kwargs) + self.load_balancing_rules = None + self.protocol = protocol + self.port = port + self.interval_in_seconds = interval_in_seconds + self.number_of_probes = number_of_probes + self.request_path = request_path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address.py index 0a78238ada70..8e651a89a20a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address.py @@ -82,14 +82,14 @@ class PublicIPAddress(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address=None, idle_timeout_in_minutes=None, resource_guid=None, provisioning_state=None, etag=None): - super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags) - self.public_ip_allocation_method = public_ip_allocation_method - self.public_ip_address_version = public_ip_address_version + def __init__(self, **kwargs): + super(PublicIPAddress, self).__init__(**kwargs) + self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) + self.public_ip_address_version = kwargs.get('public_ip_address_version', None) self.ip_configuration = None - self.dns_settings = dns_settings - self.ip_address = ip_address - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_address = kwargs.get('ip_address', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address_dns_settings.py index a248461f05d7..07dfe30433a6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address_dns_settings.py @@ -38,8 +38,8 @@ class PublicIPAddressDnsSettings(Model): 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, } - def __init__(self, domain_name_label=None, fqdn=None, reverse_fqdn=None): - super(PublicIPAddressDnsSettings, self).__init__() - self.domain_name_label = domain_name_label - self.fqdn = fqdn - self.reverse_fqdn = reverse_fqdn + def __init__(self, **kwargs): + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) + self.fqdn = kwargs.get('fqdn', None) + self.reverse_fqdn = kwargs.get('reverse_fqdn', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address_dns_settings_py3.py new file mode 100644 index 000000000000..e84aa9c10bf5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address_dns_settings_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressDnsSettings(Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :param domain_name_label: Gets or sets the Domain name label.The + concatenation of the domain name label and the regionalized DNS zone make + up the fully qualified domain name associated with the public IP address. + If a domain name label is specified, an A DNS record is created for the + public IP in the Microsoft Azure DNS system. + :type domain_name_label: str + :param fqdn: Gets the FQDN, Fully qualified domain name of the A DNS + record associated with the public IP. This is the concatenation of the + domainNameLabel and the regionalized DNS zone. + :type fqdn: str + :param reverse_fqdn: Gets or Sets the Reverse FQDN. A user-visible, fully + qualified domain name that resolves to this public IP address. If the + reverseFqdn is specified, then a PTR DNS record is created pointing from + the IP address in the in-addr.arpa domain to the reverse FQDN. + :type reverse_fqdn: str + """ + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, + } + + def __init__(self, *, domain_name_label: str=None, fqdn: str=None, reverse_fqdn: str=None, **kwargs) -> None: + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label + self.fqdn = fqdn + self.reverse_fqdn = reverse_fqdn diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address_py3.py new file mode 100644 index 000000000000..577038897ca9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/public_ip_address_py3.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PublicIPAddress(Resource): + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param public_ip_allocation_method: The public IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type public_ip_allocation_method: str or + ~azure.mgmt.network.v2016_12_01.models.IPAllocationMethod + :param public_ip_address_version: The public IP address version. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + :type public_ip_address_version: str or + ~azure.mgmt.network.v2016_12_01.models.IPVersion + :ivar ip_configuration: + :vartype ip_configuration: + ~azure.mgmt.network.v2016_12_01.models.IPConfiguration + :param dns_settings: The FQDN of the DNS record associated with the public + IP address. + :type dns_settings: + ~azure.mgmt.network.v2016_12_01.models.PublicIPAddressDnsSettings + :param ip_address: + :type ip_address: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param resource_guid: The resource GUID property of the public IP + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address: str=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.public_ip_allocation_method = public_ip_allocation_method + self.public_ip_address_version = public_ip_address_version + self.ip_configuration = None + self.dns_settings = dns_settings + self.ip_address = ip_address + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/query_troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/query_troubleshooting_parameters.py index 9b6801eb7b63..6ae1924916c6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/query_troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/query_troubleshooting_parameters.py @@ -15,7 +15,9 @@ class QueryTroubleshootingParameters(Model): """Parameters that define the resource to query the troubleshooting result. - :param target_resource_id: The target resource ID to query the + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the troubleshooting result. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class QueryTroubleshootingParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(QueryTroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/query_troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/query_troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..b5fccb87857c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/query_troubleshooting_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryTroubleshootingParameters(Model): + """Parameters that define the resource to query the troubleshooting result. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the + troubleshooting result. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource.py index 5dfb000318bf..b12801be9996 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource.py @@ -43,10 +43,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, location=None, tags=None): - super(Resource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource_navigation_link.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource_navigation_link.py index 9b4484be654a..705698f513f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource_navigation_link.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource_navigation_link.py @@ -49,10 +49,10 @@ class ResourceNavigationLink(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, linked_resource_type=None, link=None, name=None): - super(ResourceNavigationLink, self).__init__(id=id) - self.linked_resource_type = linked_resource_type - self.link = link + def __init__(self, **kwargs): + super(ResourceNavigationLink, self).__init__(**kwargs) + self.linked_resource_type = kwargs.get('linked_resource_type', None) + self.link = kwargs.get('link', None) self.provisioning_state = None - self.name = name + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource_navigation_link_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource_navigation_link_py3.py new file mode 100644 index 000000000000..5cb22d347836 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource_navigation_link_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ResourceNavigationLink(SubResource): + """ResourceNavigationLink resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource + :type link: str + :ivar provisioning_state: Provisioning state of the ResourceNavigationLink + resource. + :vartype provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, linked_resource_type: str=None, link: str=None, name: str=None, **kwargs) -> None: + super(ResourceNavigationLink, self).__init__(id=id, **kwargs) + self.linked_resource_type = linked_resource_type + self.link = link + self.provisioning_state = None + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource_py3.py new file mode 100644 index 000000000000..0678b03d46f5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/resource_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/retention_policy_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/retention_policy_parameters.py index 102f4c5c3b4c..28cb43056d47 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/retention_policy_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/retention_policy_parameters.py @@ -26,7 +26,7 @@ class RetentionPolicyParameters(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, days=0, enabled=False): - super(RetentionPolicyParameters, self).__init__() - self.days = days - self.enabled = enabled + def __init__(self, **kwargs): + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = kwargs.get('days', 0) + self.enabled = kwargs.get('enabled', False) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/retention_policy_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/retention_policy_parameters_py3.py new file mode 100644 index 000000000000..3b2ffc5e741e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/retention_policy_parameters_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RetentionPolicyParameters(Model): + """Parameters that define the retention policy for flow log. + + :param days: Number of days to retain flow log records. Default value: 0 . + :type days: int + :param enabled: Flag to enable/disable retention. Default value: False . + :type enabled: bool + """ + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, days: int=0, enabled: bool=False, **kwargs) -> None: + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = days + self.enabled = enabled diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route.py index 234bce36cc04..a46b2ce79508 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route.py @@ -15,13 +15,15 @@ class Route(SubResource): """Route resource. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param address_prefix: The destination CIDR to which the route applies. :type address_prefix: str - :param next_hop_type: The type of Azure hop the packet should be sent to. - Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - 'VirtualAppliance', and 'None'. Possible values include: + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' :type next_hop_type: str or @@ -55,11 +57,11 @@ class Route(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, next_hop_type, id=None, address_prefix=None, next_hop_ip_address=None, provisioning_state=None, name=None, etag=None): - super(Route, self).__init__(id=id) - self.address_prefix = address_prefix - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(Route, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter.py index 46d4d70c164e..7156bd9c24d2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter.py @@ -63,9 +63,9 @@ class RouteFilter(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, rules=None): - super(RouteFilter, self).__init__(id=id, location=location, tags=tags) - self.rules = rules + def __init__(self, **kwargs): + super(RouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) self.peerings = None self.provisioning_state = None self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter_py3.py new file mode 100644 index 000000000000..da9f427e597d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteFilter(Resource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2016_12_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit + peerings. + :vartype peerings: + list[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'peerings': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, rules=None, **kwargs) -> None: + super(RouteFilter, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.rules = rules + self.peerings = None + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter_rule.py index 10aed3e757e6..baeb11c66c30 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter_rule.py @@ -18,16 +18,18 @@ class RouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2016_12_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -67,12 +69,12 @@ class RouteFilterRule(SubResource): route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, location=None, tags=None): - super(RouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(RouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None self.name = None - self.location = location + self.location = kwargs.get('location', None) self.etag = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter_rule_py3.py new file mode 100644 index 000000000000..a873df21a493 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_filter_rule_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class RouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2016_12_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :param location: Resource location. + :type location: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(RouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = None + self.location = location + self.etag = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_py3.py new file mode 100644 index 000000000000..8be8bb992a32 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Route(SubResource): + """Route resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param address_prefix: The destination CIDR to which the route applies. + :type address_prefix: str + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2016_12_01.models.RouteNextHopType + :param next_hop_ip_address: The IP address packets should be forwarded to. + Next hop values are only allowed in routes where the next hop type is + VirtualAppliance. + :type next_hop_ip_address: str + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'next_hop_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type, id: str=None, address_prefix: str=None, next_hop_ip_address: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Route, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_table.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_table.py index 586c9711c924..1b532e2f332d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_table.py @@ -58,9 +58,9 @@ class RouteTable(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, routes=None, provisioning_state=None, etag=None): - super(RouteTable, self).__init__(id=id, location=location, tags=tags) - self.routes = routes + def __init__(self, **kwargs): + super(RouteTable, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) self.subnets = None - self.provisioning_state = provisioning_state - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_table_py3.py new file mode 100644 index 000000000000..106db6b3a293 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/route_table_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteTable(Resource): + """Route table resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param routes: Collection of routes contained within a route table. + :type routes: list[~azure.mgmt.network.v2016_12_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2016_12_01.models.Subnet] + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'routes': {'key': 'properties.routes', 'type': '[Route]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, routes=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(RouteTable, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.routes = routes + self.subnets = None + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_network_interface.py index 81bad6c3d83f..ef9055947a3c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_network_interface.py @@ -27,7 +27,7 @@ class SecurityGroupNetworkInterface(Model): 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, } - def __init__(self, id=None, security_rule_associations=None): - super(SecurityGroupNetworkInterface, self).__init__() - self.id = id - self.security_rule_associations = security_rule_associations + def __init__(self, **kwargs): + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.security_rule_associations = kwargs.get('security_rule_associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_network_interface_py3.py new file mode 100644 index 000000000000..bc5311027d02 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_network_interface_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupNetworkInterface(Model): + """Network interface and all its associated security rules. + + :param id: ID of the network interface. + :type id: str + :param security_rule_associations: + :type security_rule_associations: + ~azure.mgmt.network.v2016_12_01.models.SecurityRuleAssociations + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, + } + + def __init__(self, *, id: str=None, security_rule_associations=None, **kwargs) -> None: + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = id + self.security_rule_associations = security_rule_associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_parameters.py index 5c0972e5d55e..1d547b0b0e2b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_parameters.py @@ -15,7 +15,9 @@ class SecurityGroupViewParameters(Model): """Parameters that define the VM to check security groups for. - :param target_resource_id: ID of the target VM. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. :type target_resource_id: str """ @@ -27,6 +29,6 @@ class SecurityGroupViewParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(SecurityGroupViewParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_parameters_py3.py new file mode 100644 index 000000000000..7ccc48017444 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_parameters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewParameters(Model): + """Parameters that define the VM to check security groups for. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_result.py index ecae72fce286..532490f202cc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_result.py @@ -24,6 +24,6 @@ class SecurityGroupViewResult(Model): 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, } - def __init__(self, network_interfaces=None): - super(SecurityGroupViewResult, self).__init__() - self.network_interfaces = network_interfaces + def __init__(self, **kwargs): + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_result_py3.py new file mode 100644 index 000000000000..1d31d7863e72 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_group_view_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewResult(Model): + """The information about security rules applied to the specified VM. + + :param network_interfaces: List of network interfaces on the specified VM. + :type network_interfaces: + list[~azure.mgmt.network.v2016_12_01.models.SecurityGroupNetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule.py index 9b81785f71cb..457f83e5f479 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule.py @@ -15,12 +15,15 @@ class SecurityRule(SubResource): """Network security rule. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param description: A description for this rule. Restricted to 140 chars. :type description: str - :param protocol: Network protocol this rule applies to. Possible values - are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*' + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' :type protocol: str or ~azure.mgmt.network.v2016_12_01.models.SecurityRuleProtocol :param source_port_range: The source port or range. Integer or range @@ -30,18 +33,19 @@ class SecurityRule(SubResource): range between 0 and 65535. Asterix '*' can also be used to match all ports. :type destination_port_range: str - :param source_address_prefix: The CIDR or source IP range. Asterix '*' can - also be used to match all source IPs. Default tags such as + :param source_address_prefix: Required. The CIDR or source IP range. + Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. :type source_address_prefix: str - :param destination_address_prefix: The destination address prefix. CIDR or - source IP range. Asterix '*' can also be used to match all source IPs. - Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - can also be used. + :param destination_address_prefix: Required. The destination address + prefix. CIDR or source IP range. Asterix '*' can also be used to match all + source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. :type destination_address_prefix: str - :param access: The network traffic is allowed or denied. Possible values - are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' :type access: str or ~azure.mgmt.network.v2016_12_01.models.SecurityRuleAccess :param priority: The priority of the rule. The value can be between 100 @@ -49,10 +53,10 @@ class SecurityRule(SubResource): collection. The lower the priority number, the higher the priority of the rule. :type priority: int - :param direction: The direction of the rule. The direction specifies if - rule will be evaluated on incoming or outcoming traffic. Possible values - are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', - 'Outbound' + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2016_12_01.models.SecurityRuleDirection :param provisioning_state: The provisioning state of the public IP @@ -90,17 +94,17 @@ class SecurityRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, source_address_prefix, destination_address_prefix, access, direction, id=None, description=None, source_port_range=None, destination_port_range=None, priority=None, provisioning_state=None, name=None, etag=None): - super(SecurityRule, self).__init__(id=id) - self.description = description - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_address_prefix = source_address_prefix - self.destination_address_prefix = destination_address_prefix - self.access = access - self.priority = priority - self.direction = direction - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(SecurityRule, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule_associations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule_associations.py index 82027ab31003..358ffe8b3daa 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule_associations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule_associations.py @@ -37,9 +37,9 @@ class SecurityRuleAssociations(Model): 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, } - def __init__(self, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None): - super(SecurityRuleAssociations, self).__init__() - self.network_interface_association = network_interface_association - self.subnet_association = subnet_association - self.default_security_rules = default_security_rules - self.effective_security_rules = effective_security_rules + def __init__(self, **kwargs): + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = kwargs.get('network_interface_association', None) + self.subnet_association = kwargs.get('subnet_association', None) + self.default_security_rules = kwargs.get('default_security_rules', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule_associations_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule_associations_py3.py new file mode 100644 index 000000000000..5979e864b8cc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule_associations_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityRuleAssociations(Model): + """All security rules associated with the network interface. + + :param network_interface_association: + :type network_interface_association: + ~azure.mgmt.network.v2016_12_01.models.NetworkInterfaceAssociation + :param subnet_association: + :type subnet_association: + ~azure.mgmt.network.v2016_12_01.models.SubnetAssociation + :param default_security_rules: Collection of default security rules of the + network security group. + :type default_security_rules: + list[~azure.mgmt.network.v2016_12_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2016_12_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, + 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, + 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__(self, *, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None, **kwargs) -> None: + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = network_interface_association + self.subnet_association = subnet_association + self.default_security_rules = default_security_rules + self.effective_security_rules = effective_security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule_py3.py new file mode 100644 index 000000000000..7095ff8f3a0a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule_py3.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class SecurityRule(SubResource): + """Network security rule. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2016_12_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. Integer or range + between 0 and 65535. Asterix '*' can also be used to match all ports. + :type source_port_range: str + :param destination_port_range: The destination port or range. Integer or + range between 0 and 65535. Asterix '*' can also be used to match all + ports. + :type destination_port_range: str + :param source_address_prefix: Required. The CIDR or source IP range. + Asterix '*' can also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + this is an ingress rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param destination_address_prefix: Required. The destination address + prefix. CIDR or source IP range. Asterix '*' can also be used to match all + source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. + :type destination_address_prefix: str + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' + :type access: str or + ~azure.mgmt.network.v2016_12_01.models.SecurityRuleAccess + :param priority: The priority of the rule. The value can be between 100 + and 4096. The priority number must be unique for each rule in the + collection. The lower the priority number, the higher the priority of the + rule. + :type priority: int + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2016_12_01.models.SecurityRuleDirection + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'source_address_prefix': {'required': True}, + 'destination_address_prefix': {'required': True}, + 'access': {'required': True}, + 'direction': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, source_address_prefix: str, destination_address_prefix: str, access, direction, id: str=None, description: str=None, source_port_range: str=None, destination_port_range: str=None, priority: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(SecurityRule, self).__init__(id=id, **kwargs) + self.description = description + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/sub_resource.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/sub_resource.py index d4a564864add..3210cb8c9187 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/sub_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/sub_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/sub_resource_py3.py new file mode 100644 index 000000000000..25ef1e7dc9a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """SubResource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet.py index 08c6131101e1..922ca16169a5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet.py @@ -62,13 +62,13 @@ class Subnet(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, address_prefix=None, network_security_group=None, route_table=None, resource_navigation_links=None, provisioning_state=None, name=None, etag=None): - super(Subnet, self).__init__(id=id) - self.address_prefix = address_prefix - self.network_security_group = network_security_group - self.route_table = route_table + def __init__(self, **kwargs): + super(Subnet, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.route_table = kwargs.get('route_table', None) self.ip_configurations = None - self.resource_navigation_links = resource_navigation_links - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.resource_navigation_links = kwargs.get('resource_navigation_links', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet_association.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet_association.py index 0f35ac1975da..ba7cc1dc09af 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet_association.py @@ -34,7 +34,7 @@ class SubnetAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(SubnetAssociation, self).__init__() + def __init__(self, **kwargs): + super(SubnetAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet_association_py3.py new file mode 100644 index 000000000000..99983f3e5e6c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Subnet ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2016_12_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(SubnetAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet_py3.py new file mode 100644 index 000000000000..713059b3869a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/subnet_py3.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Subnet(SubResource): + """Subnet in a virtual network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param address_prefix: The address prefix for the subnet. + :type address_prefix: str + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2016_12_01.models.NetworkSecurityGroup + :param route_table: The reference of the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2016_12_01.models.RouteTable + :ivar ip_configurations: Gets an array of references to the network + interface IP configurations using subnet. + :vartype ip_configurations: + list[~azure.mgmt.network.v2016_12_01.models.IPConfiguration] + :param resource_navigation_links: Gets an array of references to the + external resources using subnet. + :type resource_navigation_links: + list[~azure.mgmt.network.v2016_12_01.models.ResourceNavigationLink] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'ip_configurations': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, + 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, address_prefix: str=None, network_security_group=None, route_table=None, resource_navigation_links=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Subnet, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.network_security_group = network_security_group + self.route_table = route_table + self.ip_configurations = None + self.resource_navigation_links = resource_navigation_links + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology.py index 79f139ec13b8..7214db3cfa05 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology.py @@ -43,9 +43,9 @@ class Topology(Model): 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, } - def __init__(self, resources=None): - super(Topology, self).__init__() + def __init__(self, **kwargs): + super(Topology, self).__init__(**kwargs) self.id = None self.created_date_time = None self.last_modified = None - self.resources = resources + self.resources = kwargs.get('resources', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_association.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_association.py index ec44a73b9f8c..d2163a4b81fe 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_association.py @@ -33,8 +33,8 @@ class TopologyAssociation(Model): 'association_type': {'key': 'associationType', 'type': 'str'}, } - def __init__(self, name=None, resource_id=None, association_type=None): - super(TopologyAssociation, self).__init__() - self.name = name - self.resource_id = resource_id - self.association_type = association_type + def __init__(self, **kwargs): + super(TopologyAssociation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.resource_id = kwargs.get('resource_id', None) + self.association_type = kwargs.get('association_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_association_py3.py new file mode 100644 index 000000000000..7641e217f833 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyAssociation(Model): + """Resources that have an association with the parent resource. + + :param name: The name of the resource that is associated with the parent + resource. + :type name: str + :param resource_id: The ID of the resource that is associated with the + parent resource. + :type resource_id: str + :param association_type: The association type of the child resource to the + parent resource. Possible values include: 'Associated', 'Contains' + :type association_type: str or + ~azure.mgmt.network.v2016_12_01.models.AssociationType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'association_type': {'key': 'associationType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, resource_id: str=None, association_type=None, **kwargs) -> None: + super(TopologyAssociation, self).__init__(**kwargs) + self.name = name + self.resource_id = resource_id + self.association_type = association_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_parameters.py index 04920dc9665d..c7065ef57c09 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_parameters.py @@ -15,8 +15,10 @@ class TopologyParameters(Model): """Parameters that define the representation of topology. - :param target_resource_group_name: The name of the target resource group - to perform topology on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_group_name: Required. The name of the target + resource group to perform topology on. :type target_resource_group_name: str """ @@ -28,6 +30,6 @@ class TopologyParameters(Model): 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, } - def __init__(self, target_resource_group_name): - super(TopologyParameters, self).__init__() - self.target_resource_group_name = target_resource_group_name + def __init__(self, **kwargs): + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = kwargs.get('target_resource_group_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_parameters_py3.py new file mode 100644 index 000000000000..90c2365d8dba --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyParameters(Model): + """Parameters that define the representation of topology. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group_name: Required. The name of the target + resource group to perform topology on. + :type target_resource_group_name: str + """ + + _validation = { + 'target_resource_group_name': {'required': True}, + } + + _attribute_map = { + 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, + } + + def __init__(self, *, target_resource_group_name: str, **kwargs) -> None: + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = target_resource_group_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_py3.py new file mode 100644 index 000000000000..276f0654d675 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Topology(Model): + """Topology of the specified resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: GUID representing the operation id. + :vartype id: str + :ivar created_date_time: The datetime when the topology was initially + created for the resource group. + :vartype created_date_time: datetime + :ivar last_modified: The datetime when the topology was last modified. + :vartype last_modified: datetime + :param resources: + :type resources: + list[~azure.mgmt.network.v2016_12_01.models.TopologyResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, + } + + def __init__(self, *, resources=None, **kwargs) -> None: + super(Topology, self).__init__(**kwargs) + self.id = None + self.created_date_time = None + self.last_modified = None + self.resources = resources diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_resource.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_resource.py index bb6f13c2a0d3..de6f99707f67 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_resource.py @@ -34,9 +34,9 @@ class TopologyResource(Model): 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, } - def __init__(self, name=None, id=None, location=None, associations=None): - super(TopologyResource, self).__init__() - self.name = name - self.id = id - self.location = location - self.associations = associations + def __init__(self, **kwargs): + super(TopologyResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.associations = kwargs.get('associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_resource_py3.py new file mode 100644 index 000000000000..493e954d4a64 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/topology_resource_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyResource(Model): + """The network resource topology information for the given resource group. + + :param name: Name of the resource. + :type name: str + :param id: ID of the resource. + :type id: str + :param location: Resource location. + :type location: str + :param associations: Holds the associations the resource has with other + resources in the resource group. + :type associations: + list[~azure.mgmt.network.v2016_12_01.models.TopologyAssociation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, + } + + def __init__(self, *, name: str=None, id: str=None, location: str=None, associations=None, **kwargs) -> None: + super(TopologyResource, self).__init__(**kwargs) + self.name = name + self.id = id + self.location = location + self.associations = associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_details.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_details.py index 84a87a762683..08be3c87b663 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_details.py @@ -36,10 +36,10 @@ class TroubleshootingDetails(Model): 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, } - def __init__(self, id=None, reason_type=None, summary=None, detail=None, recommended_actions=None): - super(TroubleshootingDetails, self).__init__() - self.id = id - self.reason_type = reason_type - self.summary = summary - self.detail = detail - self.recommended_actions = recommended_actions + def __init__(self, **kwargs): + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.reason_type = kwargs.get('reason_type', None) + self.summary = kwargs.get('summary', None) + self.detail = kwargs.get('detail', None) + self.recommended_actions = kwargs.get('recommended_actions', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_details_py3.py new file mode 100644 index 000000000000..c277a94df9fd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_details_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingDetails(Model): + """Information gained from troubleshooting of specified resource. + + :param id: The id of the get troubleshoot operation. + :type id: str + :param reason_type: Reason type of failure. + :type reason_type: str + :param summary: A summary of troubleshooting. + :type summary: str + :param detail: Details on troubleshooting results. + :type detail: str + :param recommended_actions: List of recommended actions. + :type recommended_actions: + list[~azure.mgmt.network.v2016_12_01.models.TroubleshootingRecommendedActions] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'reason_type': {'key': 'reasonType', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'detail': {'key': 'detail', 'type': 'str'}, + 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, + } + + def __init__(self, *, id: str=None, reason_type: str=None, summary: str=None, detail: str=None, recommended_actions=None, **kwargs) -> None: + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = id + self.reason_type = reason_type + self.summary = summary + self.detail = detail + self.recommended_actions = recommended_actions diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_parameters.py index c4833fb8eeb3..6b11d3eb5ffc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_parameters.py @@ -15,13 +15,15 @@ class TroubleshootingParameters(Model): """Parameters that define the resource to troubleshoot. - :param target_resource_id: The target resource to troubleshoot. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. :type target_resource_id: str - :param storage_id: The ID for the storage account to save the troubleshoot - result. + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. :type storage_id: str - :param storage_path: The path to the blob to save the troubleshoot result - in. + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. :type storage_path: str """ @@ -37,8 +39,8 @@ class TroubleshootingParameters(Model): 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, } - def __init__(self, target_resource_id, storage_id, storage_path): - super(TroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.storage_path = storage_path + def __init__(self, **kwargs): + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..e010b7bdc9de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_parameters_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingParameters(Model): + """Parameters that define the resource to troubleshoot. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. + :type target_resource_id: str + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. + :type storage_id: str + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. + :type storage_path: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'storage_path': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, storage_path: str, **kwargs) -> None: + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.storage_path = storage_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_recommended_actions.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_recommended_actions.py index cbc5e31177c7..be395be4ad54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_recommended_actions.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_recommended_actions.py @@ -34,9 +34,9 @@ class TroubleshootingRecommendedActions(Model): 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, } - def __init__(self, action_id=None, action_text=None, action_uri=None, action_uri_text=None): - super(TroubleshootingRecommendedActions, self).__init__() - self.action_id = action_id - self.action_text = action_text - self.action_uri = action_uri - self.action_uri_text = action_uri_text + def __init__(self, **kwargs): + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = kwargs.get('action_id', None) + self.action_text = kwargs.get('action_text', None) + self.action_uri = kwargs.get('action_uri', None) + self.action_uri_text = kwargs.get('action_uri_text', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_recommended_actions_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_recommended_actions_py3.py new file mode 100644 index 000000000000..05c3f654353b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_recommended_actions_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingRecommendedActions(Model): + """Recommended actions based on discovered issues. + + :param action_id: ID of the recommended action. + :type action_id: str + :param action_text: Description of recommended actions. + :type action_text: str + :param action_uri: The uri linking to a documentation for the recommended + troubleshooting actions. + :type action_uri: str + :param action_uri_text: The information from the URI for the recommended + troubleshooting actions. + :type action_uri_text: str + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'action_text': {'key': 'actionText', 'type': 'str'}, + 'action_uri': {'key': 'actionUri', 'type': 'str'}, + 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, + } + + def __init__(self, *, action_id: str=None, action_text: str=None, action_uri: str=None, action_uri_text: str=None, **kwargs) -> None: + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = action_id + self.action_text = action_text + self.action_uri = action_uri + self.action_uri_text = action_uri_text diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_result.py index 2fcc5586d029..1c95bd6795ea 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_result.py @@ -33,9 +33,9 @@ class TroubleshootingResult(Model): 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, } - def __init__(self, start_time=None, end_time=None, code=None, results=None): - super(TroubleshootingResult, self).__init__() - self.start_time = start_time - self.end_time = end_time - self.code = code - self.results = results + def __init__(self, **kwargs): + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.code = kwargs.get('code', None) + self.results = kwargs.get('results', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_result_py3.py new file mode 100644 index 000000000000..9e1ee5dae7ff --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/troubleshooting_result_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingResult(Model): + """Troubleshooting information gained from specified resource. + + :param start_time: The start time of the troubleshooting. + :type start_time: datetime + :param end_time: The end time of the troubleshooting. + :type end_time: datetime + :param code: The result code of the troubleshooting. + :type code: str + :param results: Information from troubleshooting. + :type results: + list[~azure.mgmt.network.v2016_12_01.models.TroubleshootingDetails] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, + } + + def __init__(self, *, start_time=None, end_time=None, code: str=None, results=None, **kwargs) -> None: + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.code = code + self.results = results diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/tunnel_connection_health.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/tunnel_connection_health.py index b767820852b2..28ee61f52df6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/tunnel_connection_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/tunnel_connection_health.py @@ -52,8 +52,8 @@ class TunnelConnectionHealth(Model): 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, } - def __init__(self): - super(TunnelConnectionHealth, self).__init__() + def __init__(self, **kwargs): + super(TunnelConnectionHealth, self).__init__(**kwargs) self.tunnel = None self.connection_status = None self.ingress_bytes_transferred = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/tunnel_connection_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/tunnel_connection_health_py3.py new file mode 100644 index 000000000000..e94d1b59f4bb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/tunnel_connection_health_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TunnelConnectionHealth(Model): + """VirtualNetworkGatewayConnection properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tunnel: Tunnel name. + :vartype tunnel: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values include: 'Unknown', 'Connecting', 'Connected', + 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayConnectionStatus + :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this + connection + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: The Egress Bytes Transferred in this + connection + :vartype egress_bytes_transferred: long + :ivar last_connection_established_utc_time: The time at which connection + was established in Utc format. + :vartype last_connection_established_utc_time: str + """ + + _validation = { + 'tunnel': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'last_connection_established_utc_time': {'readonly': True}, + } + + _attribute_map = { + 'tunnel': {'key': 'tunnel', 'type': 'str'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TunnelConnectionHealth, self).__init__(**kwargs) + self.tunnel = None + self.connection_status = None + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.last_connection_established_utc_time = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage.py index 2c711d84a428..348eacef942e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage.py @@ -18,14 +18,16 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar unit: An enum describing the unit of measurement. Default value: - "Count" . + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . :vartype unit: str - :param current_value: The current value of the usage. + :param current_value: Required. The current value of the usage. :type current_value: long - :param limit: The limit of usage. + :param limit: Required. The limit of usage. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.network.v2016_12_01.models.UsageName """ @@ -45,8 +47,8 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() - self.current_value = current_value - self.limit = limit - self.name = name + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage_name.py index df7f344bfb9b..bd1813944fdc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage_name_py3.py new file mode 100644 index 000000000000..4e5e3e10de15 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage_py3.py new file mode 100644 index 000000000000..8247198e33e5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes network resource usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . + :vartype unit: str + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.network.v2016_12_01.models.UsageName + """ + + _validation = { + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_parameters.py index a769920b56ec..3b3278fb4b91 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_parameters.py @@ -15,28 +15,30 @@ class VerificationIPFlowParameters(Model): """Parameters that define the IP flow to be verified. - :param target_resource_id: The ID of the target resource to perform - next-hop on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. :type target_resource_id: str - :param direction: The direction of the packet represented as a 5-tuple. - Possible values include: 'Inbound', 'Outbound' + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2016_12_01.models.Direction - :param protocol: Protocol to be verified on. Possible values include: - 'TCP', 'UDP' + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' :type protocol: str or ~azure.mgmt.network.v2016_12_01.models.Protocol - :param local_port: The local port. Acceptable values are a single integer - in the range (0-65535). Support for * for the source port, which depends - on the direction. + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type local_port: str - :param remote_port: The remote port. Acceptable values are a single - integer in the range (0-65535). Support for * for the source port, which - depends on the direction. + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type remote_port: str - :param local_ip_address: The local IP address. Acceptable values are valid - IPv4 addresses. + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. :type local_ip_address: str - :param remote_ip_address: The remote IP address. Acceptable values are - valid IPv4 addresses. + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. :type remote_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be @@ -65,13 +67,13 @@ class VerificationIPFlowParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, direction, protocol, local_port, remote_port, local_ip_address, remote_ip_address, target_nic_resource_id=None): - super(VerificationIPFlowParameters, self).__init__() - self.target_resource_id = target_resource_id - self.direction = direction - self.protocol = protocol - self.local_port = local_port - self.remote_port = remote_port - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.direction = kwargs.get('direction', None) + self.protocol = kwargs.get('protocol', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_parameters_py3.py new file mode 100644 index 000000000000..554b1b9bb49e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_parameters_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowParameters(Model): + """Parameters that define the IP flow to be verified. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. + :type target_resource_id: str + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' + :type direction: str or ~azure.mgmt.network.v2016_12_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' + :type protocol: str or ~azure.mgmt.network.v2016_12_01.models.Protocol + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type local_port: str + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type remote_port: str + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. + :type local_ip_address: str + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. + :type remote_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of them, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'local_port': {'required': True}, + 'remote_port': {'required': True}, + 'local_ip_address': {'required': True}, + 'remote_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, direction, protocol, local_port: str, remote_port: str, local_ip_address: str, remote_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.direction = direction + self.protocol = protocol + self.local_port = local_port + self.remote_port = remote_port + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_result.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_result.py index 8b8945ca9928..19f43d9e528f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_result.py @@ -28,7 +28,7 @@ class VerificationIPFlowResult(Model): 'rule_name': {'key': 'ruleName', 'type': 'str'}, } - def __init__(self, access=None, rule_name=None): - super(VerificationIPFlowResult, self).__init__() - self.access = access - self.rule_name = rule_name + def __init__(self, **kwargs): + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.rule_name = kwargs.get('rule_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_result_py3.py new file mode 100644 index 000000000000..44eca1392b0d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/verification_ip_flow_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowResult(Model): + """Results of IP flow verification on the target resource. + + :param access: Indicates whether the traffic is allowed or denied. + Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2016_12_01.models.Access + :param rule_name: Name of the rule. If input is not matched against any + security rule, it is not displayed. + :type rule_name: str + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + } + + def __init__(self, *, access=None, rule_name: str=None, **kwargs) -> None: + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = access + self.rule_name = rule_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network.py index 8bae347be051..081202b14f95 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network.py @@ -70,12 +70,12 @@ class VirtualNetwork(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid=None, provisioning_state=None, etag=None): - super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags) - self.address_space = address_space - self.dhcp_options = dhcp_options - self.subnets = subnets - self.virtual_network_peerings = virtual_network_peerings - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetwork, self).__init__(**kwargs) + self.address_space = kwargs.get('address_space', None) + self.dhcp_options = kwargs.get('dhcp_options', None) + self.subnets = kwargs.get('subnets', None) + self.virtual_network_peerings = kwargs.get('virtual_network_peerings', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway.py index 45b0bcfc9abe..7cedf47f1ecc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway.py @@ -98,17 +98,17 @@ class VirtualNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp=None, active_active=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid=None, etag=None): - super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.ip_configurations = ip_configurations - self.gateway_type = gateway_type - self.vpn_type = vpn_type - self.enable_bgp = enable_bgp - self.active_active = active_active - self.gateway_default_site = gateway_default_site - self.sku = sku - self.vpn_client_configuration = vpn_client_configuration - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(VirtualNetworkGateway, self).__init__(**kwargs) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.gateway_type = kwargs.get('gateway_type', None) + self.vpn_type = kwargs.get('vpn_type', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.active_active = kwargs.get('active_active', None) + self.gateway_default_site = kwargs.get('gateway_default_site', None) + self.sku = kwargs.get('sku', None) + self.vpn_client_configuration = kwargs.get('vpn_client_configuration', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_connection.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_connection.py index aa7c58a8e6d0..ce094e945dc6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_connection.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_connection.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayConnection(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -30,7 +32,7 @@ class VirtualNetworkGatewayConnection(Resource): :type tags: dict[str, str] :param authorization_key: The authorizationKey. :type authorization_key: str - :param virtual_network_gateway1: + :param virtual_network_gateway1: Required. :type virtual_network_gateway1: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway :param virtual_network_gateway2: @@ -39,8 +41,8 @@ class VirtualNetworkGatewayConnection(Resource): :param local_network_gateway2: :type local_network_gateway2: ~azure.mgmt.network.v2016_12_01.models.LocalNetworkGateway - :param connection_type: Gateway connection type. Possible values are: - 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' :type connection_type: str or ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayConnectionType @@ -116,21 +118,21 @@ class VirtualNetworkGatewayConnection(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, virtual_network_gateway1, connection_type, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight=None, shared_key=None, peer=None, enable_bgp=None, resource_guid=None, etag=None): - super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnection, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) self.connection_status = None self.tunnel_connection_status = None self.egress_bytes_transferred = None self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.resource_guid = resource_guid + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_connection_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_connection_py3.py new file mode 100644 index 000000000000..1ba7f4157bdd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_connection_py3.py @@ -0,0 +1,138 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnection(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: + :type virtual_network_gateway2: + ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway + :param local_network_gateway2: + :type local_network_gateway2: + ~azure.mgmt.network.v2016_12_01.models.LocalNetworkGateway + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2016_12_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2016_12_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_ip_configuration.py index 01fab47a799a..e4bc05b89c74 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_ip_configuration.py @@ -55,11 +55,11 @@ class VirtualNetworkGatewayIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name=None, etag=None): - super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id) - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address + def __init__(self, **kwargs): + super(VirtualNetworkGatewayIPConfiguration, self).__init__(**kwargs) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..2c5e4bdaa321 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_ip_configuration_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2016_12_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2016_12_01.models.SubResource + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :ivar provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_py3.py new file mode 100644 index 000000000000..5d00abf26a43 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_py3.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param ip_configurations: IP configurations for virtual network gateway. + :type ip_configurations: + list[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible + values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', + 'ExpressRoute' + :type gateway_type: str or + ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayType + :param vpn_type: The type of this virtual network gateway. Possible values + are: 'PolicyBased' and 'RouteBased'. Possible values include: + 'PolicyBased', 'RouteBased' + :type vpn_type: str or ~azure.mgmt.network.v2016_12_01.models.VpnType + :param enable_bgp: Whether BGP is enabled for this virtual network gateway + or not. + :type enable_bgp: bool + :param active_active: ActiveActive flag + :type active_active: bool + :param gateway_default_site: The reference of the LocalNetworkGateway + resource which represents local network site having default routes. Assign + Null value in case of removing existing default site setting. + :type gateway_default_site: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param sku: The reference of the VirtualNetworkGatewaySku resource which + represents the SKU selected for Virtual network gateway. + :type sku: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewaySku + :param vpn_client_configuration: The reference of the + VpnClientConfiguration resource which represents the P2S VpnClient + configurations. + :type vpn_client_configuration: + ~azure.mgmt.network.v2016_12_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2016_12_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + VirtualNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGateway resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, + 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, + 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'active_active': {'key': 'properties.activeActive', 'type': 'bool'}, + 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, + 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, + 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp: bool=None, active_active: bool=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.ip_configurations = ip_configurations + self.gateway_type = gateway_type + self.vpn_type = vpn_type + self.enable_bgp = enable_bgp + self.active_active = active_active + self.gateway_default_site = gateway_default_site + self.sku = sku + self.vpn_client_configuration = vpn_client_configuration + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_sku.py index 9ad814a9cc5b..4f01205aabff 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_sku.py @@ -35,8 +35,8 @@ class VirtualNetworkGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(VirtualNetworkGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_sku_py3.py new file mode 100644 index 000000000000..053ebb06b268 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_gateway_sku_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkGatewaySku(Model): + """VirtualNetworkGatewaySku details. + + :param name: Gateway SKU name. Possible values are: 'Basic', + 'HighPerformance','Standard', and 'UltraPerformance'. Possible values + include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance' + :type name: str or + ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewaySkuName + :param tier: Gateway SKU tier. Possible values are: 'Basic', + 'HighPerformance','Standard', and 'UltraPerformance'. Possible values + include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance' + :type tier: str or + ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewaySkuTier + :param capacity: The capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_peering.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_peering.py index 42c9aa699b87..f4da3c8e8168 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_peering.py @@ -65,14 +65,14 @@ class VirtualNetworkPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, allow_virtual_network_access=None, allow_forwarded_traffic=None, allow_gateway_transit=None, use_remote_gateways=None, remote_virtual_network=None, peering_state=None, provisioning_state=None, name=None, etag=None): - super(VirtualNetworkPeering, self).__init__(id=id) - self.allow_virtual_network_access = allow_virtual_network_access - self.allow_forwarded_traffic = allow_forwarded_traffic - self.allow_gateway_transit = allow_gateway_transit - self.use_remote_gateways = use_remote_gateways - self.remote_virtual_network = remote_virtual_network - self.peering_state = peering_state - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetworkPeering, self).__init__(**kwargs) + self.allow_virtual_network_access = kwargs.get('allow_virtual_network_access', None) + self.allow_forwarded_traffic = kwargs.get('allow_forwarded_traffic', None) + self.allow_gateway_transit = kwargs.get('allow_gateway_transit', None) + self.use_remote_gateways = kwargs.get('use_remote_gateways', None) + self.remote_virtual_network = kwargs.get('remote_virtual_network', None) + self.peering_state = kwargs.get('peering_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_peering_py3.py new file mode 100644 index 000000000000..d8b5d7e62820 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_peering_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkPeering(SubResource): + """Peerings in a virtual network resource. + + :param id: Resource ID. + :type id: str + :param allow_virtual_network_access: Whether the VMs in the linked virtual + network space would be able to access all the VMs in local Virtual network + space. + :type allow_virtual_network_access: bool + :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs + in the remote virtual network will be allowed/disallowed. + :type allow_forwarded_traffic: bool + :param allow_gateway_transit: If gateway links can be used in remote + virtual networking to link to this virtual network. + :type allow_gateway_transit: bool + :param use_remote_gateways: If remote gateways can be used on this virtual + network. If the flag is set to true, and allowGatewayTransit on remote + peering is also true, virtual network will use gateways of remote virtual + network for transit. Only one peering can have this flag set to true. This + flag cannot be set if virtual network already has a gateway. + :type use_remote_gateways: bool + :param remote_virtual_network: The reference of the remote virtual + network. + :type remote_virtual_network: + ~azure.mgmt.network.v2016_12_01.models.SubResource + :param peering_state: The status of the virtual network peering. Possible + values are 'Initiated', 'Connected', and 'Disconnected'. Possible values + include: 'Initiated', 'Connected', 'Disconnected' + :type peering_state: str or + ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkPeeringState + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, + 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, + 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, + 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, allow_virtual_network_access: bool=None, allow_forwarded_traffic: bool=None, allow_gateway_transit: bool=None, use_remote_gateways: bool=None, remote_virtual_network=None, peering_state=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkPeering, self).__init__(id=id, **kwargs) + self.allow_virtual_network_access = allow_virtual_network_access + self.allow_forwarded_traffic = allow_forwarded_traffic + self.allow_gateway_transit = allow_gateway_transit + self.use_remote_gateways = use_remote_gateways + self.remote_virtual_network = remote_virtual_network + self.peering_state = peering_state + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_py3.py new file mode 100644 index 000000000000..c44ac0512266 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/virtual_network_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetwork(Resource): + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param address_space: The AddressSpace that contains an array of IP + address ranges that can be used by subnets. + :type address_space: ~azure.mgmt.network.v2016_12_01.models.AddressSpace + :param dhcp_options: The dhcpOptions that contains an array of DNS servers + available to VMs deployed in the virtual network. + :type dhcp_options: ~azure.mgmt.network.v2016_12_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2016_12_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkPeering] + :param resource_guid: The resourceGuid property of the Virtual Network + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.address_space = address_space + self.dhcp_options = dhcp_options + self.subnets = subnets + self.virtual_network_peerings = virtual_network_peerings + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_configuration.py index 54625766785a..fcc20d91e962 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_configuration.py @@ -35,8 +35,8 @@ class VpnClientConfiguration(Model): 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, } - def __init__(self, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None): - super(VpnClientConfiguration, self).__init__() - self.vpn_client_address_pool = vpn_client_address_pool - self.vpn_client_root_certificates = vpn_client_root_certificates - self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + def __init__(self, **kwargs): + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = kwargs.get('vpn_client_address_pool', None) + self.vpn_client_root_certificates = kwargs.get('vpn_client_root_certificates', None) + self.vpn_client_revoked_certificates = kwargs.get('vpn_client_revoked_certificates', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_configuration_py3.py new file mode 100644 index 000000000000..6ec0cbbf3d1d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_configuration_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientConfiguration(Model): + """VpnClientConfiguration for P2S client. + + :param vpn_client_address_pool: The reference of the address space + resource which represents Address space for P2S VpnClient. + :type vpn_client_address_pool: + ~azure.mgmt.network.v2016_12_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual + network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2016_12_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for + Virtual network gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2016_12_01.models.VpnClientRevokedCertificate] + """ + + _attribute_map = { + 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, + 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, + } + + def __init__(self, *, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, **kwargs) -> None: + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = vpn_client_address_pool + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_parameters.py index 18346c2eed16..350d7854598b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_parameters.py @@ -15,8 +15,11 @@ class VpnClientParameters(Model): """VpnClientParameters. - :param processor_architecture: VPN client Processor Architecture. Possible - values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' + All required parameters must be populated in order to send to Azure. + + :param processor_architecture: Required. VPN client Processor + Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + include: 'Amd64', 'X86' :type processor_architecture: str or ~azure.mgmt.network.v2016_12_01.models.ProcessorArchitecture """ @@ -29,6 +32,6 @@ class VpnClientParameters(Model): 'processor_architecture': {'key': 'ProcessorArchitecture', 'type': 'str'}, } - def __init__(self, processor_architecture): - super(VpnClientParameters, self).__init__() - self.processor_architecture = processor_architecture + def __init__(self, **kwargs): + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = kwargs.get('processor_architecture', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_parameters_py3.py new file mode 100644 index 000000000000..dac01c661a86 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_parameters_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientParameters(Model): + """VpnClientParameters. + + All required parameters must be populated in order to send to Azure. + + :param processor_architecture: Required. VPN client Processor + Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + include: 'Amd64', 'X86' + :type processor_architecture: str or + ~azure.mgmt.network.v2016_12_01.models.ProcessorArchitecture + """ + + _validation = { + 'processor_architecture': {'required': True}, + } + + _attribute_map = { + 'processor_architecture': {'key': 'ProcessorArchitecture', 'type': 'str'}, + } + + def __init__(self, *, processor_architecture, **kwargs) -> None: + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = processor_architecture diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_revoked_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_revoked_certificate.py index ebd6a4bbba2f..1fa6f6a1ef23 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_revoked_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_revoked_certificate.py @@ -46,9 +46,9 @@ class VpnClientRevokedCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, thumbprint=None, name=None, etag=None): - super(VpnClientRevokedCertificate, self).__init__(id=id) - self.thumbprint = thumbprint + def __init__(self, **kwargs): + super(VpnClientRevokedCertificate, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_revoked_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_revoked_certificate_py3.py new file mode 100644 index 000000000000..7c1e05f283a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_revoked_certificate_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + :ivar provisioning_state: The provisioning state of the VPN client revoked + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, thumbprint: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRevokedCertificate, self).__init__(id=id, **kwargs) + self.thumbprint = thumbprint + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_root_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_root_certificate.py index 6d820d3a8c11..48c7033d42ec 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_root_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_root_certificate.py @@ -18,9 +18,11 @@ class VpnClientRootCertificate(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param public_cert_data: The certificate public data. + :param public_cert_data: Required. The certificate public data. :type public_cert_data: str :ivar provisioning_state: The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and @@ -47,9 +49,9 @@ class VpnClientRootCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, public_cert_data, id=None, name=None, etag=None): - super(VpnClientRootCertificate, self).__init__(id=id) - self.public_cert_data = public_cert_data + def __init__(self, **kwargs): + super(VpnClientRootCertificate, self).__init__(**kwargs) + self.public_cert_data = kwargs.get('public_cert_data', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_root_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_root_certificate_py3.py new file mode 100644 index 000000000000..db8a1e547705 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/vpn_client_root_certificate_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param public_cert_data: Required. The certificate public data. + :type public_cert_data: str + :ivar provisioning_state: The provisioning state of the VPN client root + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'public_cert_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, public_cert_data: str, id: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRootCertificate, self).__init__(id=id, **kwargs) + self.public_cert_data = public_cert_data + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/network_management_client.py index 79346f362a0a..e3add9ad6aaf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/network_management_client.py @@ -15,7 +15,8 @@ from .version import VERSION from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.network_interfaces_operations import NetworkInterfacesOperations from .operations.application_gateways_operations import ApplicationGatewaysOperations @@ -226,7 +227,7 @@ def check_dns_name_availability( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability' + url = self.check_dns_name_availability.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -268,3 +269,4 @@ def check_dns_name_availability( return client_raw_response return deserialized + check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/application_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/application_gateways_operations.py index 2172cc2dbc6c..fa3bc8f0da8a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/application_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/application_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ApplicationGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def get( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def _create_or_update_initial( self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_12_01.models.ApplicationGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.ApplicationGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.ApplicationGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ApplicationGateway', response) if raw: @@ -312,12 +276,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -339,7 +305,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -385,6 +351,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -404,7 +371,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -449,12 +416,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} def _start_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -490,7 +458,7 @@ def _start_initial( return client_raw_response def start( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -498,12 +466,14 @@ def start( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -513,46 +483,26 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} def _stop_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -588,7 +538,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -596,12 +546,14 @@ def stop( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -611,46 +563,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} def _backend_health_initial( self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth' + url = self.backend_health.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -695,7 +627,7 @@ def _backend_health_initial( return deserialized def backend_health( - self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the backend health of the specified application gateway in a resource group. @@ -707,13 +639,17 @@ def backend_health( referenced in backend health. :type expand: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGatewayBackendHealth or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApplicationGatewayBackendHealth or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendHealth] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.ApplicationGatewayBackendHealth]] :raises: :class:`CloudError` """ raw_result = self._backend_health_initial( @@ -724,30 +660,8 @@ def backend_health( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ApplicationGatewayBackendHealth', response) if raw: @@ -756,9 +670,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/bgp_service_communities_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/bgp_service_communities_operations.py index 1cfe5159a631..43f5640ce4e2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/bgp_service_communities_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/bgp_service_communities_operations.py @@ -22,7 +22,7 @@ class BgpServiceCommunitiesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_circuit_authorizations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_circuit_authorizations_operations.py index 6fd7d2f9a02a..358f084f63d6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_circuit_authorizations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_circuit_authorizations_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified authorization from the specified express route circuit. @@ -91,12 +91,14 @@ def delete( :param authorization_name: The name of the authorization. :type authorization_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def get( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): @@ -166,7 +148,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an authorization in the specified express route circuit. @@ -278,13 +261,17 @@ def create_or_update( :type authorization_parameters: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitAuthorization :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitAuthorization or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitAuthorization or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitAuthorization] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitAuthorization]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -296,30 +283,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitAuthorization', response) if raw: @@ -328,12 +293,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +324,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -404,3 +371,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_circuit_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_circuit_peerings_operations.py index b8b81d2f8796..87a6daa10303 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_circuit_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_circuit_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param peering_name: The name of the peering. :type peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def get( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -275,13 +258,17 @@ def create_or_update( :type peering_parameters: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitPeering or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitPeering', response) if raw: @@ -325,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -401,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_circuits_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_circuits_operations.py index e80178deba2c..1b54397858b5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_circuits_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_circuits_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param circuit_name: The name of the express route circuit. :type circuit_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def get( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuit :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuit or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuit] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuit]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuit', response) if raw: @@ -312,18 +276,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _list_arp_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}' + url = self.list_arp_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -368,7 +334,7 @@ def _list_arp_table_initial( return deserialized def list_arp_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -381,14 +347,17 @@ def list_arp_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsArpTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsArpTableListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitsArpTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitsArpTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_arp_table_initial( @@ -400,30 +369,8 @@ def list_arp_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', response) if raw: @@ -432,18 +379,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} def _list_routes_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}' + url = self.list_routes_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -488,7 +437,7 @@ def _list_routes_table_initial( return deserialized def list_routes_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -501,14 +450,18 @@ def list_routes_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitsRoutesTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitsRoutesTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_initial( @@ -520,30 +473,8 @@ def list_routes_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', response) if raw: @@ -552,18 +483,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} def _list_routes_table_summary_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}' + url = self.list_routes_table_summary.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -608,7 +541,7 @@ def _list_routes_table_summary_initial( return deserialized def list_routes_table_summary( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -621,14 +554,18 @@ def list_routes_table_summary( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableSummaryListResult or ClientRawResponse - if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableSummaryListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_summary_initial( @@ -640,30 +577,8 @@ def list_routes_table_summary( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', response) if raw: @@ -672,12 +587,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} def get_stats( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -699,7 +616,7 @@ def get_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats' + url = self.get_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -740,6 +657,7 @@ def get_stats( return client_raw_response return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} def get_peering_stats( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -763,7 +681,7 @@ def get_peering_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats' + url = self.get_peering_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -805,6 +723,7 @@ def get_peering_stats( return client_raw_response return deserialized + get_peering_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -826,7 +745,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -872,6 +791,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -891,7 +811,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -936,3 +856,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_service_providers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_service_providers_operations.py index 14225124ec57..1b60895a665c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_service_providers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/express_route_service_providers_operations.py @@ -22,7 +22,7 @@ class ExpressRouteServiceProvidersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/load_balancers_operations.py index e2ad71203224..80ab49e22836 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/load_balancers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param load_balancer_name: The name of the load balancer. :type load_balancer_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def get( self, resource_group_name, load_balancer_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( balancer operation. :type parameters: ~azure.mgmt.network.v2016_12_01.models.LoadBalancer :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns LoadBalancer - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.LoadBalancer] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.LoadBalancer]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LoadBalancer', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -340,7 +306,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -385,6 +351,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -406,7 +373,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -452,3 +419,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/local_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/local_network_gateways_operations.py index 581dc04e89be..abd46191c0b6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/local_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/local_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LocalNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a local network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_12_01.models.LocalNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - LocalNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.LocalNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.LocalNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LocalNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def get( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def _delete_initial( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str'), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type local_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +309,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -389,3 +355,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/network_interfaces_operations.py index dff3708f491c..37da15c099ad 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/network_interfaces_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ models = models @@ -65,7 +65,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces' + url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -113,6 +113,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} def list_virtual_machine_scale_set_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -139,7 +140,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces' + url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -186,6 +187,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} def get_virtual_machine_scale_set_network_interface( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -215,7 +217,7 @@ def get_virtual_machine_scale_set_network_interface( api_version = "2016-09-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}' + url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -260,6 +262,7 @@ def get_virtual_machine_scale_set_network_interface( return client_raw_response return deserialized + get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} def _delete_initial( @@ -267,7 +270,7 @@ def _delete_initial( api_version = "2016-12-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -303,7 +306,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -311,12 +314,14 @@ def delete( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -326,40 +331,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def get( self, resource_group_name, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -384,7 +369,7 @@ def get( api_version = "2016-12-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -427,6 +412,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def _create_or_update_initial( @@ -434,7 +420,7 @@ def _create_or_update_initial( api_version = "2016-12-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -483,7 +469,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -495,13 +481,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_12_01.models.NetworkInterface :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkInterface or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.NetworkInterface] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.NetworkInterface]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -512,30 +501,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkInterface', response) if raw: @@ -544,12 +511,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -571,7 +540,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -616,6 +585,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -639,7 +609,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -685,6 +655,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} def _get_effective_route_table_initial( @@ -692,7 +663,7 @@ def _get_effective_route_table_initial( api_version = "2016-12-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable' + url = self.get_effective_route_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -735,7 +706,7 @@ def _get_effective_route_table_initial( return deserialized def get_effective_route_table( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -743,13 +714,17 @@ def get_effective_route_table( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveRouteListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.EffectiveRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.EffectiveRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_effective_route_table_initial( @@ -759,30 +734,8 @@ def get_effective_route_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveRouteListResult', response) if raw: @@ -791,12 +744,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_effective_route_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} def _list_effective_network_security_groups_initial( @@ -804,7 +759,7 @@ def _list_effective_network_security_groups_initial( api_version = "2016-12-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups' + url = self.list_effective_network_security_groups.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -847,7 +802,7 @@ def _list_effective_network_security_groups_initial( return deserialized def list_effective_network_security_groups( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -855,14 +810,18 @@ def list_effective_network_security_groups( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveNetworkSecurityGroupListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveNetworkSecurityGroupListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.EffectiveNetworkSecurityGroupListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.EffectiveNetworkSecurityGroupListResult]] :raises: :class:`CloudError` """ raw_result = self._list_effective_network_security_groups_initial( @@ -872,30 +831,8 @@ def list_effective_network_security_groups( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', response) if raw: @@ -904,9 +841,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_effective_network_security_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/network_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/network_security_groups_operations.py index 9f51ddb50780..151989f33cdb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/network_security_groups_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/network_security_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkSecurityGroupsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -88,12 +88,14 @@ def delete( group. :type network_security_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -103,40 +105,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def get( self, resource_group_name, network_security_group_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -203,12 +185,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -257,7 +240,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network security group in the specified resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_12_01.models.NetworkSecurityGroup :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.NetworkSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.NetworkSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkSecurityGroup', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -345,7 +311,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -390,6 +356,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -411,7 +378,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -457,3 +424,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/network_watchers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/network_watchers_operations.py index e31cd1ae6f83..b636217f5910 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/network_watchers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/network_watchers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkWatchersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -62,7 +62,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -109,6 +109,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def get( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -170,12 +171,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def _delete_initial( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -211,7 +213,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -219,12 +221,14 @@ def delete( :param network_watcher_name: The name of the network watcher. :type network_watcher_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -234,40 +238,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -289,7 +273,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -335,6 +319,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -354,7 +339,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -399,6 +384,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'} def get_topology( self, resource_group_name, network_watcher_name, target_resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -424,7 +410,7 @@ def get_topology( parameters = models.TopologyParameters(target_resource_group_name=target_resource_group_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology' + url = self.get_topology.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -469,12 +455,13 @@ def get_topology( return client_raw_response return deserialized + get_topology.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'} def _verify_ip_flow_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify' + url = self.verify_ip_flow.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -523,7 +510,7 @@ def _verify_ip_flow_initial( return deserialized def verify_ip_flow( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Verify IP flow from the specified VM to a location given the currently configured NSG rules. @@ -535,13 +522,17 @@ def verify_ip_flow( :type parameters: ~azure.mgmt.network.v2016_12_01.models.VerificationIPFlowParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VerificationIPFlowResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VerificationIPFlowResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.VerificationIPFlowResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.VerificationIPFlowResult]] :raises: :class:`CloudError` """ raw_result = self._verify_ip_flow_initial( @@ -552,30 +543,8 @@ def verify_ip_flow( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VerificationIPFlowResult', response) if raw: @@ -584,18 +553,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + verify_ip_flow.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} def _get_next_hop_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop' + url = self.get_next_hop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -644,7 +615,7 @@ def _get_next_hop_initial( return deserialized def get_next_hop( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -656,13 +627,16 @@ def get_next_hop( :type parameters: ~azure.mgmt.network.v2016_12_01.models.NextHopParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NextHopResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NextHopResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.NextHopResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.NextHopResult]] :raises: :class:`CloudError` """ raw_result = self._get_next_hop_initial( @@ -673,30 +647,8 @@ def get_next_hop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NextHopResult', response) if raw: @@ -705,12 +657,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_next_hop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} def _get_vm_security_rules_initial( @@ -718,7 +672,7 @@ def _get_vm_security_rules_initial( parameters = models.SecurityGroupViewParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView' + url = self.get_vm_security_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -767,7 +721,7 @@ def _get_vm_security_rules_initial( return deserialized def get_vm_security_rules( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the configured and effective security group rules on the specified VM. @@ -778,13 +732,16 @@ def get_vm_security_rules( :param target_resource_id: ID of the target VM. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - SecurityGroupViewResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityGroupViewResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.SecurityGroupViewResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.SecurityGroupViewResult]] :raises: :class:`CloudError` """ raw_result = self._get_vm_security_rules_initial( @@ -795,30 +752,8 @@ def get_vm_security_rules( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('SecurityGroupViewResult', response) if raw: @@ -827,18 +762,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vm_security_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} def _get_troubleshooting_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot' + url = self.get_troubleshooting.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -887,7 +824,7 @@ def _get_troubleshooting_initial( return deserialized def get_troubleshooting( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -899,13 +836,16 @@ def get_troubleshooting( :type parameters: ~azure.mgmt.network.v2016_12_01.models.TroubleshootingParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_initial( @@ -916,30 +856,8 @@ def get_troubleshooting( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -948,12 +866,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} def _get_troubleshooting_result_initial( @@ -961,7 +881,7 @@ def _get_troubleshooting_result_initial( parameters = models.QueryTroubleshootingParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult' + url = self.get_troubleshooting_result.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1010,7 +930,7 @@ def _get_troubleshooting_result_initial( return deserialized def get_troubleshooting_result( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,13 +941,16 @@ def get_troubleshooting_result( troubleshooting result. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_result_initial( @@ -1038,30 +961,8 @@ def get_troubleshooting_result( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -1070,18 +971,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} def _set_flow_log_configuration_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog' + url = self.set_flow_log_configuration.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1130,7 +1033,7 @@ def _set_flow_log_configuration_initial( return deserialized def set_flow_log_configuration( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1143,13 +1046,16 @@ def set_flow_log_configuration( :type parameters: ~azure.mgmt.network.v2016_12_01.models.FlowLogInformation :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._set_flow_log_configuration_initial( @@ -1160,30 +1066,8 @@ def set_flow_log_configuration( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1192,12 +1076,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_flow_log_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} def _get_flow_log_status_initial( @@ -1205,7 +1091,7 @@ def _get_flow_log_status_initial( parameters = models.FlowLogStatusParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus' + url = self.get_flow_log_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1254,7 +1140,7 @@ def _get_flow_log_status_initial( return deserialized def get_flow_log_status( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1266,13 +1152,16 @@ def get_flow_log_status( logging status. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._get_flow_log_status_initial( @@ -1283,30 +1172,8 @@ def get_flow_log_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1315,9 +1182,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_flow_log_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/packet_captures_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/packet_captures_operations.py index 835fd6df53a0..6e23ee00b8b4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/packet_captures_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/packet_captures_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PacketCapturesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -91,7 +91,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -104,13 +104,16 @@ def create( operation. :type parameters: ~azure.mgmt.network.v2016_12_01.models.PacketCapture :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PacketCaptureResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.PacketCaptureResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.PacketCaptureResult]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -122,30 +125,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureResult', response) if raw: @@ -154,12 +135,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def get( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -224,12 +207,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _delete_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -266,7 +250,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -276,12 +260,14 @@ def delete( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -292,46 +278,26 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _stop_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -368,7 +334,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -378,12 +344,14 @@ def stop( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -394,46 +362,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} def _get_status_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus' + url = self.get_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -479,7 +427,7 @@ def _get_status_initial( return deserialized def get_status( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -490,13 +438,17 @@ def get_status( session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureQueryStatusResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PacketCaptureQueryStatusResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.PacketCaptureQueryStatusResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.PacketCaptureQueryStatusResult]] :raises: :class:`CloudError` """ raw_result = self._get_status_initial( @@ -507,30 +459,8 @@ def get_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureQueryStatusResult', response) if raw: @@ -539,12 +469,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} def list( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -568,7 +500,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -615,3 +547,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/public_ip_addresses_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/public_ip_addresses_operations.py index 19489378ea86..a6a89f92eeb4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/public_ip_addresses_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/public_ip_addresses_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PublicIPAddressesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param public_ip_address_name: The name of the subnet. :type public_ip_address_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def get( self, resource_group_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def _create_or_update_initial( self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_12_01.models.PublicIPAddress :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PublicIPAddress or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.PublicIPAddress] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.PublicIPAddress]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('PublicIPAddress', response) if raw: @@ -316,12 +280,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -341,7 +307,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -386,6 +352,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -453,3 +420,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/route_filter_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/route_filter_rules_operations.py index 7aa7ba3f1ee3..b6c448fc916d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/route_filter_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/route_filter_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFilterRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param rule_name: The name of the rule. :type rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def get( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -273,13 +256,16 @@ def create_or_update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2016_12_01.models.RouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -291,30 +277,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilterRule', response) if raw: @@ -323,18 +287,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -382,7 +348,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -396,13 +362,16 @@ def update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2016_12_01.models.PatchRouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -414,30 +383,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilterRule', response) if raw: @@ -446,12 +393,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def list_by_route_filter( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): @@ -475,7 +424,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules' + url = self.list_by_route_filter.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -522,3 +471,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_route_filter.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/route_filters_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/route_filters_operations.py index d204660de5ce..ff1f7747e001 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/route_filters_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/route_filters_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFiltersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_filter_name: The name of the route filter. :type route_filter_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def get( self, resource_group_name, route_filter_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type route_filter_parameters: ~azure.mgmt.network.v2016_12_01.models.RouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilter', response) if raw: @@ -316,18 +280,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -374,7 +340,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -386,13 +352,16 @@ def update( :type route_filter_parameters: ~azure.mgmt.network.v2016_12_01.models.PatchRouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -403,30 +372,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilter', response) if raw: @@ -435,12 +382,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -462,7 +411,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -508,6 +457,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -527,7 +477,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -572,3 +522,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/route_tables_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/route_tables_operations.py index 5af386bb509b..d53834438edc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/route_tables_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/route_tables_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteTablesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_table_name: The name of the route table. :type route_table_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def get( self, resource_group_name, route_table_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( table operation. :type parameters: ~azure.mgmt.network.v2016_12_01.models.RouteTable :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteTable - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.RouteTable] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.RouteTable]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteTable', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -342,7 +308,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -388,6 +354,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -452,3 +419,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/routes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/routes_operations.py index afd5c82889d8..00de820cbba7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/routes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/routes_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RoutesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param route_name: The name of the route. :type route_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def get( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -272,13 +255,16 @@ def create_or_update( route operation. :type route_parameters: ~azure.mgmt.network.v2016_12_01.models.Route :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Route or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Route or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.Route] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.Route]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -290,30 +276,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Route', response) if raw: @@ -322,12 +286,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def list( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): @@ -351,7 +317,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -398,3 +364,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/security_rules_operations.py index 1ad870dd9744..c5279082cc6c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/security_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( :param security_rule_name: The name of the security rule. :type security_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def get( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a security rule in the specified network security group. @@ -277,13 +260,16 @@ def create_or_update( :type security_rule_parameters: ~azure.mgmt.network.v2016_12_01.models.SecurityRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns SecurityRule - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.SecurityRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.SecurityRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -295,30 +281,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('SecurityRule', response) if raw: @@ -327,12 +291,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def list( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +323,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -404,3 +370,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/subnets_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/subnets_operations.py index 5bcc71ecc745..e75e3db7e947 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/subnets_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/subnets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SubnetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param subnet_name: The name of the subnet. :type subnet_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def get( self, resource_group_name, virtual_network_name, subnet_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -276,13 +259,16 @@ def create_or_update( subnet operation. :type subnet_parameters: ~azure.mgmt.network.v2016_12_01.models.Subnet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Subnet or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Subnet or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.Subnet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.Subnet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -294,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Subnet', response) if raw: @@ -326,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -355,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -402,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/usages_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/usages_operations.py index c5cc53c44276..5cdce3410655 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/usages_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/usages_operations.py @@ -22,7 +22,7 @@ class UsagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_network_gateway_connections_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_network_gateway_connections_operations.py index 6ca06f7cd873..83a17936cb3d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_network_gateway_connections_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_network_gateway_connections_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway connection in the specified resource group. @@ -106,13 +106,17 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayConnection :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGatewayConnection or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnection or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayConnection] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGatewayConnection]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +127,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGatewayConnection', response) if raw: @@ -155,12 +137,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def get( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -185,7 +169,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -226,12 +210,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -267,7 +252,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -276,12 +261,14 @@ def delete( virtual network gateway connection. :type virtual_network_gateway_connection_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -291,40 +278,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _set_shared_key_initial( @@ -332,7 +299,7 @@ def _set_shared_key_initial( parameters = models.ConnectionSharedKey(value=value) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.set_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -381,7 +348,7 @@ def _set_shared_key_initial( return deserialized def set_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, polling=True, **operation_config): """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -395,13 +362,16 @@ def set_shared_key( :param value: The virtual network connection shared key value. :type value: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectionSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.ConnectionSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.ConnectionSharedKey]] :raises: :class:`CloudError` """ raw_result = self._set_shared_key_initial( @@ -412,30 +382,8 @@ def set_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ConnectionSharedKey', response) if raw: @@ -444,12 +392,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def get_shared_key( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -473,7 +423,7 @@ def get_shared_key( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.get_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -514,6 +464,7 @@ def get_shared_key( return client_raw_response return deserialized + get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -536,7 +487,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -582,6 +533,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} def _reset_shared_key_initial( @@ -589,7 +541,7 @@ def _reset_shared_key_initial( parameters = models.ConnectionResetSharedKey(key_length=key_length) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset' + url = self.reset_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -636,7 +588,7 @@ def _reset_shared_key_initial( return deserialized def reset_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, polling=True, **operation_config): """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -651,13 +603,17 @@ def reset_shared_key( length, should between 1 and 128. :type key_length: int :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionResetSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConnectionResetSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.ConnectionResetSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.ConnectionResetSharedKey]] :raises: :class:`CloudError` """ raw_result = self._reset_shared_key_initial( @@ -668,30 +624,8 @@ def reset_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectionResetSharedKey', response) if raw: @@ -700,9 +634,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_network_gateways_operations.py index d39d99a08910..beca9290deef 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def get( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +309,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -389,12 +355,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} def _reset_initial( self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset' + url = self.reset.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -439,7 +406,7 @@ def _reset_initial( return deserialized def reset( - self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, polling=True, **operation_config): """Resets the primary of the virtual network gateway in the specified resource group. @@ -452,13 +419,16 @@ def reset( the begin reset of the active-active feature enabled gateway. :type gateway_vip: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._reset_initial( @@ -469,30 +439,8 @@ def reset( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -501,12 +449,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} def generatevpnclientpackage( self, resource_group_name, virtual_network_gateway_name, processor_architecture, custom_headers=None, raw=False, **operation_config): @@ -535,7 +485,7 @@ def generatevpnclientpackage( parameters = models.VpnClientParameters(processor_architecture=processor_architecture) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage' + url = self.generatevpnclientpackage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -580,12 +530,13 @@ def generatevpnclientpackage( return client_raw_response return deserialized + generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} def _get_bgp_peer_status_initial( self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus' + url = self.get_bgp_peer_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -630,7 +581,7 @@ def _get_bgp_peer_status_initial( return deserialized def get_bgp_peer_status( - self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, polling=True, **operation_config): """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -641,13 +592,16 @@ def get_bgp_peer_status( :param peer: The IP address of the peer to retrieve the status of. :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - BgpPeerStatusListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BgpPeerStatusListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.BgpPeerStatusListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.BgpPeerStatusListResult]] :raises: :class:`CloudError` """ raw_result = self._get_bgp_peer_status_initial( @@ -658,30 +612,8 @@ def get_bgp_peer_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('BgpPeerStatusListResult', response) if raw: @@ -690,18 +622,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_bgp_peer_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} def _get_learned_routes_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes' + url = self.get_learned_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -744,7 +678,7 @@ def _get_learned_routes_initial( return deserialized def get_learned_routes( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -754,13 +688,16 @@ def get_learned_routes( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_learned_routes_initial( @@ -770,30 +707,8 @@ def get_learned_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -802,18 +717,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} def _get_advertised_routes_initial( self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes' + url = self.get_advertised_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -857,7 +774,7 @@ def _get_advertised_routes_initial( return deserialized def get_advertised_routes( - self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -869,13 +786,16 @@ def get_advertised_routes( :param peer: The IP address of the peer :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_advertised_routes_initial( @@ -886,30 +806,8 @@ def get_advertised_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -918,9 +816,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_network_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_network_peerings_operations.py index f3b33dc16acc..332fa6bbd772 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_network_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_network_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( peering. :type virtual_network_peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def get( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -275,13 +258,16 @@ def create_or_update( :type virtual_network_peering_parameters: ~azure.mgmt.network.v2016_12_01.models.VirtualNetworkPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkPeering + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.VirtualNetworkPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +279,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkPeering', response) if raw: @@ -325,12 +289,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +320,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -401,3 +367,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_networks_operations.py b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_networks_operations.py index 59355cb9c162..101b31d733ae 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_networks_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2016_12_01/operations/virtual_networks_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworksOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2016-12-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param virtual_network_name: The name of the virtual network. :type virtual_network_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def get( self, resource_group_name, virtual_network_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2016_12_01.models.VirtualNetwork :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetwork or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2016_12_01.models.VirtualNetwork] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2016_12_01.models.VirtualNetwork]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetwork', response) if raw: @@ -316,12 +280,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -341,7 +307,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -386,6 +352,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -453,6 +420,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks'} def check_ip_address_availability( self, resource_group_name, virtual_network_name, ip_address=None, custom_headers=None, raw=False, **operation_config): @@ -476,7 +444,7 @@ def check_ip_address_availability( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability' + url = self.check_ip_address_availability.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -519,3 +487,4 @@ def check_ip_address_availability( return client_raw_response return deserialized + check_ip_address_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/__init__.py index 56e0701e8eb0..dd9d1bdb3c49 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/__init__.py @@ -9,149 +9,294 @@ # regenerated. # -------------------------------------------------------------------------- -from .sub_resource import SubResource -from .backend_address_pool import BackendAddressPool -from .inbound_nat_rule import InboundNatRule -from .security_rule import SecurityRule -from .network_interface_dns_settings import NetworkInterfaceDnsSettings -from .network_interface import NetworkInterface -from .network_security_group import NetworkSecurityGroup -from .route import Route -from .route_table import RouteTable -from .public_ip_address_dns_settings import PublicIPAddressDnsSettings -from .public_ip_address import PublicIPAddress -from .ip_configuration import IPConfiguration -from .resource_navigation_link import ResourceNavigationLink -from .subnet import Subnet -from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration -from .application_gateway_backend_address import ApplicationGatewayBackendAddress -from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool -from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining -from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings -from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer -from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings -from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool -from .application_gateway_backend_health import ApplicationGatewayBackendHealth -from .application_gateway_sku import ApplicationGatewaySku -from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy -from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration -from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate -from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate -from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration -from .application_gateway_frontend_port import ApplicationGatewayFrontendPort -from .application_gateway_http_listener import ApplicationGatewayHttpListener -from .application_gateway_path_rule import ApplicationGatewayPathRule -from .application_gateway_probe import ApplicationGatewayProbe -from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule -from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap -from .application_gateway_firewall_disabled_rule_group import ApplicationGatewayFirewallDisabledRuleGroup -from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration -from .application_gateway import ApplicationGateway -from .application_gateway_firewall_rule import ApplicationGatewayFirewallRule -from .application_gateway_firewall_rule_group import ApplicationGatewayFirewallRuleGroup -from .application_gateway_firewall_rule_set import ApplicationGatewayFirewallRuleSet -from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult -from .resource import Resource -from .dns_name_availability_result import DnsNameAvailabilityResult -from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization -from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig -from .route_filter_rule import RouteFilterRule -from .express_route_circuit_stats import ExpressRouteCircuitStats -from .express_route_circuit_peering import ExpressRouteCircuitPeering -from .route_filter import RouteFilter -from .ipv6_express_route_circuit_peering_config import Ipv6ExpressRouteCircuitPeeringConfig -from .express_route_circuit_sku import ExpressRouteCircuitSku -from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties -from .express_route_circuit import ExpressRouteCircuit -from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable -from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult -from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable -from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult -from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary -from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult -from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered -from .express_route_service_provider import ExpressRouteServiceProvider -from .frontend_ip_configuration import FrontendIPConfiguration -from .load_balancing_rule import LoadBalancingRule -from .probe import Probe -from .inbound_nat_pool import InboundNatPool -from .outbound_nat_rule import OutboundNatRule -from .load_balancer import LoadBalancer -from .error_details import ErrorDetails -from .error import Error -from .azure_async_operation_result import AzureAsyncOperationResult -from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation -from .effective_network_security_rule import EffectiveNetworkSecurityRule -from .effective_network_security_group import EffectiveNetworkSecurityGroup -from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult -from .effective_route import EffectiveRoute -from .effective_route_list_result import EffectiveRouteListResult -from .network_watcher import NetworkWatcher -from .topology_parameters import TopologyParameters -from .topology_association import TopologyAssociation -from .topology_resource import TopologyResource -from .topology import Topology -from .verification_ip_flow_parameters import VerificationIPFlowParameters -from .verification_ip_flow_result import VerificationIPFlowResult -from .next_hop_parameters import NextHopParameters -from .next_hop_result import NextHopResult -from .security_group_view_parameters import SecurityGroupViewParameters -from .network_interface_association import NetworkInterfaceAssociation -from .subnet_association import SubnetAssociation -from .security_rule_associations import SecurityRuleAssociations -from .security_group_network_interface import SecurityGroupNetworkInterface -from .security_group_view_result import SecurityGroupViewResult -from .packet_capture_storage_location import PacketCaptureStorageLocation -from .packet_capture_filter import PacketCaptureFilter -from .packet_capture_parameters import PacketCaptureParameters -from .packet_capture import PacketCapture -from .packet_capture_result import PacketCaptureResult -from .packet_capture_query_status_result import PacketCaptureQueryStatusResult -from .troubleshooting_parameters import TroubleshootingParameters -from .query_troubleshooting_parameters import QueryTroubleshootingParameters -from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions -from .troubleshooting_details import TroubleshootingDetails -from .troubleshooting_result import TroubleshootingResult -from .retention_policy_parameters import RetentionPolicyParameters -from .flow_log_status_parameters import FlowLogStatusParameters -from .flow_log_information import FlowLogInformation -from .connectivity_source import ConnectivitySource -from .connectivity_destination import ConnectivityDestination -from .connectivity_parameters import ConnectivityParameters -from .connectivity_issue import ConnectivityIssue -from .connectivity_hop import ConnectivityHop -from .connectivity_information import ConnectivityInformation -from .patch_route_filter_rule import PatchRouteFilterRule -from .patch_route_filter import PatchRouteFilter -from .bgp_community import BGPCommunity -from .bgp_service_community import BgpServiceCommunity -from .usage_name import UsageName -from .usage import Usage -from .virtual_network_peering import VirtualNetworkPeering -from .address_space import AddressSpace -from .dhcp_options import DhcpOptions -from .virtual_network import VirtualNetwork -from .ip_address_availability_result import IPAddressAvailabilityResult -from .virtual_network_usage_name import VirtualNetworkUsageName -from .virtual_network_usage import VirtualNetworkUsage -from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration -from .virtual_network_gateway_sku import VirtualNetworkGatewaySku -from .vpn_client_root_certificate import VpnClientRootCertificate -from .vpn_client_revoked_certificate import VpnClientRevokedCertificate -from .vpn_client_configuration import VpnClientConfiguration -from .bgp_settings import BgpSettings -from .bgp_peer_status import BgpPeerStatus -from .gateway_route import GatewayRoute -from .virtual_network_gateway import VirtualNetworkGateway -from .vpn_client_parameters import VpnClientParameters -from .bgp_peer_status_list_result import BgpPeerStatusListResult -from .gateway_route_list_result import GatewayRouteListResult -from .tunnel_connection_health import TunnelConnectionHealth -from .local_network_gateway import LocalNetworkGateway -from .ipsec_policy import IpsecPolicy -from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection -from .connection_reset_shared_key import ConnectionResetSharedKey -from .connection_shared_key import ConnectionSharedKey +try: + from .sub_resource_py3 import SubResource + from .backend_address_pool_py3 import BackendAddressPool + from .inbound_nat_rule_py3 import InboundNatRule + from .security_rule_py3 import SecurityRule + from .network_interface_dns_settings_py3 import NetworkInterfaceDnsSettings + from .network_interface_py3 import NetworkInterface + from .network_security_group_py3 import NetworkSecurityGroup + from .route_py3 import Route + from .route_table_py3 import RouteTable + from .public_ip_address_dns_settings_py3 import PublicIPAddressDnsSettings + from .public_ip_address_py3 import PublicIPAddress + from .ip_configuration_py3 import IPConfiguration + from .resource_navigation_link_py3 import ResourceNavigationLink + from .subnet_py3 import Subnet + from .network_interface_ip_configuration_py3 import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address_py3 import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool_py3 import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining_py3 import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings_py3 import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server_py3 import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings_py3 import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool_py3 import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health_py3 import ApplicationGatewayBackendHealth + from .application_gateway_sku_py3 import ApplicationGatewaySku + from .application_gateway_ssl_policy_py3 import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration_py3 import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate_py3 import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate_py3 import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration_py3 import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port_py3 import ApplicationGatewayFrontendPort + from .application_gateway_http_listener_py3 import ApplicationGatewayHttpListener + from .application_gateway_path_rule_py3 import ApplicationGatewayPathRule + from .application_gateway_probe_py3 import ApplicationGatewayProbe + from .application_gateway_request_routing_rule_py3 import ApplicationGatewayRequestRoutingRule + from .application_gateway_url_path_map_py3 import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group_py3 import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration_py3 import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway_py3 import ApplicationGateway + from .application_gateway_firewall_rule_py3 import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group_py3 import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set_py3 import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result_py3 import ApplicationGatewayAvailableWafRuleSetsResult + from .resource_py3 import Resource + from .dns_name_availability_result_py3 import DnsNameAvailabilityResult + from .express_route_circuit_authorization_py3 import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config_py3 import ExpressRouteCircuitPeeringConfig + from .route_filter_rule_py3 import RouteFilterRule + from .express_route_circuit_stats_py3 import ExpressRouteCircuitStats + from .express_route_circuit_peering_py3 import ExpressRouteCircuitPeering + from .route_filter_py3 import RouteFilter + from .ipv6_express_route_circuit_peering_config_py3 import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku_py3 import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties_py3 import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit_py3 import ExpressRouteCircuit + from .express_route_circuit_arp_table_py3 import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result_py3 import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table_py3 import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result_py3 import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary_py3 import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result_py3 import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered_py3 import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider_py3 import ExpressRouteServiceProvider + from .frontend_ip_configuration_py3 import FrontendIPConfiguration + from .load_balancing_rule_py3 import LoadBalancingRule + from .probe_py3 import Probe + from .inbound_nat_pool_py3 import InboundNatPool + from .outbound_nat_rule_py3 import OutboundNatRule + from .load_balancer_py3 import LoadBalancer + from .error_details_py3 import ErrorDetails + from .error_py3 import Error + from .azure_async_operation_result_py3 import AzureAsyncOperationResult + from .effective_network_security_group_association_py3 import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule_py3 import EffectiveNetworkSecurityRule + from .effective_network_security_group_py3 import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result_py3 import EffectiveNetworkSecurityGroupListResult + from .effective_route_py3 import EffectiveRoute + from .effective_route_list_result_py3 import EffectiveRouteListResult + from .network_watcher_py3 import NetworkWatcher + from .topology_parameters_py3 import TopologyParameters + from .topology_association_py3 import TopologyAssociation + from .topology_resource_py3 import TopologyResource + from .topology_py3 import Topology + from .verification_ip_flow_parameters_py3 import VerificationIPFlowParameters + from .verification_ip_flow_result_py3 import VerificationIPFlowResult + from .next_hop_parameters_py3 import NextHopParameters + from .next_hop_result_py3 import NextHopResult + from .security_group_view_parameters_py3 import SecurityGroupViewParameters + from .network_interface_association_py3 import NetworkInterfaceAssociation + from .subnet_association_py3 import SubnetAssociation + from .security_rule_associations_py3 import SecurityRuleAssociations + from .security_group_network_interface_py3 import SecurityGroupNetworkInterface + from .security_group_view_result_py3 import SecurityGroupViewResult + from .packet_capture_storage_location_py3 import PacketCaptureStorageLocation + from .packet_capture_filter_py3 import PacketCaptureFilter + from .packet_capture_parameters_py3 import PacketCaptureParameters + from .packet_capture_py3 import PacketCapture + from .packet_capture_result_py3 import PacketCaptureResult + from .packet_capture_query_status_result_py3 import PacketCaptureQueryStatusResult + from .troubleshooting_parameters_py3 import TroubleshootingParameters + from .query_troubleshooting_parameters_py3 import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions_py3 import TroubleshootingRecommendedActions + from .troubleshooting_details_py3 import TroubleshootingDetails + from .troubleshooting_result_py3 import TroubleshootingResult + from .retention_policy_parameters_py3 import RetentionPolicyParameters + from .flow_log_status_parameters_py3 import FlowLogStatusParameters + from .flow_log_information_py3 import FlowLogInformation + from .connectivity_source_py3 import ConnectivitySource + from .connectivity_destination_py3 import ConnectivityDestination + from .connectivity_parameters_py3 import ConnectivityParameters + from .connectivity_issue_py3 import ConnectivityIssue + from .connectivity_hop_py3 import ConnectivityHop + from .connectivity_information_py3 import ConnectivityInformation + from .patch_route_filter_rule_py3 import PatchRouteFilterRule + from .patch_route_filter_py3 import PatchRouteFilter + from .bgp_community_py3 import BGPCommunity + from .bgp_service_community_py3 import BgpServiceCommunity + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .virtual_network_peering_py3 import VirtualNetworkPeering + from .address_space_py3 import AddressSpace + from .dhcp_options_py3 import DhcpOptions + from .virtual_network_py3 import VirtualNetwork + from .ip_address_availability_result_py3 import IPAddressAvailabilityResult + from .virtual_network_usage_name_py3 import VirtualNetworkUsageName + from .virtual_network_usage_py3 import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration_py3 import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku_py3 import VirtualNetworkGatewaySku + from .vpn_client_root_certificate_py3 import VpnClientRootCertificate + from .vpn_client_revoked_certificate_py3 import VpnClientRevokedCertificate + from .vpn_client_configuration_py3 import VpnClientConfiguration + from .bgp_settings_py3 import BgpSettings + from .bgp_peer_status_py3 import BgpPeerStatus + from .gateway_route_py3 import GatewayRoute + from .virtual_network_gateway_py3 import VirtualNetworkGateway + from .vpn_client_parameters_py3 import VpnClientParameters + from .bgp_peer_status_list_result_py3 import BgpPeerStatusListResult + from .gateway_route_list_result_py3 import GatewayRouteListResult + from .tunnel_connection_health_py3 import TunnelConnectionHealth + from .local_network_gateway_py3 import LocalNetworkGateway + from .ipsec_policy_py3 import IpsecPolicy + from .virtual_network_gateway_connection_py3 import VirtualNetworkGatewayConnection + from .connection_reset_shared_key_py3 import ConnectionResetSharedKey + from .connection_shared_key_py3 import ConnectionSharedKey +except (SyntaxError, ImportError): + from .sub_resource import SubResource + from .backend_address_pool import BackendAddressPool + from .inbound_nat_rule import InboundNatRule + from .security_rule import SecurityRule + from .network_interface_dns_settings import NetworkInterfaceDnsSettings + from .network_interface import NetworkInterface + from .network_security_group import NetworkSecurityGroup + from .route import Route + from .route_table import RouteTable + from .public_ip_address_dns_settings import PublicIPAddressDnsSettings + from .public_ip_address import PublicIPAddress + from .ip_configuration import IPConfiguration + from .resource_navigation_link import ResourceNavigationLink + from .subnet import Subnet + from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health import ApplicationGatewayBackendHealth + from .application_gateway_sku import ApplicationGatewaySku + from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port import ApplicationGatewayFrontendPort + from .application_gateway_http_listener import ApplicationGatewayHttpListener + from .application_gateway_path_rule import ApplicationGatewayPathRule + from .application_gateway_probe import ApplicationGatewayProbe + from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule + from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway import ApplicationGateway + from .application_gateway_firewall_rule import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult + from .resource import Resource + from .dns_name_availability_result import DnsNameAvailabilityResult + from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig + from .route_filter_rule import RouteFilterRule + from .express_route_circuit_stats import ExpressRouteCircuitStats + from .express_route_circuit_peering import ExpressRouteCircuitPeering + from .route_filter import RouteFilter + from .ipv6_express_route_circuit_peering_config import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit import ExpressRouteCircuit + from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider import ExpressRouteServiceProvider + from .frontend_ip_configuration import FrontendIPConfiguration + from .load_balancing_rule import LoadBalancingRule + from .probe import Probe + from .inbound_nat_pool import InboundNatPool + from .outbound_nat_rule import OutboundNatRule + from .load_balancer import LoadBalancer + from .error_details import ErrorDetails + from .error import Error + from .azure_async_operation_result import AzureAsyncOperationResult + from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule import EffectiveNetworkSecurityRule + from .effective_network_security_group import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult + from .effective_route import EffectiveRoute + from .effective_route_list_result import EffectiveRouteListResult + from .network_watcher import NetworkWatcher + from .topology_parameters import TopologyParameters + from .topology_association import TopologyAssociation + from .topology_resource import TopologyResource + from .topology import Topology + from .verification_ip_flow_parameters import VerificationIPFlowParameters + from .verification_ip_flow_result import VerificationIPFlowResult + from .next_hop_parameters import NextHopParameters + from .next_hop_result import NextHopResult + from .security_group_view_parameters import SecurityGroupViewParameters + from .network_interface_association import NetworkInterfaceAssociation + from .subnet_association import SubnetAssociation + from .security_rule_associations import SecurityRuleAssociations + from .security_group_network_interface import SecurityGroupNetworkInterface + from .security_group_view_result import SecurityGroupViewResult + from .packet_capture_storage_location import PacketCaptureStorageLocation + from .packet_capture_filter import PacketCaptureFilter + from .packet_capture_parameters import PacketCaptureParameters + from .packet_capture import PacketCapture + from .packet_capture_result import PacketCaptureResult + from .packet_capture_query_status_result import PacketCaptureQueryStatusResult + from .troubleshooting_parameters import TroubleshootingParameters + from .query_troubleshooting_parameters import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions + from .troubleshooting_details import TroubleshootingDetails + from .troubleshooting_result import TroubleshootingResult + from .retention_policy_parameters import RetentionPolicyParameters + from .flow_log_status_parameters import FlowLogStatusParameters + from .flow_log_information import FlowLogInformation + from .connectivity_source import ConnectivitySource + from .connectivity_destination import ConnectivityDestination + from .connectivity_parameters import ConnectivityParameters + from .connectivity_issue import ConnectivityIssue + from .connectivity_hop import ConnectivityHop + from .connectivity_information import ConnectivityInformation + from .patch_route_filter_rule import PatchRouteFilterRule + from .patch_route_filter import PatchRouteFilter + from .bgp_community import BGPCommunity + from .bgp_service_community import BgpServiceCommunity + from .usage_name import UsageName + from .usage import Usage + from .virtual_network_peering import VirtualNetworkPeering + from .address_space import AddressSpace + from .dhcp_options import DhcpOptions + from .virtual_network import VirtualNetwork + from .ip_address_availability_result import IPAddressAvailabilityResult + from .virtual_network_usage_name import VirtualNetworkUsageName + from .virtual_network_usage import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku import VirtualNetworkGatewaySku + from .vpn_client_root_certificate import VpnClientRootCertificate + from .vpn_client_revoked_certificate import VpnClientRevokedCertificate + from .vpn_client_configuration import VpnClientConfiguration + from .bgp_settings import BgpSettings + from .bgp_peer_status import BgpPeerStatus + from .gateway_route import GatewayRoute + from .virtual_network_gateway import VirtualNetworkGateway + from .vpn_client_parameters import VpnClientParameters + from .bgp_peer_status_list_result import BgpPeerStatusListResult + from .gateway_route_list_result import GatewayRouteListResult + from .tunnel_connection_health import TunnelConnectionHealth + from .local_network_gateway import LocalNetworkGateway + from .ipsec_policy import IpsecPolicy + from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection + from .connection_reset_shared_key import ConnectionResetSharedKey + from .connection_shared_key import ConnectionSharedKey from .application_gateway_paged import ApplicationGatewayPaged from .express_route_circuit_authorization_paged import ExpressRouteCircuitAuthorizationPaged from .express_route_circuit_peering_paged import ExpressRouteCircuitPeeringPaged diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/address_space.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/address_space.py index d7050c78a457..fbf42c9e0ade 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/address_space.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/address_space.py @@ -25,6 +25,6 @@ class AddressSpace(Model): 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, } - def __init__(self, address_prefixes=None): - super(AddressSpace, self).__init__() - self.address_prefixes = address_prefixes + def __init__(self, **kwargs): + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = kwargs.get('address_prefixes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/address_space_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/address_space_py3.py new file mode 100644 index 000000000000..9794cc805efa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/address_space_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AddressSpace(Model): + """AddressSpace contains an array of IP address ranges that can be used by + subnets of the virtual network. + + :param address_prefixes: A list of address blocks reserved for this + virtual network in CIDR notation. + :type address_prefixes: list[str] + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__(self, *, address_prefixes=None, **kwargs) -> None: + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = address_prefixes diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway.py index e71c6dd49b5a..f05b619bbe46 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway.py @@ -125,23 +125,23 @@ class ApplicationGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, web_application_firewall_configuration=None, resource_guid=None, provisioning_state=None, etag=None): - super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.ssl_policy = ssl_policy + def __init__(self, **kwargs): + super(ApplicationGateway, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.ssl_policy = kwargs.get('ssl_policy', None) self.operational_state = None - self.gateway_ip_configurations = gateway_ip_configurations - self.authentication_certificates = authentication_certificates - self.ssl_certificates = ssl_certificates - self.frontend_ip_configurations = frontend_ip_configurations - self.frontend_ports = frontend_ports - self.probes = probes - self.backend_address_pools = backend_address_pools - self.backend_http_settings_collection = backend_http_settings_collection - self.http_listeners = http_listeners - self.url_path_maps = url_path_maps - self.request_routing_rules = request_routing_rules - self.web_application_firewall_configuration = web_application_firewall_configuration - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.gateway_ip_configurations = kwargs.get('gateway_ip_configurations', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.ssl_certificates = kwargs.get('ssl_certificates', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.frontend_ports = kwargs.get('frontend_ports', None) + self.probes = kwargs.get('probes', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) + self.http_listeners = kwargs.get('http_listeners', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.web_application_firewall_configuration = kwargs.get('web_application_firewall_configuration', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_authentication_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_authentication_certificate.py index a492a39ca080..c7fb4d9a7226 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_authentication_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_authentication_certificate.py @@ -39,9 +39,9 @@ class ApplicationGatewayAuthenticationCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, data=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id) - self.data = data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayAuthenticationCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_authentication_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_authentication_certificate_py3.py new file mode 100644 index 000000000000..2ab1073a0e7d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_authentication_certificate_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayAuthenticationCertificate(SubResource): + """Authentication certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Certificate public data. + :type data: str + :param provisioning_state: Provisioning state of the authentication + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_available_waf_rule_sets_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_available_waf_rule_sets_result.py index fe63490ea5bb..8d9553ee7cf6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_available_waf_rule_sets_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_available_waf_rule_sets_result.py @@ -24,6 +24,6 @@ class ApplicationGatewayAvailableWafRuleSetsResult(Model): 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, } - def __init__(self, value=None): - super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_available_waf_rule_sets_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_available_waf_rule_sets_result_py3.py new file mode 100644 index 000000000000..ec8df9f2c58f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_available_waf_rule_sets_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayAvailableWafRuleSetsResult(Model): + """Response for ApplicationGatewayAvailableWafRuleSets API service call. + + :param value: The list of application gateway rule sets. + :type value: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayFirewallRuleSet] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address.py index 6005027d0845..e7a61fe1705c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address.py @@ -26,7 +26,7 @@ class ApplicationGatewayBackendAddress(Model): 'ip_address': {'key': 'ipAddress', 'type': 'str'}, } - def __init__(self, fqdn=None, ip_address=None): - super(ApplicationGatewayBackendAddress, self).__init__() - self.fqdn = fqdn - self.ip_address = ip_address + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = kwargs.get('fqdn', None) + self.ip_address = kwargs.get('ip_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address_pool.py index a021e9f27584..e6789d38a28a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address_pool.py @@ -44,10 +44,10 @@ class ApplicationGatewayBackendAddressPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayBackendAddressPool, self).__init__(id=id) - self.backend_ip_configurations = backend_ip_configurations - self.backend_addresses = backend_addresses - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddressPool, self).__init__(**kwargs) + self.backend_ip_configurations = kwargs.get('backend_ip_configurations', None) + self.backend_addresses = kwargs.get('backend_addresses', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address_pool_py3.py new file mode 100644 index 000000000000..8f8cca7f2379 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address_pool_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + :param id: Resource ID. + :type id: str + :param backend_ip_configurations: Collection of references to IPs defined + in network interfaces. + :type backend_ip_configurations: + list[~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses + :type backend_addresses: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendAddress] + :param provisioning_state: Provisioning state of the backend address pool + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Resource that is unique within a resource group. This name + can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = backend_ip_configurations + self.backend_addresses = backend_addresses + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address_py3.py new file mode 100644 index 000000000000..d18e476244d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_address_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendAddress(Model): + """Backend address of an application gateway. + + :param fqdn: Fully qualified domain name (FQDN). + :type fqdn: str + :param ip_address: IP address + :type ip_address: str + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__(self, *, fqdn: str=None, ip_address: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = fqdn + self.ip_address = ip_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health.py index c751d53a3b63..9980439b686d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health.py @@ -24,6 +24,6 @@ class ApplicationGatewayBackendHealth(Model): 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, } - def __init__(self, backend_address_pools=None): - super(ApplicationGatewayBackendHealth, self).__init__() - self.backend_address_pools = backend_address_pools + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = kwargs.get('backend_address_pools', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_http_settings.py index 0e427c403ec9..ccb2ec832d77 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_http_settings.py @@ -29,7 +29,7 @@ class ApplicationGatewayBackendHealthHttpSettings(Model): 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, } - def __init__(self, backend_http_settings=None, servers=None): - super(ApplicationGatewayBackendHealthHttpSettings, self).__init__() - self.backend_http_settings = backend_http_settings - self.servers = servers + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.servers = kwargs.get('servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_http_settings_py3.py new file mode 100644 index 000000000000..679d9ad30248 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_http_settings_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthHttpSettings(Model): + """Application gateway BackendHealthHttp settings. + + :param backend_http_settings: Reference of an + ApplicationGatewayBackendHttpSettings resource. + :type backend_http_settings: + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendHealthServer] + """ + + _attribute_map = { + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, + 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, + } + + def __init__(self, *, backend_http_settings=None, servers=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = backend_http_settings + self.servers = servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_pool.py index aa7b650f29f0..c8114b9348c8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_pool.py @@ -30,7 +30,7 @@ class ApplicationGatewayBackendHealthPool(Model): 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, } - def __init__(self, backend_address_pool=None, backend_http_settings_collection=None): - super(ApplicationGatewayBackendHealthPool, self).__init__() - self.backend_address_pool = backend_address_pool - self.backend_http_settings_collection = backend_http_settings_collection + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_pool_py3.py new file mode 100644 index 000000000000..810dfe98694d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_pool_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthPool(Model): + """Application gateway BackendHealth pool. + + :param backend_address_pool: Reference of an + ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of + ApplicationGatewayBackendHealthHttpSettings resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, + } + + def __init__(self, *, backend_address_pool=None, backend_http_settings_collection=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_http_settings_collection = backend_http_settings_collection diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_py3.py new file mode 100644 index 000000000000..ea2797cbd52b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealth(Model): + """List of ApplicationGatewayBackendHealthPool resources. + + :param backend_address_pools: + :type backend_address_pools: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendHealthPool] + """ + + _attribute_map = { + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, + } + + def __init__(self, *, backend_address_pools=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = backend_address_pools diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_server.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_server.py index 945cd10458aa..0cfba4ca5442 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_server.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_server.py @@ -31,8 +31,8 @@ class ApplicationGatewayBackendHealthServer(Model): 'health': {'key': 'health', 'type': 'str'}, } - def __init__(self, address=None, ip_configuration=None, health=None): - super(ApplicationGatewayBackendHealthServer, self).__init__() - self.address = address - self.ip_configuration = ip_configuration - self.health = health + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + self.ip_configuration = kwargs.get('ip_configuration', None) + self.health = kwargs.get('health', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_server_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_server_py3.py new file mode 100644 index 000000000000..41381454a878 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_health_server_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthServer(Model): + """Application gateway backendhealth http settings. + + :param address: IP address or FQDN of backend server. + :type address: str + :param ip_configuration: Reference of IP configuration of backend server. + :type ip_configuration: ~azure.mgmt.network.v2017_03_01.models.SubResource + :param health: Health of backend server. Possible values include: + 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + :type health: str or + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendHealthServerHealth + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': 'SubResource'}, + 'health': {'key': 'health', 'type': 'str'}, + } + + def __init__(self, *, address: str=None, ip_configuration=None, health=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = address + self.ip_configuration = ip_configuration + self.health = health diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_http_settings.py index a38286c02aa8..1675ea8d8db9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_http_settings.py @@ -65,15 +65,15 @@ class ApplicationGatewayBackendHttpSettings(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, port=None, protocol=None, cookie_based_affinity=None, request_timeout=None, probe=None, authentication_certificates=None, provisioning_state=None, connection_draining=None, name=None, etag=None): - super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id) - self.port = port - self.protocol = protocol - self.cookie_based_affinity = cookie_based_affinity - self.request_timeout = request_timeout - self.probe = probe - self.authentication_certificates = authentication_certificates - self.provisioning_state = provisioning_state - self.connection_draining = connection_draining - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHttpSettings, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.protocol = kwargs.get('protocol', None) + self.cookie_based_affinity = kwargs.get('cookie_based_affinity', None) + self.request_timeout = kwargs.get('request_timeout', None) + self.probe = kwargs.get('probe', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.connection_draining = kwargs.get('connection_draining', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_http_settings_py3.py new file mode 100644 index 000000000000..e6219977cc1e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_backend_http_settings_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendHttpSettings(SubResource): + """Backend address pool settings of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Port + :type port: int + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayProtocol + :param cookie_based_affinity: Cookie based affinity. Possible values + include: 'Enabled', 'Disabled' + :type cookie_based_affinity: str or + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayCookieBasedAffinity + :param request_timeout: Request timeout in seconds. Application Gateway + will fail the request if response is not received within RequestTimeout. + Acceptable values are from 1 second to 86400 seconds. + :type request_timeout: int + :param probe: Probe resource of an application gateway. + :type probe: ~azure.mgmt.network.v2017_03_01.models.SubResource + :param authentication_certificates: Array of references to application + gateway authentication certificates. + :type authentication_certificates: + list[~azure.mgmt.network.v2017_03_01.models.SubResource] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param connection_draining: Connection draining of the backend http + settings resource. + :type connection_draining: + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayConnectionDraining + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, + 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'connection_draining': {'key': 'properties.connectionDraining', 'type': 'ApplicationGatewayConnectionDraining'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, protocol=None, cookie_based_affinity=None, request_timeout: int=None, probe=None, authentication_certificates=None, provisioning_state: str=None, connection_draining=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id, **kwargs) + self.port = port + self.protocol = protocol + self.cookie_based_affinity = cookie_based_affinity + self.request_timeout = request_timeout + self.probe = probe + self.authentication_certificates = authentication_certificates + self.provisioning_state = provisioning_state + self.connection_draining = connection_draining + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_connection_draining.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_connection_draining.py index 8f9b88b571e2..531b3cb05dd3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_connection_draining.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_connection_draining.py @@ -17,10 +17,12 @@ class ApplicationGatewayConnectionDraining(Model): active for a specified time after the backend server got removed from the configuration. - :param enabled: Whether connection draining is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. :type enabled: bool - :param drain_timeout_in_sec: The number of seconds connection draining is - active. Acceptable values are from 1 second to 3600 seconds. + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. :type drain_timeout_in_sec: int """ @@ -34,7 +36,7 @@ class ApplicationGatewayConnectionDraining(Model): 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, } - def __init__(self, enabled, drain_timeout_in_sec): - super(ApplicationGatewayConnectionDraining, self).__init__() - self.enabled = enabled - self.drain_timeout_in_sec = drain_timeout_in_sec + def __init__(self, **kwargs): + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.drain_timeout_in_sec = kwargs.get('drain_timeout_in_sec', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_connection_draining_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_connection_draining_py3.py new file mode 100644 index 000000000000..c46fb01cae72 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_connection_draining_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayConnectionDraining(Model): + """Connection draining allows open connections to a backend server to be + active for a specified time after the backend server got removed from the + configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. + :type enabled: bool + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. + :type drain_timeout_in_sec: int + """ + + _validation = { + 'enabled': {'required': True}, + 'drain_timeout_in_sec': {'required': True, 'maximum': 3600, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool, drain_timeout_in_sec: int, **kwargs) -> None: + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = enabled + self.drain_timeout_in_sec = drain_timeout_in_sec diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_disabled_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_disabled_rule_group.py index 02c88980e857..085ae3d78c5c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_disabled_rule_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_disabled_rule_group.py @@ -15,7 +15,10 @@ class ApplicationGatewayFirewallDisabledRuleGroup(Model): """Allows to disable rules within a rule group or an entire rule group. - :param rule_group_name: The name of the rule group that will be disabled. + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. :type rule_group_name: str :param rules: The list of rules that will be disabled. If null, all rules of the rule group will be disabled. @@ -31,7 +34,7 @@ class ApplicationGatewayFirewallDisabledRuleGroup(Model): 'rules': {'key': 'rules', 'type': '[int]'}, } - def __init__(self, rule_group_name, rules=None): - super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__() - self.rule_group_name = rule_group_name - self.rules = rules + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_disabled_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_disabled_rule_group_py3.py new file mode 100644 index 000000000000..44ac696b801c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_disabled_rule_group_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallDisabledRuleGroup(Model): + """Allows to disable rules within a rule group or an entire rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. + :type rule_group_name: str + :param rules: The list of rules that will be disabled. If null, all rules + of the rule group will be disabled. + :type rules: list[int] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[int]'}, + } + + def __init__(self, *, rule_group_name: str, rules=None, **kwargs) -> None: + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule.py index f3f7da7cc11b..661b0d146e16 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule.py @@ -15,7 +15,10 @@ class ApplicationGatewayFirewallRule(Model): """A web application firewall rule. - :param rule_id: The identifier of the web application firewall rule. + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. :type rule_id: int :param description: The description of the web application firewall rule. :type description: str @@ -30,7 +33,7 @@ class ApplicationGatewayFirewallRule(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, rule_id, description=None): - super(ApplicationGatewayFirewallRule, self).__init__() - self.rule_id = rule_id - self.description = description + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_group.py index d6fe0efec807..ce9050da61ca 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_group.py @@ -15,13 +15,16 @@ class ApplicationGatewayFirewallRuleGroup(Model): """A web application firewall rule group. - :param rule_group_name: The name of the web application firewall rule - group. + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. :type rule_group_name: str :param description: The description of the web application firewall rule group. :type description: str - :param rules: The rules of the web application firewall rule group. + :param rules: Required. The rules of the web application firewall rule + group. :type rules: list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayFirewallRule] """ @@ -37,8 +40,8 @@ class ApplicationGatewayFirewallRuleGroup(Model): 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, } - def __init__(self, rule_group_name, rules, description=None): - super(ApplicationGatewayFirewallRuleGroup, self).__init__() - self.rule_group_name = rule_group_name - self.description = description - self.rules = rules + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.description = kwargs.get('description', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_group_py3.py new file mode 100644 index 000000000000..95ec84184bf9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_group_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRuleGroup(Model): + """A web application firewall rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. + :type rule_group_name: str + :param description: The description of the web application firewall rule + group. + :type description: str + :param rules: Required. The rules of the web application firewall rule + group. + :type rules: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayFirewallRule] + """ + + _validation = { + 'rule_group_name': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, + } + + def __init__(self, *, rule_group_name: str, rules, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.description = description + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_py3.py new file mode 100644 index 000000000000..e332fbd16853 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRule(Model): + """A web application firewall rule. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. + :type rule_id: int + :param description: The description of the web application firewall rule. + :type description: str + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, rule_id: int, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = rule_id + self.description = description diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_set.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_set.py index 8bfa8f743098..79a9bbf8d9c8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_set.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_set.py @@ -18,6 +18,8 @@ class ApplicationGatewayFirewallRuleSet(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -31,13 +33,14 @@ class ApplicationGatewayFirewallRuleSet(Resource): :param provisioning_state: The provisioning state of the web application firewall rule set. :type provisioning_state: str - :param rule_set_type: The type of the web application firewall rule set. + :param rule_set_type: Required. The type of the web application firewall + rule set. :type rule_set_type: str - :param rule_set_version: The version of the web application firewall rule - set type. + :param rule_set_version: Required. The version of the web application + firewall rule set type. :type rule_set_version: str - :param rule_groups: The rule groups of the web application firewall rule - set. + :param rule_groups: Required. The rule groups of the web application + firewall rule set. :type rule_groups: list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayFirewallRuleGroup] """ @@ -62,9 +65,9 @@ class ApplicationGatewayFirewallRuleSet(Resource): 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, } - def __init__(self, rule_set_type, rule_set_version, rule_groups, id=None, location=None, tags=None, provisioning_state=None): - super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags) - self.provisioning_state = provisioning_state - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.rule_groups = rule_groups + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleSet, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.rule_groups = kwargs.get('rule_groups', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_set_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_set_py3.py new file mode 100644 index 000000000000..910179636fe0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_firewall_rule_set_py3.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayFirewallRuleSet(Resource): + """A web application firewall rule set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param provisioning_state: The provisioning state of the web application + firewall rule set. + :type provisioning_state: str + :param rule_set_type: Required. The type of the web application firewall + rule set. + :type rule_set_type: str + :param rule_set_version: Required. The version of the web application + firewall rule set type. + :type rule_set_version: str + :param rule_groups: Required. The rule groups of the web application + firewall rule set. + :type rule_groups: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayFirewallRuleGroup] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'rule_groups': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, + } + + def __init__(self, *, rule_set_type: str, rule_set_version: str, rule_groups, id: str=None, location: str=None, tags=None, provisioning_state: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.rule_groups = rule_groups diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_ip_configuration.py index 110a5ec00601..176662e7cc2d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_ip_configuration.py @@ -51,12 +51,12 @@ class ApplicationGatewayFrontendIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..495149d37664 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_ip_configuration_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): + """Frontend IP configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param private_ip_address: PrivateIPAddress of the network interface IP + Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: PrivateIP allocation method. Possible + values include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_03_01.models.IPAllocationMethod + :param subnet: Reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_03_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param provisioning_state: Provisioning state of the public IP resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_port.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_port.py index 1555284f9949..a8c5b703f4e6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_port.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_port.py @@ -38,9 +38,9 @@ class ApplicationGatewayFrontendPort(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, port=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayFrontendPort, self).__init__(id=id) - self.port = port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendPort, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_port_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_port_py3.py new file mode 100644 index 000000000000..557923221748 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_frontend_port_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Frontend port + :type port: int + :param provisioning_state: Provisioning state of the frontend port + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendPort, self).__init__(id=id, **kwargs) + self.port = port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_http_listener.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_http_listener.py index 1ab2d6378a19..db16c72f7185 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_http_listener.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_http_listener.py @@ -58,14 +58,14 @@ class ApplicationGatewayHttpListener(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name=None, ssl_certificate=None, require_server_name_indication=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayHttpListener, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.frontend_port = frontend_port - self.protocol = protocol - self.host_name = host_name - self.ssl_certificate = ssl_certificate - self.require_server_name_indication = require_server_name_indication - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayHttpListener, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.protocol = kwargs.get('protocol', None) + self.host_name = kwargs.get('host_name', None) + self.ssl_certificate = kwargs.get('ssl_certificate', None) + self.require_server_name_indication = kwargs.get('require_server_name_indication', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_http_listener_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_http_listener_py3.py new file mode 100644 index 000000000000..9f5c3050a2ba --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_http_listener_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayHttpListener(SubResource): + """Http listener of an application gateway. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: Frontend IP configuration resource of an + application gateway. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2017_03_01.models.SubResource + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayProtocol + :param host_name: Host name of HTTP listener. + :type host_name: str + :param ssl_certificate: SSL certificate resource of an application + gateway. + :type ssl_certificate: ~azure.mgmt.network.v2017_03_01.models.SubResource + :param require_server_name_indication: Applicable only if protocol is + https. Enables SNI for multi-hosting. + :type require_server_name_indication: bool + :param provisioning_state: Provisioning state of the HTTP listener + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, + 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name: str=None, ssl_certificate=None, require_server_name_indication: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayHttpListener, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.frontend_port = frontend_port + self.protocol = protocol + self.host_name = host_name + self.ssl_certificate = ssl_certificate + self.require_server_name_indication = require_server_name_indication + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ip_configuration.py index 5e17a2fa31f3..a55c7787ead1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ip_configuration.py @@ -41,9 +41,9 @@ class ApplicationGatewayIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, subnet=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayIPConfiguration, self).__init__(id=id) - self.subnet = subnet - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayIPConfiguration, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..fbc4cf48e641 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ip_configuration_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 + private IP configuration is allowed. + + :param id: Resource ID. + :type id: str + :param subnet: Reference of the subnet resource. A subnet from where + application gateway gets its private address. + :type subnet: ~azure.mgmt.network.v2017_03_01.models.SubResource + :param provisioning_state: Provisioning state of the application gateway + subnet resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, subnet=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.subnet = subnet + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_path_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_path_rule.py index 45bb09307f21..29b81777117d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_path_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_path_rule.py @@ -48,11 +48,11 @@ class ApplicationGatewayPathRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, paths=None, backend_address_pool=None, backend_http_settings=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayPathRule, self).__init__(id=id) - self.paths = paths - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayPathRule, self).__init__(**kwargs) + self.paths = kwargs.get('paths', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_path_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_path_rule_py3.py new file mode 100644 index 000000000000..aae2a807e0cf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_path_rule_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayPathRule(SubResource): + """Path rule of URL path map of an application gateway. + + :param id: Resource ID. + :type id: str + :param paths: Path rules of URL path map. + :type paths: list[str] + :param backend_address_pool: Backend address pool resource of URL path + map. + :type backend_address_pool: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param backend_http_settings: Backend http settings resource of URL path + map. + :type backend_http_settings: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param provisioning_state: Path rule of URL path map resource. Possible + values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'paths': {'key': 'properties.paths', 'type': '[str]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, paths=None, backend_address_pool=None, backend_http_settings=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayPathRule, self).__init__(id=id, **kwargs) + self.paths = paths + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_probe.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_probe.py index 2efa12474d0a..be1e4e6af9eb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_probe.py @@ -61,14 +61,14 @@ class ApplicationGatewayProbe(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, protocol=None, host=None, path=None, interval=None, timeout=None, unhealthy_threshold=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayProbe, self).__init__(id=id) - self.protocol = protocol - self.host = host - self.path = path - self.interval = interval - self.timeout = timeout - self.unhealthy_threshold = unhealthy_threshold - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayProbe, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.host = kwargs.get('host', None) + self.path = kwargs.get('path', None) + self.interval = kwargs.get('interval', None) + self.timeout = kwargs.get('timeout', None) + self.unhealthy_threshold = kwargs.get('unhealthy_threshold', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_probe_py3.py new file mode 100644 index 000000000000..43023ab197e0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_probe_py3.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayProbe(SubResource): + """Probe of the application gateway. + + :param id: Resource ID. + :type id: str + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is + sent to ://: + :type path: str + :param interval: The probing interval in seconds. This is the time + interval between two consecutive probes. Acceptable values are from 1 + second to 86400 seconds. + :type interval: int + :param timeout: the probe timeout in seconds. Probe marked as failed if + valid response is not received with this timeout period. Acceptable values + are from 1 second to 86400 seconds. + :type timeout: int + :param unhealthy_threshold: The probe retry count. Backend server is + marked down after consecutive probe failure count reaches + UnhealthyThreshold. Acceptable values are from 1 second to 20. + :type unhealthy_threshold: int + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host': {'key': 'properties.host', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, protocol=None, host: str=None, path: str=None, interval: int=None, timeout: int=None, unhealthy_threshold: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayProbe, self).__init__(id=id, **kwargs) + self.protocol = protocol + self.host = host + self.path = path + self.interval = interval + self.timeout = timeout + self.unhealthy_threshold = unhealthy_threshold + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_py3.py new file mode 100644 index 000000000000..9cfb32ac4edc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_py3.py @@ -0,0 +1,147 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGateway(Resource): + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewaySslPolicy + :ivar operational_state: Operational state of the application gateway + resource. Possible values include: 'Stopped', 'Starting', 'Running', + 'Stopping' + :vartype operational_state: str or + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayOperationalState + :param gateway_ip_configurations: Subnets of application the gateway + resource. + :type gateway_ip_configurations: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayIPConfiguration] + :param authentication_certificates: Authentication certificates of the + application gateway resource. + :type authentication_certificates: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayAuthenticationCertificate] + :param ssl_certificates: SSL certificates of the application gateway + resource. + :type ssl_certificates: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewaySslCertificate] + :param frontend_ip_configurations: Frontend IP addresses of the + application gateway resource. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayFrontendIPConfiguration] + :param frontend_ports: Frontend ports of the application gateway resource. + :type frontend_ports: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayProbe] + :param backend_address_pools: Backend address pool of the application + gateway resource. + :type backend_address_pools: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendAddressPool] + :param backend_http_settings_collection: Backend http settings of the + application gateway resource. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendHttpSettings] + :param http_listeners: Http listeners of the application gateway resource. + :type http_listeners: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayHttpListener] + :param url_path_maps: URL path map of the application gateway resource. + :type url_path_maps: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application + gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayRequestRoutingRule] + :param web_application_firewall_configuration: Web application firewall + configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param resource_guid: Resource GUID property of the application gateway + resource. + :type resource_guid: str + :param provisioning_state: Provisioning state of the application gateway + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operational_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, + 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, + 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, + 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, + 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, + 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, web_application_firewall_configuration=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.ssl_policy = ssl_policy + self.operational_state = None + self.gateway_ip_configurations = gateway_ip_configurations + self.authentication_certificates = authentication_certificates + self.ssl_certificates = ssl_certificates + self.frontend_ip_configurations = frontend_ip_configurations + self.frontend_ports = frontend_ports + self.probes = probes + self.backend_address_pools = backend_address_pools + self.backend_http_settings_collection = backend_http_settings_collection + self.http_listeners = http_listeners + self.url_path_maps = url_path_maps + self.request_routing_rules = request_routing_rules + self.web_application_firewall_configuration = web_application_firewall_configuration + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_request_routing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_request_routing_rule.py index 579f4268bb7b..9916aadc837f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_request_routing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_request_routing_rule.py @@ -56,13 +56,13 @@ class ApplicationGatewayRequestRoutingRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id) - self.rule_type = rule_type - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.http_listener = http_listener - self.url_path_map = url_path_map - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayRequestRoutingRule, self).__init__(**kwargs) + self.rule_type = kwargs.get('rule_type', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.http_listener = kwargs.get('http_listener', None) + self.url_path_map = kwargs.get('url_path_map', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_request_routing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_request_routing_rule_py3.py new file mode 100644 index 000000000000..e7c87f6bc7cd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_request_routing_rule_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRequestRoutingRule(SubResource): + """Request routing rule of an application gateway. + + :param id: Resource ID. + :type id: str + :param rule_type: Rule type. Possible values include: 'Basic', + 'PathBasedRouting' + :type rule_type: str or + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayRequestRoutingRuleType + :param backend_address_pool: Backend address pool resource of the + application gateway. + :type backend_address_pool: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param backend_http_settings: Frontend port resource of the application + gateway. + :type backend_http_settings: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2017_03_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2017_03_01.models.SubResource + :param provisioning_state: Provisioning state of the request routing rule + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, + 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id, **kwargs) + self.rule_type = rule_type + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.http_listener = http_listener + self.url_path_map = url_path_map + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_sku.py index 14f55a4d269a..70bfa920a7e5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_sku.py @@ -34,8 +34,8 @@ class ApplicationGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(ApplicationGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_sku_py3.py new file mode 100644 index 000000000000..7b23148dcc6f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_sku_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySku(Model): + """SKU of an application gateway. + + :param name: Name of an application gateway SKU. Possible values include: + 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', + 'WAF_Large' + :type name: str or + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewaySkuName + :param tier: Tier of an application gateway. Possible values include: + 'Standard', 'WAF' + :type tier: str or + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayTier + :param capacity: Capacity (instance count) of an application gateway. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_certificate.py index b29e94104a25..b3538fc5d66b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_certificate.py @@ -47,11 +47,11 @@ class ApplicationGatewaySslCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, data=None, password=None, public_cert_data=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewaySslCertificate, self).__init__(id=id) - self.data = data - self.password = password - self.public_cert_data = public_cert_data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewaySslCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.password = kwargs.get('password', None) + self.public_cert_data = kwargs.get('public_cert_data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_certificate_py3.py new file mode 100644 index 000000000000..f00c4fb2302e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_certificate_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Base-64 encoded pfx certificate. Only applicable in PUT + Request. + :type data: str + :param password: Password for the pfx file specified in data. Only + applicable in PUT request. + :type password: str + :param public_cert_data: Base-64 encoded Public cert data corresponding to + pfx specified in data. Only applicable in GET request. + :type public_cert_data: str + :param provisioning_state: Provisioning state of the SSL certificate + resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, password: str=None, public_cert_data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewaySslCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.password = password + self.public_cert_data = public_cert_data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_policy.py index 6ef0a3a8126e..c12534624ea7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_policy.py @@ -25,6 +25,6 @@ class ApplicationGatewaySslPolicy(Model): 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, } - def __init__(self, disabled_ssl_protocols=None): - super(ApplicationGatewaySslPolicy, self).__init__() - self.disabled_ssl_protocols = disabled_ssl_protocols + def __init__(self, **kwargs): + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = kwargs.get('disabled_ssl_protocols', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_policy_py3.py new file mode 100644 index 000000000000..f2adbaa20d52 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_ssl_policy_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySslPolicy(Model): + """Application gateway SSL policy. + + :param disabled_ssl_protocols: SSL protocols to be disabled on application + gateway. + :type disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewaySslProtocol] + """ + + _attribute_map = { + 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, + } + + def __init__(self, *, disabled_ssl_protocols=None, **kwargs) -> None: + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = disabled_ssl_protocols diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_url_path_map.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_url_path_map.py index 1e9c483141d8..19afc53bb092 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_url_path_map.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_url_path_map.py @@ -50,11 +50,11 @@ class ApplicationGatewayUrlPathMap(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, default_backend_address_pool=None, default_backend_http_settings=None, path_rules=None, provisioning_state=None, name=None, etag=None): - super(ApplicationGatewayUrlPathMap, self).__init__(id=id) - self.default_backend_address_pool = default_backend_address_pool - self.default_backend_http_settings = default_backend_http_settings - self.path_rules = path_rules - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(ApplicationGatewayUrlPathMap, self).__init__(**kwargs) + self.default_backend_address_pool = kwargs.get('default_backend_address_pool', None) + self.default_backend_http_settings = kwargs.get('default_backend_http_settings', None) + self.path_rules = kwargs.get('path_rules', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_url_path_map_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_url_path_map_py3.py new file mode 100644 index 000000000000..5bb9e802c139 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_url_path_map_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayUrlPathMap(SubResource): + """UrlPathMaps give a url path to the backend mapping information for + PathBasedRouting. + + :param id: Resource ID. + :type id: str + :param default_backend_address_pool: Default backend address pool resource + of URL path map. + :type default_backend_address_pool: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param default_backend_http_settings: Default backend http settings + resource of URL path map. + :type default_backend_http_settings: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayPathRule] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, + 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, default_backend_address_pool=None, default_backend_http_settings=None, path_rules=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGatewayUrlPathMap, self).__init__(id=id, **kwargs) + self.default_backend_address_pool = default_backend_address_pool + self.default_backend_http_settings = default_backend_http_settings + self.path_rules = path_rules + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_web_application_firewall_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_web_application_firewall_configuration.py index 4bf078062fc7..e7bbd0001beb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_web_application_firewall_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_web_application_firewall_configuration.py @@ -15,16 +15,19 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): """Application gateway web application firewall configuration. - :param enabled: Whether the web application firewall is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. :type enabled: bool - :param firewall_mode: Web application firewall mode. Possible values - include: 'Detection', 'Prevention' + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' :type firewall_mode: str or ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayFirewallMode - :param rule_set_type: The type of the web application firewall rule set. - Possible values are: 'OWASP'. + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. :type rule_set_type: str - :param rule_set_version: The version of the rule set type. + :param rule_set_version: Required. The version of the rule set type. :type rule_set_version: str :param disabled_rule_groups: The disabled rule groups. :type disabled_rule_groups: @@ -46,10 +49,10 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, } - def __init__(self, enabled, firewall_mode, rule_set_type, rule_set_version, disabled_rule_groups=None): - super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__() - self.enabled = enabled - self.firewall_mode = firewall_mode - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.disabled_rule_groups = disabled_rule_groups + def __init__(self, **kwargs): + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.firewall_mode = kwargs.get('firewall_mode', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.disabled_rule_groups = kwargs.get('disabled_rule_groups', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_web_application_firewall_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_web_application_firewall_configuration_py3.py new file mode 100644 index 000000000000..1519f220b2b0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_web_application_firewall_configuration_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayWebApplicationFirewallConfiguration(Model): + """Application gateway web application firewall configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. + :type enabled: bool + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' + :type firewall_mode: str or + ~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayFirewallMode + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. + :type rule_set_type: str + :param rule_set_version: Required. The version of the rule set type. + :type rule_set_version: str + :param disabled_rule_groups: The disabled rule groups. + :type disabled_rule_groups: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayFirewallDisabledRuleGroup] + """ + + _validation = { + 'enabled': {'required': True}, + 'firewall_mode': {'required': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, + } + + def __init__(self, *, enabled: bool, firewall_mode, rule_set_type: str, rule_set_version: str, disabled_rule_groups=None, **kwargs) -> None: + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = enabled + self.firewall_mode = firewall_mode + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.disabled_rule_groups = disabled_rule_groups diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/azure_async_operation_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/azure_async_operation_result.py index f1daec4d317b..a84e42e01d2e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/azure_async_operation_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/azure_async_operation_result.py @@ -36,7 +36,7 @@ class AzureAsyncOperationResult(Model): 'error': {'key': 'error', 'type': 'Error'}, } - def __init__(self, status=None, error=None): - super(AzureAsyncOperationResult, self).__init__() - self.status = status - self.error = error + def __init__(self, **kwargs): + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/azure_async_operation_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/azure_async_operation_result_py3.py new file mode 100644 index 000000000000..efefd743cbf9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/azure_async_operation_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureAsyncOperationResult(Model): + """The response body contains the status of the specified asynchronous + operation, indicating whether it has succeeded, is in progress, or has + failed. Note that this status is distinct from the HTTP status code + returned for the Get Operation Status operation itself. If the asynchronous + operation succeeded, the response body includes the HTTP status code for + the successful request. If the asynchronous operation failed, the response + body includes the HTTP status code for the failed request and error + information regarding the failure. + + :param status: Status of the Azure async operation. Possible values are: + 'InProgress', 'Succeeded', and 'Failed'. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or + ~azure.mgmt.network.v2017_03_01.models.NetworkOperationStatus + :param error: + :type error: ~azure.mgmt.network.v2017_03_01.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, status=None, error=None, **kwargs) -> None: + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/backend_address_pool.py index 67f2ddd8888c..ff4d8df8b20b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/backend_address_pool.py @@ -59,11 +59,11 @@ class BackendAddressPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, provisioning_state=None, name=None, etag=None): - super(BackendAddressPool, self).__init__(id=id) + def __init__(self, **kwargs): + super(BackendAddressPool, self).__init__(**kwargs) self.backend_ip_configurations = None self.load_balancing_rules = None self.outbound_nat_rule = None - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/backend_address_pool_py3.py new file mode 100644 index 000000000000..b898748e3c96 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/backend_address_pool_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class BackendAddressPool(SubResource): + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar backend_ip_configurations: Gets collection of references to IP + addresses defined in network interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: Gets load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_03_01.models.SubResource] + :ivar outbound_nat_rule: Gets outbound rules that use this backend address + pool. + :vartype outbound_nat_rule: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param provisioning_state: Get provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configurations': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'outbound_nat_rule': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'outbound_nat_rule': {'key': 'properties.outboundNatRule', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(BackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = None + self.load_balancing_rules = None + self.outbound_nat_rule = None + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_community.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_community.py index a2162c1ecfec..fdb963cfc21f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_community.py @@ -35,9 +35,9 @@ class BGPCommunity(Model): 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, } - def __init__(self, service_supported_region=None, community_name=None, community_value=None, community_prefixes=None): - super(BGPCommunity, self).__init__() - self.service_supported_region = service_supported_region - self.community_name = community_name - self.community_value = community_value - self.community_prefixes = community_prefixes + def __init__(self, **kwargs): + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = kwargs.get('service_supported_region', None) + self.community_name = kwargs.get('community_name', None) + self.community_value = kwargs.get('community_value', None) + self.community_prefixes = kwargs.get('community_prefixes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_community_py3.py new file mode 100644 index 000000000000..da0a79772a08 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_community_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BGPCommunity(Model): + """Contains bgp community information offered in Service Community resources. + + :param service_supported_region: The region which the service support. + e.g. For O365, region is Global. + :type service_supported_region: str + :param community_name: The name of the bgp community. e.g. Skype. + :type community_name: str + :param community_value: The value of the bgp community. For more + information: + https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + :type community_value: str + :param community_prefixes: The prefixes that the bgp community contains. + :type community_prefixes: list[str] + """ + + _attribute_map = { + 'service_supported_region': {'key': 'serviceSupportedRegion', 'type': 'str'}, + 'community_name': {'key': 'communityName', 'type': 'str'}, + 'community_value': {'key': 'communityValue', 'type': 'str'}, + 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, + } + + def __init__(self, *, service_supported_region: str=None, community_name: str=None, community_value: str=None, community_prefixes=None, **kwargs) -> None: + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = service_supported_region + self.community_name = community_name + self.community_value = community_value + self.community_prefixes = community_prefixes diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status.py index 90375e1e2577..110a942d2f71 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status.py @@ -59,8 +59,8 @@ class BgpPeerStatus(Model): 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, } - def __init__(self): - super(BgpPeerStatus, self).__init__() + def __init__(self, **kwargs): + super(BgpPeerStatus, self).__init__(**kwargs) self.local_address = None self.neighbor = None self.asn = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status_list_result.py index 9309e21b7336..23bcfa7f0951 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status_list_result.py @@ -23,6 +23,6 @@ class BgpPeerStatusListResult(Model): 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, } - def __init__(self, value=None): - super(BgpPeerStatusListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status_list_result_py3.py new file mode 100644 index 000000000000..8ff52d968829 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatusListResult(Model): + """Response for list BGP peer status API service call. + + :param value: List of BGP peers + :type value: list[~azure.mgmt.network.v2017_03_01.models.BgpPeerStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status_py3.py new file mode 100644 index 000000000000..dff61913619a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_peer_status_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatus(Model): + """BGP peer status details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The virtual network gateway's local address + :vartype local_address: str + :ivar neighbor: The remote BGP peer + :vartype neighbor: str + :ivar asn: The autonomous system number of the remote BGP peer + :vartype asn: int + :ivar state: The BGP peer state. Possible values include: 'Unknown', + 'Stopped', 'Idle', 'Connecting', 'Connected' + :vartype state: str or ~azure.mgmt.network.v2017_03_01.models.BgpPeerState + :ivar connected_duration: For how long the peering has been up + :vartype connected_duration: str + :ivar routes_received: The number of routes learned from this peer + :vartype routes_received: long + :ivar messages_sent: The number of BGP messages sent + :vartype messages_sent: long + :ivar messages_received: The number of BGP messages received + :vartype messages_received: long + """ + + _validation = { + 'local_address': {'readonly': True}, + 'neighbor': {'readonly': True}, + 'asn': {'readonly': True}, + 'state': {'readonly': True}, + 'connected_duration': {'readonly': True}, + 'routes_received': {'readonly': True}, + 'messages_sent': {'readonly': True}, + 'messages_received': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'str'}, + 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, + 'routes_received': {'key': 'routesReceived', 'type': 'long'}, + 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, + 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(BgpPeerStatus, self).__init__(**kwargs) + self.local_address = None + self.neighbor = None + self.asn = None + self.state = None + self.connected_duration = None + self.routes_received = None + self.messages_sent = None + self.messages_received = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_service_community.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_service_community.py index af67f6ec8c12..7932f31ae5af 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_service_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_service_community.py @@ -50,7 +50,7 @@ class BgpServiceCommunity(Resource): 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, } - def __init__(self, id=None, location=None, tags=None, service_name=None, bgp_communities=None): - super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags) - self.service_name = service_name - self.bgp_communities = bgp_communities + def __init__(self, **kwargs): + super(BgpServiceCommunity, self).__init__(**kwargs) + self.service_name = kwargs.get('service_name', None) + self.bgp_communities = kwargs.get('bgp_communities', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_service_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_service_community_py3.py new file mode 100644 index 000000000000..2b825c54440a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_service_community_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BgpServiceCommunity(Resource): + """Service Community Properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param service_name: The name of the bgp community. e.g. Skype. + :type service_name: str + :param bgp_communities: Get a list of bgp communities. + :type bgp_communities: + list[~azure.mgmt.network.v2017_03_01.models.BGPCommunity] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, + 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, service_name: str=None, bgp_communities=None, **kwargs) -> None: + super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.service_name = service_name + self.bgp_communities = bgp_communities diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_settings.py index c5730da2e43e..e6e8d1b90aa6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_settings.py @@ -31,8 +31,8 @@ class BgpSettings(Model): 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, } - def __init__(self, asn=None, bgp_peering_address=None, peer_weight=None): - super(BgpSettings, self).__init__() - self.asn = asn - self.bgp_peering_address = bgp_peering_address - self.peer_weight = peer_weight + def __init__(self, **kwargs): + super(BgpSettings, self).__init__(**kwargs) + self.asn = kwargs.get('asn', None) + self.bgp_peering_address = kwargs.get('bgp_peering_address', None) + self.peer_weight = kwargs.get('peer_weight', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_settings_py3.py new file mode 100644 index 000000000000..cb3b3e6795f7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/bgp_settings_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpSettings(Model): + """BGP settings details. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of + this BGP speaker. + :type bgp_peering_address: str + :param peer_weight: The weight added to routes learned from this BGP + speaker. + :type peer_weight: int + """ + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, + } + + def __init__(self, *, asn: int=None, bgp_peering_address: str=None, peer_weight: int=None, **kwargs) -> None: + super(BgpSettings, self).__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + self.peer_weight = peer_weight diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_reset_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_reset_shared_key.py index 3338112a7fe7..1ade077795ed 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_reset_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_reset_shared_key.py @@ -15,8 +15,10 @@ class ConnectionResetSharedKey(Model): """The virtual network connection reset shared key. - :param key_length: The virtual network connection reset shared key length, - should between 1 and 128. + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. :type key_length: int """ @@ -28,6 +30,6 @@ class ConnectionResetSharedKey(Model): 'key_length': {'key': 'keyLength', 'type': 'int'}, } - def __init__(self, key_length): - super(ConnectionResetSharedKey, self).__init__() - self.key_length = key_length + def __init__(self, **kwargs): + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = kwargs.get('key_length', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_reset_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_reset_shared_key_py3.py new file mode 100644 index 000000000000..47326d4c2082 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_reset_shared_key_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionResetSharedKey(Model): + """The virtual network connection reset shared key. + + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. + :type key_length: int + """ + + _validation = { + 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, + } + + _attribute_map = { + 'key_length': {'key': 'keyLength', 'type': 'int'}, + } + + def __init__(self, *, key_length: int, **kwargs) -> None: + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = key_length diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_shared_key.py index 2c1b0ed9a914..742f1cb15126 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_shared_key.py @@ -15,7 +15,9 @@ class ConnectionSharedKey(Model): """Response for GetConnectionSharedKey API service call. - :param value: The virtual network connection shared key value. + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. :type value: str """ @@ -27,6 +29,6 @@ class ConnectionSharedKey(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, value): - super(ConnectionSharedKey, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_shared_key_py3.py new file mode 100644 index 000000000000..11b88da35e17 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connection_shared_key_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionSharedKey(Model): + """Response for GetConnectionSharedKey API service call. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, **kwargs) -> None: + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_destination.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_destination.py index cd0e8818b591..964c425a29d3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_destination.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_destination.py @@ -31,8 +31,8 @@ class ConnectivityDestination(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id=None, address=None, port=None): - super(ConnectivityDestination, self).__init__() - self.resource_id = resource_id - self.address = address - self.port = port + def __init__(self, **kwargs): + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_destination_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_destination_py3.py new file mode 100644 index 000000000000..c51619081ed6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_destination_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityDestination(Model): + """Parameters that define destination of connection. + + :param resource_id: The ID of the resource to which a connection attempt + will be made. + :type resource_id: str + :param address: The IP address or URI the resource to which a connection + attempt will be made. + :type address: str + :param port: Port on which check connectivity will be performed. + :type port: int + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str=None, address: str=None, port: int=None, **kwargs) -> None: + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_hop.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_hop.py index ddae3cd91008..26929ad61c1c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_hop.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_hop.py @@ -51,8 +51,8 @@ class ConnectivityHop(Model): 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, } - def __init__(self): - super(ConnectivityHop, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityHop, self).__init__(**kwargs) self.type = None self.id = None self.address = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_hop_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_hop_py3.py new file mode 100644 index 000000000000..04fbddfbd7c1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_hop_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityHop(Model): + """Information about a hop between the source and the destination. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the hop. + :vartype type: str + :ivar id: The ID of the hop. + :vartype id: str + :ivar address: The IP address of the hop. + :vartype address: str + :ivar resource_id: The ID of the resource corresponding to this hop. + :vartype resource_id: str + :ivar next_hop_ids: List of next hop identifiers. + :vartype next_hop_ids: list[str] + :ivar issues: List of issues. + :vartype issues: + list[~azure.mgmt.network.v2017_03_01.models.ConnectivityIssue] + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'address': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'next_hop_ids': {'readonly': True}, + 'issues': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'next_hop_ids': {'key': 'nextHopIds', 'type': '[str]'}, + 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityHop, self).__init__(**kwargs) + self.type = None + self.id = None + self.address = None + self.resource_id = None + self.next_hop_ids = None + self.issues = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_information.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_information.py index 8cdc0ff3f8c6..6968fb410f2e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_information.py @@ -57,8 +57,8 @@ class ConnectivityInformation(Model): 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, } - def __init__(self): - super(ConnectivityInformation, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityInformation, self).__init__(**kwargs) self.hops = None self.connection_status = None self.avg_latency_in_ms = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_information_py3.py new file mode 100644 index 000000000000..5c08ce7177fa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_information_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityInformation(Model): + """Information on the connectivity status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar hops: List of hops between the source and the destination. + :vartype hops: + list[~azure.mgmt.network.v2017_03_01.models.ConnectivityHop] + :ivar connection_status: The connection status. Possible values include: + 'Unknown', 'Connected', 'Disconnected', 'Degraded' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_03_01.models.ConnectionStatus + :ivar avg_latency_in_ms: Average latency in milliseconds. + :vartype avg_latency_in_ms: int + :ivar min_latency_in_ms: Minimum latency in milliseconds. + :vartype min_latency_in_ms: int + :ivar max_latency_in_ms: Maximum latency in milliseconds. + :vartype max_latency_in_ms: int + :ivar probes_sent: Total number of probes sent. + :vartype probes_sent: int + :ivar probes_failed: Number of failed probes. + :vartype probes_failed: int + """ + + _validation = { + 'hops': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'avg_latency_in_ms': {'readonly': True}, + 'min_latency_in_ms': {'readonly': True}, + 'max_latency_in_ms': {'readonly': True}, + 'probes_sent': {'readonly': True}, + 'probes_failed': {'readonly': True}, + } + + _attribute_map = { + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, + 'probes_sent': {'key': 'probesSent', 'type': 'int'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityInformation, self).__init__(**kwargs) + self.hops = None + self.connection_status = None + self.avg_latency_in_ms = None + self.min_latency_in_ms = None + self.max_latency_in_ms = None + self.probes_sent = None + self.probes_failed = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_issue.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_issue.py index 182a4701a5f8..44585d7fdd1f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_issue.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_issue.py @@ -47,8 +47,8 @@ class ConnectivityIssue(Model): 'context': {'key': 'context', 'type': '[{str}]'}, } - def __init__(self): - super(ConnectivityIssue, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityIssue, self).__init__(**kwargs) self.origin = None self.severity = None self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_issue_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_issue_py3.py new file mode 100644 index 000000000000..5dab28f1adb9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_issue_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityIssue(Model): + """Information about an issue encountered in the process of checking for + connectivity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar origin: The origin of the issue. Possible values include: 'Local', + 'Inbound', 'Outbound' + :vartype origin: str or ~azure.mgmt.network.v2017_03_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: + 'Error', 'Warning' + :vartype severity: str or ~azure.mgmt.network.v2017_03_01.models.Severity + :ivar type: The type of issue. Possible values include: 'Unknown', + 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', + 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform' + :vartype type: str or ~azure.mgmt.network.v2017_03_01.models.IssueType + :ivar context: Provides additional context on the issue. + :vartype context: list[dict[str, str]] + """ + + _validation = { + 'origin': {'readonly': True}, + 'severity': {'readonly': True}, + 'type': {'readonly': True}, + 'context': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'context': {'key': 'context', 'type': '[{str}]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityIssue, self).__init__(**kwargs) + self.origin = None + self.severity = None + self.type = None + self.context = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_parameters.py index 608a58b1a213..ad7cb9f37b84 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_parameters.py @@ -15,9 +15,11 @@ class ConnectivityParameters(Model): """Parameters that determine how the connectivity check will be performed. - :param source: + All required parameters must be populated in order to send to Azure. + + :param source: Required. :type source: ~azure.mgmt.network.v2017_03_01.models.ConnectivitySource - :param destination: + :param destination: Required. :type destination: ~azure.mgmt.network.v2017_03_01.models.ConnectivityDestination """ @@ -32,7 +34,7 @@ class ConnectivityParameters(Model): 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, } - def __init__(self, source, destination): - super(ConnectivityParameters, self).__init__() - self.source = source - self.destination = destination + def __init__(self, **kwargs): + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_parameters_py3.py new file mode 100644 index 000000000000..9a31c69af064 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_parameters_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityParameters(Model): + """Parameters that determine how the connectivity check will be performed. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. + :type source: ~azure.mgmt.network.v2017_03_01.models.ConnectivitySource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2017_03_01.models.ConnectivityDestination + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectivitySource'}, + 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, + } + + def __init__(self, *, source, destination, **kwargs) -> None: + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = source + self.destination = destination diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_source.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_source.py index c42bfc0aa09d..3fd82793f8d7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_source.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_source.py @@ -15,8 +15,10 @@ class ConnectivitySource(Model): """Parameters that define the source of the connection. - :param resource_id: The ID of the resource from which a connectivity check - will be initiated. + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. :type resource_id: str :param port: The source port from which a connectivity check will be performed. @@ -32,7 +34,7 @@ class ConnectivitySource(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id, port=None): - super(ConnectivitySource, self).__init__() - self.resource_id = resource_id - self.port = port + def __init__(self, **kwargs): + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_source_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_source_py3.py new file mode 100644 index 000000000000..f7833d1bef76 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/connectivity_source_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivitySource(Model): + """Parameters that define the source of the connection. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. + :type resource_id: str + :param port: The source port from which a connectivity check will be + performed. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str, port: int=None, **kwargs) -> None: + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = resource_id + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dhcp_options.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dhcp_options.py index 8744ba6fc9b1..93b68a7f037c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dhcp_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dhcp_options.py @@ -25,6 +25,6 @@ class DhcpOptions(Model): 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, } - def __init__(self, dns_servers=None): - super(DhcpOptions, self).__init__() - self.dns_servers = dns_servers + def __init__(self, **kwargs): + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dhcp_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dhcp_options_py3.py new file mode 100644 index 000000000000..7dc4651973a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dhcp_options_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DhcpOptions(Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in + the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + options. + + :param dns_servers: The list of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = dns_servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dns_name_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dns_name_availability_result.py index 15a0238e49a7..86ba19eb407b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dns_name_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dns_name_availability_result.py @@ -23,6 +23,6 @@ class DnsNameAvailabilityResult(Model): 'available': {'key': 'available', 'type': 'bool'}, } - def __init__(self, available=None): - super(DnsNameAvailabilityResult, self).__init__() - self.available = available + def __init__(self, **kwargs): + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dns_name_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dns_name_availability_result_py3.py new file mode 100644 index 000000000000..de0117c27715 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/dns_name_availability_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DnsNameAvailabilityResult(Model): + """Response for the CheckDnsNameAvailability API service call. + + :param available: Domain availability (True/False). + :type available: bool + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + } + + def __init__(self, *, available: bool=None, **kwargs) -> None: + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = available diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group.py index 197e9ca5ccc3..25a86a7e31b0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group.py @@ -33,8 +33,8 @@ class EffectiveNetworkSecurityGroup(Model): 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, } - def __init__(self, network_security_group=None, association=None, effective_security_rules=None): - super(EffectiveNetworkSecurityGroup, self).__init__() - self.network_security_group = network_security_group - self.association = association - self.effective_security_rules = effective_security_rules + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = kwargs.get('network_security_group', None) + self.association = kwargs.get('association', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_association.py index 6bd37771bbfd..180d8c185065 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_association.py @@ -27,7 +27,7 @@ class EffectiveNetworkSecurityGroupAssociation(Model): 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, } - def __init__(self, subnet=None, network_interface=None): - super(EffectiveNetworkSecurityGroupAssociation, self).__init__() - self.subnet = subnet - self.network_interface = network_interface + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.network_interface = kwargs.get('network_interface', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_association_py3.py new file mode 100644 index 000000000000..eff055bd46e9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_association_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupAssociation(Model): + """The effective network security group association. + + :param subnet: The ID of the subnet if assigned. + :type subnet: ~azure.mgmt.network.v2017_03_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: + ~azure.mgmt.network.v2017_03_01.models.SubResource + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, + } + + def __init__(self, *, subnet=None, network_interface=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = subnet + self.network_interface = network_interface diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_list_result.py index c6571aea3afa..23d6b71ae96d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_list_result.py @@ -27,7 +27,7 @@ class EffectiveNetworkSecurityGroupListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(EffectiveNetworkSecurityGroupListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_list_result_py3.py new file mode 100644 index 000000000000..689dc9b66d45 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_list_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupListResult(Model): + """Response for list effective network security groups API service call. + + :param value: A list of effective network security groups. + :type value: + list[~azure.mgmt.network.v2017_03_01.models.EffectiveNetworkSecurityGroup] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_py3.py new file mode 100644 index 000000000000..c7a80106d91e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_group_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroup(Model): + """Effective network security group. + + :param network_security_group: The ID of network security group that is + applied. + :type network_security_group: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param association: + :type association: + ~azure.mgmt.network.v2017_03_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2017_03_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, + 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__(self, *, network_security_group=None, association=None, effective_security_rules=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = network_security_group + self.association = association + self.effective_security_rules = effective_security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_rule.py index d9cdffa1a4a1..2f9af592d849 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_rule.py @@ -62,16 +62,16 @@ class EffectiveNetworkSecurityRule(Model): 'direction': {'key': 'direction', 'type': 'str'}, } - def __init__(self, name=None, protocol=None, source_port_range=None, destination_port_range=None, source_address_prefix=None, destination_address_prefix=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority=None, direction=None): - super(EffectiveNetworkSecurityRule, self).__init__() - self.name = name - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_address_prefix = source_address_prefix - self.destination_address_prefix = destination_address_prefix - self.expanded_source_address_prefix = expanded_source_address_prefix - self.expanded_destination_address_prefix = expanded_destination_address_prefix - self.access = access - self.priority = priority - self.direction = direction + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.expanded_source_address_prefix = kwargs.get('expanded_source_address_prefix', None) + self.expanded_destination_address_prefix = kwargs.get('expanded_destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_rule_py3.py new file mode 100644 index 000000000000..89f70f44b081 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_network_security_rule_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityRule(Model): + """Effective network security rules. + + :param name: The name of the security rule specified by the user (if + created by the user). + :type name: str + :param protocol: The network protocol this rule applies to. Possible + values are: 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2017_03_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. + :type source_port_range: str + :param destination_port_range: The destination port or range. + :type destination_port_range: str + :param source_address_prefix: The source address prefix. + :type source_address_prefix: str + :param destination_address_prefix: The destination address prefix. + :type destination_address_prefix: str + :param expanded_source_address_prefix: The expanded source address prefix. + :type expanded_source_address_prefix: list[str] + :param expanded_destination_address_prefix: Expanded destination address + prefix. + :type expanded_destination_address_prefix: list[str] + :param access: Whether network traffic is allowed or denied. Possible + values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or + ~azure.mgmt.network.v2017_03_01.models.SecurityRuleAccess + :param priority: The priority of the rule. + :type priority: int + :param direction: The direction of the rule. Possible values are: 'Inbound + and Outbound'. Possible values include: 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2017_03_01.models.SecurityRuleDirection + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, + 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, + 'access': {'key': 'access', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, protocol=None, source_port_range: str=None, destination_port_range: str=None, source_address_prefix: str=None, destination_address_prefix: str=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority: int=None, direction=None, **kwargs) -> None: + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = name + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.expanded_source_address_prefix = expanded_source_address_prefix + self.expanded_destination_address_prefix = expanded_destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route.py index ac9961730be9..f8de4c21bdba 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route.py @@ -50,11 +50,11 @@ class EffectiveRoute(Model): 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, } - def __init__(self, name=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None): - super(EffectiveRoute, self).__init__() - self.name = name - self.source = source - self.state = state - self.address_prefix = address_prefix - self.next_hop_ip_address = next_hop_ip_address - self.next_hop_type = next_hop_type + def __init__(self, **kwargs): + super(EffectiveRoute, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.next_hop_type = kwargs.get('next_hop_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route_list_result.py index 19fc276c68de..3227ae611457 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route_list_result.py @@ -26,7 +26,7 @@ class EffectiveRouteListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(EffectiveRouteListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route_list_result_py3.py new file mode 100644 index 000000000000..ef0b0d70843a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route_list_result_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRouteListResult(Model): + """Response for list effective route API service call. + + :param value: A list of effective routes. + :type value: list[~azure.mgmt.network.v2017_03_01.models.EffectiveRoute] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route_py3.py new file mode 100644 index 000000000000..c8c1273b4520 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRoute(Model): + """Effective Route. + + :param name: The name of the user defined route. This is optional. + :type name: str + :param source: Who created the route. Possible values are: 'Unknown', + 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: + 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' + :type source: str or + ~azure.mgmt.network.v2017_03_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values are: 'Active' + and 'Invalid'. Possible values include: 'Active', 'Invalid' + :type state: str or + ~azure.mgmt.network.v2017_03_01.models.EffectiveRouteState + :param address_prefix: The address prefixes of the effective routes in + CIDR notation. + :type address_prefix: list[str] + :param next_hop_ip_address: The IP address of the next hop of the + effective route. + :type next_hop_ip_address: list[str] + :param next_hop_type: The type of Azure hop the packet should be sent to. + Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_03_01.models.RouteNextHopType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None, **kwargs) -> None: + super(EffectiveRoute, self).__init__(**kwargs) + self.name = name + self.source = source + self.state = state + self.address_prefix = address_prefix + self.next_hop_ip_address = next_hop_ip_address + self.next_hop_type = next_hop_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error.py index a8cfeb4db72d..d8ea3eba7930 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error.py @@ -35,10 +35,10 @@ class Error(Model): 'inner_error': {'key': 'innerError', 'type': 'str'}, } - def __init__(self, code=None, message=None, target=None, details=None, inner_error=None): - super(Error, self).__init__() - self.code = code - self.message = message - self.target = target - self.details = details - self.inner_error = inner_error + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error_details.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error_details.py index 40bea00aa2fb..a8c4da6ba955 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error_details.py @@ -29,8 +29,8 @@ class ErrorDetails(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ErrorDetails, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error_details_py3.py new file mode 100644 index 000000000000..d791f0895345 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error_details_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """ErrorDetails. + + :param code: + :type code: str + :param target: + :type target: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error_py3.py new file mode 100644 index 000000000000..06d1bdc5bcff --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(Model): + """Error. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.network.v2017_03_01.models.ErrorDetails] + :param inner_error: + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, inner_error: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit.py index 0f869f8cfe1d..99aefe3b0fd7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit.py @@ -91,17 +91,17 @@ class ExpressRouteCircuit(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, allow_classic_operations=None, circuit_provisioning_state=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key=None, service_provider_notes=None, service_provider_properties=None, provisioning_state=None, gateway_manager_etag=None): - super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.allow_classic_operations = allow_classic_operations - self.circuit_provisioning_state = circuit_provisioning_state - self.service_provider_provisioning_state = service_provider_provisioning_state - self.authorizations = authorizations - self.peerings = peerings - self.service_key = service_key - self.service_provider_notes = service_provider_notes - self.service_provider_properties = service_provider_properties - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag + def __init__(self, **kwargs): + super(ExpressRouteCircuit, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.allow_classic_operations = kwargs.get('allow_classic_operations', None) + self.circuit_provisioning_state = kwargs.get('circuit_provisioning_state', None) + self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) + self.authorizations = kwargs.get('authorizations', None) + self.peerings = kwargs.get('peerings', None) + self.service_key = kwargs.get('service_key', None) + self.service_provider_notes = kwargs.get('service_provider_notes', None) + self.service_provider_properties = kwargs.get('service_provider_properties', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_arp_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_arp_table.py index ace325747ee5..826796619769 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_arp_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_arp_table.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitArpTable(Model): 'mac_address': {'key': 'macAddress', 'type': 'str'}, } - def __init__(self, age=None, interface=None, ip_address=None, mac_address=None): - super(ExpressRouteCircuitArpTable, self).__init__() - self.age = age - self.interface = interface - self.ip_address = ip_address - self.mac_address = mac_address + def __init__(self, **kwargs): + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = kwargs.get('age', None) + self.interface = kwargs.get('interface', None) + self.ip_address = kwargs.get('ip_address', None) + self.mac_address = kwargs.get('mac_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_arp_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_arp_table_py3.py new file mode 100644 index 000000000000..4401108c6001 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_arp_table_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitArpTable(Model): + """The ARP table associated with the ExpressRouteCircuit. + + :param age: Age + :type age: int + :param interface: Interface + :type interface: str + :param ip_address: The IP address. + :type ip_address: str + :param mac_address: The MAC address. + :type mac_address: str + """ + + _attribute_map = { + 'age': {'key': 'age', 'type': 'int'}, + 'interface': {'key': 'interface', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, *, age: int=None, interface: str=None, ip_address: str=None, mac_address: str=None, **kwargs) -> None: + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = age + self.interface = interface + self.ip_address = ip_address + self.mac_address = mac_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_authorization.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_authorization.py index 2108ac42639c..1603dda4f6e1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_authorization.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_authorization.py @@ -51,10 +51,10 @@ class ExpressRouteCircuitAuthorization(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, authorization_key=None, authorization_use_status=None, provisioning_state=None, name=None): - super(ExpressRouteCircuitAuthorization, self).__init__(id=id) - self.authorization_key = authorization_key - self.authorization_use_status = authorization_use_status - self.provisioning_state = provisioning_state - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitAuthorization, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.authorization_use_status = kwargs.get('authorization_use_status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_authorization_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_authorization_py3.py new file mode 100644 index 000000000000..87e4d0fb86af --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_authorization_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param authorization_use_status: AuthorizationUseStatus. Possible values + are: 'Available' and 'InUse'. Possible values include: 'Available', + 'InUse' + :type authorization_use_status: str or + ~azure.mgmt.network.v2017_03_01.models.AuthorizationUseStatus + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, authorization_key: str=None, authorization_use_status=None, provisioning_state: str=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitAuthorization, self).__init__(id=id, **kwargs) + self.authorization_key = authorization_key + self.authorization_use_status = authorization_use_status + self.provisioning_state = provisioning_state + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering.py index 746abac74771..4ccfcff9cd88 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering.py @@ -100,24 +100,24 @@ class ExpressRouteCircuitPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, peering_type=None, state=None, azure_asn=None, peer_asn=None, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, primary_azure_port=None, secondary_azure_port=None, shared_key=None, vlan_id=None, microsoft_peering_config=None, stats=None, provisioning_state=None, gateway_manager_etag=None, last_modified_by=None, route_filter=None, ipv6_peering_config=None, name=None): - super(ExpressRouteCircuitPeering, self).__init__(id=id) - self.peering_type = peering_type - self.state = state - self.azure_asn = azure_asn - self.peer_asn = peer_asn - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.primary_azure_port = primary_azure_port - self.secondary_azure_port = secondary_azure_port - self.shared_key = shared_key - self.vlan_id = vlan_id - self.microsoft_peering_config = microsoft_peering_config - self.stats = stats - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag - self.last_modified_by = last_modified_by - self.route_filter = route_filter - self.ipv6_peering_config = ipv6_peering_config - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeering, self).__init__(**kwargs) + self.peering_type = kwargs.get('peering_type', None) + self.state = kwargs.get('state', None) + self.azure_asn = kwargs.get('azure_asn', None) + self.peer_asn = kwargs.get('peer_asn', None) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.primary_azure_port = kwargs.get('primary_azure_port', None) + self.secondary_azure_port = kwargs.get('secondary_azure_port', None) + self.shared_key = kwargs.get('shared_key', None) + self.vlan_id = kwargs.get('vlan_id', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.stats = kwargs.get('stats', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.route_filter = kwargs.get('route_filter', None) + self.ipv6_peering_config = kwargs.get('ipv6_peering_config', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering_config.py index 919ec6fac9ea..6894b50afc81 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering_config.py @@ -38,9 +38,9 @@ class ExpressRouteCircuitPeeringConfig(Model): 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, } - def __init__(self, advertised_public_prefixes=None, advertised_public_prefixes_state=None, customer_asn=None, routing_registry_name=None): - super(ExpressRouteCircuitPeeringConfig, self).__init__() - self.advertised_public_prefixes = advertised_public_prefixes - self.advertised_public_prefixes_state = advertised_public_prefixes_state - self.customer_asn = customer_asn - self.routing_registry_name = routing_registry_name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = kwargs.get('advertised_public_prefixes', None) + self.advertised_public_prefixes_state = kwargs.get('advertised_public_prefixes_state', None) + self.customer_asn = kwargs.get('customer_asn', None) + self.routing_registry_name = kwargs.get('routing_registry_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..6729fcad2421 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering_config_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitPeeringConfig(Model): + """Specifies the peering configuration. + + :param advertised_public_prefixes: The reference of + AdvertisedPublicPrefixes. + :type advertised_public_prefixes: list[str] + :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of + the Peering resource. Possible values are 'NotConfigured', 'Configuring', + 'Configured', and 'ValidationNeeded'. Possible values include: + 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' + :type advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :param customer_asn: The CustomerASN of the peering. + :type customer_asn: int + :param routing_registry_name: The RoutingRegistryName of the + configuration. + :type routing_registry_name: str + """ + + _attribute_map = { + 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, + 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, + 'customer_asn': {'key': 'customerASN', 'type': 'int'}, + 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, + } + + def __init__(self, *, advertised_public_prefixes=None, advertised_public_prefixes_state=None, customer_asn: int=None, routing_registry_name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = advertised_public_prefixes + self.advertised_public_prefixes_state = advertised_public_prefixes_state + self.customer_asn = customer_asn + self.routing_registry_name = routing_registry_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering_py3.py new file mode 100644 index 000000000000..1fb63f53f362 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_peering_py3.py @@ -0,0 +1,123 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitPeering(SubResource): + """Peering in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param peering_type: The PeeringType. Possible values are: + 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. + Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + 'MicrosoftPeering' + :type peering_type: str or + ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeeringType + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeeringState + :param azure_asn: The Azure ASN. + :type azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: int + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param primary_azure_port: The primary port. + :type primary_azure_port: str + :param secondary_azure_port: The secondary port. + :type secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeeringConfig + :param stats: Gets peering stats. + :type stats: + ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitStats + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :param last_modified_by: Gets whether the provider or the customer last + modified the peering. + :type last_modified_by: str + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2017_03_01.models.RouteFilter + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2017_03_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'int'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'route_filter': {'key': 'properties.routeFilter', 'type': 'RouteFilter'}, + 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, peering_type=None, state=None, azure_asn: int=None, peer_asn: int=None, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, primary_azure_port: str=None, secondary_azure_port: str=None, shared_key: str=None, vlan_id: int=None, microsoft_peering_config=None, stats=None, provisioning_state: str=None, gateway_manager_etag: str=None, last_modified_by: str=None, route_filter=None, ipv6_peering_config=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeering, self).__init__(id=id, **kwargs) + self.peering_type = peering_type + self.state = state + self.azure_asn = azure_asn + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = primary_azure_port + self.secondary_azure_port = secondary_azure_port + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.stats = stats + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.last_modified_by = last_modified_by + self.route_filter = route_filter + self.ipv6_peering_config = ipv6_peering_config + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_py3.py new file mode 100644 index 000000000000..525efef60c18 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteCircuit(Resource): + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The SKU. + :type sku: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitSku + :param allow_classic_operations: Allow classic operations + :type allow_classic_operations: bool + :param circuit_provisioning_state: The CircuitProvisioningState state of + the resource. + :type circuit_provisioning_state: str + :param service_provider_provisioning_state: The + ServiceProviderProvisioningState state of the resource. Possible values + are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + 'Deprovisioning' + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2017_03_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: + list[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeering] + :param service_key: The ServiceKey. + :type service_key: str + :param service_provider_notes: The ServiceProviderNotes. + :type service_provider_notes: str + :param service_provider_properties: The ServiceProviderProperties. + :type service_provider_properties: + ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitServiceProviderProperties + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, + 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, + 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, allow_classic_operations: bool=None, circuit_provisioning_state: str=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key: str=None, service_provider_notes: str=None, service_provider_properties=None, provisioning_state: str=None, gateway_manager_etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.allow_classic_operations = allow_classic_operations + self.circuit_provisioning_state = circuit_provisioning_state + self.service_provider_provisioning_state = service_provider_provisioning_state + self.authorizations = authorizations + self.peerings = peerings + self.service_key = service_key + self.service_provider_notes = service_provider_notes + self.service_provider_properties = service_provider_properties + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table.py index 804d29a2f9bb..7517e9867cfb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table.py @@ -35,10 +35,10 @@ class ExpressRouteCircuitRoutesTable(Model): 'path': {'key': 'path', 'type': 'str'}, } - def __init__(self, network=None, next_hop=None, loc_prf=None, weight=None, path=None): - super(ExpressRouteCircuitRoutesTable, self).__init__() - self.network = network - self.next_hop = next_hop - self.loc_prf = loc_prf - self.weight = weight - self.path = path + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = kwargs.get('network', None) + self.next_hop = kwargs.get('next_hop', None) + self.loc_prf = kwargs.get('loc_prf', None) + self.weight = kwargs.get('weight', None) + self.path = kwargs.get('path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table_py3.py new file mode 100644 index 000000000000..38ea85cf642d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTable(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param network: network + :type network: str + :param next_hop: nextHop + :type next_hop: str + :param loc_prf: locPrf + :type loc_prf: str + :param weight: weight. + :type weight: int + :param path: path + :type path: str + """ + + _attribute_map = { + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'loc_prf': {'key': 'locPrf', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, *, network: str=None, next_hop: str=None, loc_prf: str=None, weight: int=None, path: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = network + self.next_hop = next_hop + self.loc_prf = loc_prf + self.weight = weight + self.path = path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table_summary.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table_summary.py index 6f5f89764dd4..577c3c2edd45 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table_summary.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table_summary.py @@ -37,10 +37,10 @@ class ExpressRouteCircuitRoutesTableSummary(Model): 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, } - def __init__(self, neighbor=None, v=None, as_property=None, up_down=None, state_pfx_rcd=None): - super(ExpressRouteCircuitRoutesTableSummary, self).__init__() - self.neighbor = neighbor - self.v = v - self.as_property = as_property - self.up_down = up_down - self.state_pfx_rcd = state_pfx_rcd + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = kwargs.get('neighbor', None) + self.v = kwargs.get('v', None) + self.as_property = kwargs.get('as_property', None) + self.up_down = kwargs.get('up_down', None) + self.state_pfx_rcd = kwargs.get('state_pfx_rcd', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table_summary_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table_summary_py3.py new file mode 100644 index 000000000000..e18d0051d218 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_routes_table_summary_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTableSummary(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: Neighbor + :type neighbor: str + :param v: BGP version number spoken to the neighbor. + :type v: int + :param as_property: Autonomous system number. + :type as_property: int + :param up_down: The length of time that the BGP session has been in the + Established state, or the current status if not in the Established state. + :type up_down: str + :param state_pfx_rcd: Current state of the BGP session, and the number of + prefixes that have been received from a neighbor or peer group. + :type state_pfx_rcd: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'v': {'key': 'v', 'type': 'int'}, + 'as_property': {'key': 'as', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, + } + + def __init__(self, *, neighbor: str=None, v: int=None, as_property: int=None, up_down: str=None, state_pfx_rcd: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = neighbor + self.v = v + self.as_property = as_property + self.up_down = up_down + self.state_pfx_rcd = state_pfx_rcd diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_service_provider_properties.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_service_provider_properties.py index 7a6b4ba96061..c51e6d8d653b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_service_provider_properties.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_service_provider_properties.py @@ -29,8 +29,8 @@ class ExpressRouteCircuitServiceProviderProperties(Model): 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, } - def __init__(self, service_provider_name=None, peering_location=None, bandwidth_in_mbps=None): - super(ExpressRouteCircuitServiceProviderProperties, self).__init__() - self.service_provider_name = service_provider_name - self.peering_location = peering_location - self.bandwidth_in_mbps = bandwidth_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = kwargs.get('service_provider_name', None) + self.peering_location = kwargs.get('peering_location', None) + self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_service_provider_properties_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_service_provider_properties_py3.py new file mode 100644 index 000000000000..ea701a54c3fe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_service_provider_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitServiceProviderProperties(Model): + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :param service_provider_name: The serviceProviderName. + :type service_provider_name: str + :param peering_location: The peering location. + :type peering_location: str + :param bandwidth_in_mbps: The BandwidthInMbps. + :type bandwidth_in_mbps: int + """ + + _attribute_map = { + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + } + + def __init__(self, *, service_provider_name: str=None, peering_location: str=None, bandwidth_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = service_provider_name + self.peering_location = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_sku.py index 75ca393cc759..e1f1314d6428 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_sku.py @@ -33,8 +33,8 @@ class ExpressRouteCircuitSku(Model): 'family': {'key': 'family', 'type': 'str'}, } - def __init__(self, name=None, tier=None, family=None): - super(ExpressRouteCircuitSku, self).__init__() - self.name = name - self.tier = tier - self.family = family + def __init__(self, **kwargs): + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.family = kwargs.get('family', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_sku_py3.py new file mode 100644 index 000000000000..a33a5f9cafd8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_sku_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitSku(Model): + """Contains SKU in an ExpressRouteCircuit. + + :param name: The name of the SKU. + :type name: str + :param tier: The tier of the SKU. Possible values are 'Standard' and + 'Premium'. Possible values include: 'Standard', 'Premium' + :type tier: str or + ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values are: 'UnlimitedData' + and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' + :type family: str or + ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, tier=None, family=None, **kwargs) -> None: + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.family = family diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_stats.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_stats.py index e26f6f7d2f74..41c45ae2b19a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_stats.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_stats.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitStats(Model): 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, } - def __init__(self, primarybytes_in=None, primarybytes_out=None, secondarybytes_in=None, secondarybytes_out=None): - super(ExpressRouteCircuitStats, self).__init__() - self.primarybytes_in = primarybytes_in - self.primarybytes_out = primarybytes_out - self.secondarybytes_in = secondarybytes_in - self.secondarybytes_out = secondarybytes_out + def __init__(self, **kwargs): + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = kwargs.get('primarybytes_in', None) + self.primarybytes_out = kwargs.get('primarybytes_out', None) + self.secondarybytes_in = kwargs.get('secondarybytes_in', None) + self.secondarybytes_out = kwargs.get('secondarybytes_out', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_stats_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_stats_py3.py new file mode 100644 index 000000000000..f78335343544 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuit_stats_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitStats(Model): + """Contains stats associated with the peering. + + :param primarybytes_in: Gets BytesIn of the peering. + :type primarybytes_in: long + :param primarybytes_out: Gets BytesOut of the peering. + :type primarybytes_out: long + :param secondarybytes_in: Gets BytesIn of the peering. + :type secondarybytes_in: long + :param secondarybytes_out: Gets BytesOut of the peering. + :type secondarybytes_out: long + """ + + _attribute_map = { + 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, + 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, + 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, + 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, + } + + def __init__(self, *, primarybytes_in: int=None, primarybytes_out: int=None, secondarybytes_in: int=None, secondarybytes_out: int=None, **kwargs) -> None: + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = primarybytes_in + self.primarybytes_out = primarybytes_out + self.secondarybytes_in = secondarybytes_in + self.secondarybytes_out = secondarybytes_out diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_arp_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_arp_table_list_result.py index 6957b4be6567..8a2f6b5e4956 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_arp_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_arp_table_list_result.py @@ -27,7 +27,7 @@ class ExpressRouteCircuitsArpTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsArpTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_arp_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_arp_table_list_result_py3.py new file mode 100644 index 000000000000..d4f6f5533174 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_arp_table_list_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsArpTableListResult(Model): + """Response for ListArpTable associated with the Express Route Circuits API. + + :param value: Gets list of the ARP table. + :type value: + list[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitArpTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_list_result.py index 4758a6003be9..691ce2e852bc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_list_result_py3.py new file mode 100644 index 000000000000..dba82f1eecd8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: The list of routes table. + :type value: + list[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitRoutesTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_summary_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_summary_list_result.py index 3cc31a245073..99ab5183fc3c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_summary_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_summary_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_summary_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_summary_list_result_py3.py new file mode 100644 index 000000000000..1584d4f5ad4c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_circuits_routes_table_summary_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: A list of the routes table. + :type value: + list[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitRoutesTableSummary] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider.py index be20fd7fd4c6..9bfc54c8cb84 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider.py @@ -53,8 +53,8 @@ class ExpressRouteServiceProvider(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state=None): - super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags) - self.peering_locations = peering_locations - self.bandwidths_offered = bandwidths_offered - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ExpressRouteServiceProvider, self).__init__(**kwargs) + self.peering_locations = kwargs.get('peering_locations', None) + self.bandwidths_offered = kwargs.get('bandwidths_offered', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider_bandwidths_offered.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider_bandwidths_offered.py index 9cbba2fcfe97..b27622af42d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider_bandwidths_offered.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider_bandwidths_offered.py @@ -26,7 +26,7 @@ class ExpressRouteServiceProviderBandwidthsOffered(Model): 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, } - def __init__(self, offer_name=None, value_in_mbps=None): - super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__() - self.offer_name = offer_name - self.value_in_mbps = value_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = kwargs.get('offer_name', None) + self.value_in_mbps = kwargs.get('value_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider_bandwidths_offered_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider_bandwidths_offered_py3.py new file mode 100644 index 000000000000..88516a0dfcf8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider_bandwidths_offered_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteServiceProviderBandwidthsOffered(Model): + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :param offer_name: The OfferName. + :type offer_name: str + :param value_in_mbps: The ValueInMbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__(self, *, offer_name: str=None, value_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = offer_name + self.value_in_mbps = value_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider_py3.py new file mode 100644 index 000000000000..03aa784c2abc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/express_route_service_provider_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param peering_locations: Get a list of peering locations. + :type peering_locations: list[str] + :param bandwidths_offered: Gets bandwidths offered. + :type bandwidths_offered: + list[~azure.mgmt.network.v2017_03_01.models.ExpressRouteServiceProviderBandwidthsOffered] + :param provisioning_state: Gets the provisioning state of the resource. + :type provisioning_state: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, + 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state: str=None, **kwargs) -> None: + super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.peering_locations = peering_locations + self.bandwidths_offered = bandwidths_offered + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_information.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_information.py index 803f3ebc457e..bcad9d555170 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_information.py @@ -15,13 +15,15 @@ class FlowLogInformation(Model): """Information on the configuration of flow log. - :param target_resource_id: The ID of the resource to configure for flow - logging. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. :type target_resource_id: str - :param storage_id: ID of the storage account which is used to store the - flow log. + :param storage_id: Required. ID of the storage account which is used to + store the flow log. :type storage_id: str - :param enabled: Flag to enable/disable flow logging. + :param enabled: Required. Flag to enable/disable flow logging. :type enabled: bool :param retention_policy: :type retention_policy: @@ -41,9 +43,9 @@ class FlowLogInformation(Model): 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, } - def __init__(self, target_resource_id, storage_id, enabled, retention_policy=None): - super(FlowLogInformation, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.enabled = enabled - self.retention_policy = retention_policy + def __init__(self, **kwargs): + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.enabled = kwargs.get('enabled', None) + self.retention_policy = kwargs.get('retention_policy', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_information_py3.py new file mode 100644 index 000000000000..d1505c3918a1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_information_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogInformation(Model): + """Information on the configuration of flow log. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. + :type target_resource_id: str + :param storage_id: Required. ID of the storage account which is used to + store the flow log. + :type storage_id: str + :param enabled: Required. Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: + :type retention_policy: + ~azure.mgmt.network.v2017_03_01.models.RetentionPolicyParameters + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, enabled: bool, retention_policy=None, **kwargs) -> None: + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.enabled = enabled + self.retention_policy = retention_policy diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_status_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_status_parameters.py index 4cd22222bb45..5a48e938f2d6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_status_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_status_parameters.py @@ -15,8 +15,10 @@ class FlowLogStatusParameters(Model): """Parameters that define a resource to query flow log status. - :param target_resource_id: The target resource where getting the flow - logging status. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class FlowLogStatusParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(FlowLogStatusParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_status_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_status_parameters_py3.py new file mode 100644 index 000000000000..0768d2495150 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_status_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogStatusParameters(Model): + """Parameters that define a resource to query flow log status. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/frontend_ip_configuration.py index 587df32c0249..ade6eea4e620 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/frontend_ip_configuration.py @@ -81,16 +81,16 @@ class FrontendIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(FrontendIPConfiguration, self).__init__(id=id) + def __init__(self, **kwargs): + super(FrontendIPConfiguration, self).__init__(**kwargs) self.inbound_nat_rules = None self.inbound_nat_pools = None self.outbound_nat_rules = None self.load_balancing_rules = None - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..e90c1098639e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/frontend_ip_configuration_py3.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class FrontendIPConfiguration(SubResource): + """Frontend IP address of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar inbound_nat_rules: Read only. Inbound rules URIs that use this + frontend IP. + :vartype inbound_nat_rules: + list[~azure.mgmt.network.v2017_03_01.models.SubResource] + :ivar inbound_nat_pools: Read only. Inbound pools URIs that use this + frontend IP. + :vartype inbound_nat_pools: + list[~azure.mgmt.network.v2017_03_01.models.SubResource] + :ivar outbound_nat_rules: Read only. Outbound rules URIs that use this + frontend IP. + :vartype outbound_nat_rules: + list[~azure.mgmt.network.v2017_03_01.models.SubResource] + :ivar load_balancing_rules: Gets load balancing rules URIs that use this + frontend IP. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_03_01.models.SubResource] + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The Private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_03_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_03_01.models.Subnet + :param public_ip_address: The reference of the Public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_03_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'inbound_nat_rules': {'readonly': True}, + 'inbound_nat_pools': {'readonly': True}, + 'outbound_nat_rules': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[SubResource]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(FrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.inbound_nat_rules = None + self.inbound_nat_pools = None + self.outbound_nat_rules = None + self.load_balancing_rules = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route.py index 64a53f146c0b..0b96cb661e70 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route.py @@ -54,8 +54,8 @@ class GatewayRoute(Model): 'weight': {'key': 'weight', 'type': 'int'}, } - def __init__(self): - super(GatewayRoute, self).__init__() + def __init__(self, **kwargs): + super(GatewayRoute, self).__init__(**kwargs) self.local_address = None self.network = None self.next_hop = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route_list_result.py index 2048c697deba..ab325e4f7e8b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route_list_result.py @@ -23,6 +23,6 @@ class GatewayRouteListResult(Model): 'value': {'key': 'value', 'type': '[GatewayRoute]'}, } - def __init__(self, value=None): - super(GatewayRouteListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route_list_result_py3.py new file mode 100644 index 000000000000..de761c02b509 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRouteListResult(Model): + """List of virtual network gateway routes. + + :param value: List of gateway routes + :type value: list[~azure.mgmt.network.v2017_03_01.models.GatewayRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayRoute]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route_py3.py new file mode 100644 index 000000000000..1aa3ba60605f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/gateway_route_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRoute(Model): + """Gateway routing details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The gateway's local address + :vartype local_address: str + :ivar network: The route's network prefix + :vartype network: str + :ivar next_hop: The route's next hop + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from + :vartype source_peer: str + :ivar origin: The source this route was learned from + :vartype origin: str + :ivar as_path: The route's AS path sequence + :vartype as_path: str + :ivar weight: The route's weight + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(GatewayRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_pool.py index 8f4d40d42650..03cc42d37627 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_pool.py @@ -15,25 +15,29 @@ class InboundNatPool(SubResource): """Inbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. :type frontend_ip_configuration: ~azure.mgmt.network.v2017_03_01.models.SubResource - :param protocol: The transport protocol for the endpoint. Possible values - are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :param protocol: Required. The transport protocol for the endpoint. + Possible values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2017_03_01.models.TransportProtocol - :param frontend_port_range_start: The first port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65534. + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. :type frontend_port_range_start: int - :param frontend_port_range_end: The last port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65535. + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. :type frontend_port_range_end: int - :param backend_port: The port used for internal connections on the - endpoint. Acceptable values are between 1 and 65535. + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. :type backend_port: int :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. @@ -65,13 +69,13 @@ class InboundNatPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port_range_start, frontend_port_range_end, backend_port, id=None, frontend_ip_configuration=None, provisioning_state=None, name=None, etag=None): - super(InboundNatPool, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.protocol = protocol - self.frontend_port_range_start = frontend_port_range_start - self.frontend_port_range_end = frontend_port_range_end - self.backend_port = backend_port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(InboundNatPool, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.protocol = kwargs.get('protocol', None) + self.frontend_port_range_start = kwargs.get('frontend_port_range_start', None) + self.frontend_port_range_end = kwargs.get('frontend_port_range_end', None) + self.backend_port = kwargs.get('backend_port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_pool_py3.py new file mode 100644 index 000000000000..d6f8836c9733 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_pool_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatPool(SubResource): + """Inbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param protocol: Required. The transport protocol for the endpoint. + Possible values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_03_01.models.TransportProtocol + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. + :type frontend_port_range_start: int + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. + :type frontend_port_range_end: int + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port_range_start': {'required': True}, + 'frontend_port_range_end': {'required': True}, + 'backend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, + 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port_range_start: int, frontend_port_range_end: int, backend_port: int, id: str=None, frontend_ip_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatPool, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.protocol = protocol + self.frontend_port_range_start = frontend_port_range_start + self.frontend_port_range_end = frontend_port_range_end + self.backend_port = backend_port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_rule.py index f68cc3b06ebf..d30bd4b518da 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_rule.py @@ -78,15 +78,15 @@ class InboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, protocol=None, frontend_port=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(InboundNatRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration + def __init__(self, **kwargs): + super(InboundNatRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) self.backend_ip_configuration = None - self.protocol = protocol - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_rule_py3.py new file mode 100644 index 000000000000..9d9f54ecee2a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/inbound_nat_rule_py3.py @@ -0,0 +1,92 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatRule(SubResource): + """Inbound NAT rule of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :ivar backend_ip_configuration: A reference to a private IP address + defined on a network interface of a VM. Traffic sent to the frontend port + of each of the frontend IP configurations is forwarded to the backed IP. + :vartype backend_ip_configuration: + ~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceIPConfiguration + :param protocol: The transport protocol for the endpoint. Possible values + are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_03_01.models.TransportProtocol + :param frontend_port: The port for the external endpoint. Port numbers for + each rule must be unique within the Load Balancer. Acceptable values range + from 1 to 65534. + :type frontend_port: int + :param backend_port: The port used for the internal endpoint. Acceptable + values range from 1 to 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, protocol=None, frontend_port: int=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_ip_configuration = None + self.protocol = protocol + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_address_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_address_availability_result.py index f2cb36a550ec..6bcf52275711 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_address_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_address_availability_result.py @@ -27,7 +27,7 @@ class IPAddressAvailabilityResult(Model): 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, } - def __init__(self, available=None, available_ip_addresses=None): - super(IPAddressAvailabilityResult, self).__init__() - self.available = available - self.available_ip_addresses = available_ip_addresses + def __init__(self, **kwargs): + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) + self.available_ip_addresses = kwargs.get('available_ip_addresses', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_address_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_address_availability_result_py3.py new file mode 100644 index 000000000000..e5fc4340d370 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_address_availability_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPAddressAvailabilityResult(Model): + """Response for CheckIPAddressAvailability API service call. + + :param available: Private IP address availability. + :type available: bool + :param available_ip_addresses: Contains other available private IP + addresses if the asked for address is taken. + :type available_ip_addresses: list[str] + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, + } + + def __init__(self, *, available: bool=None, available_ip_addresses=None, **kwargs) -> None: + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = available + self.available_ip_addresses = available_ip_addresses diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_configuration.py index 3f05c52dee15..a9f121b2c92f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_configuration.py @@ -51,12 +51,12 @@ class IPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(IPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(IPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_configuration_py3.py new file mode 100644 index 000000000000..4d2ef37d3c7a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_configuration_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class IPConfiguration(SubResource): + """IPConfiguration. + + :param id: Resource ID. + :type id: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_03_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_03_01.models.Subnet + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_03_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(IPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipsec_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipsec_policy.py index 7bedbe15b8a3..7aa5f73409c2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipsec_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipsec_policy.py @@ -15,39 +15,41 @@ class IpsecPolicy(Model): """An IPSec Policy configuration for a virtual network gateway connection. - :param sa_life_time_seconds: The IPSec Security Association (also called - Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN - tunnel. + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. :type sa_life_time_seconds: int - :param sa_data_size_kilobytes: The IPSec Security Association (also called - Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN - tunnel. + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. :type sa_data_size_kilobytes: int - :param ipsec_encryption: The IPSec encryption algorithm (IKE phase 1). - Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', - 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' :type ipsec_encryption: str or ~azure.mgmt.network.v2017_03_01.models.IpsecEncryption - :param ipsec_integrity: The IPSec integrity algorithm (IKE phase 1). - Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256' :type ipsec_integrity: str or ~azure.mgmt.network.v2017_03_01.models.IpsecIntegrity - :param ike_encryption: The IKE encryption algorithm (IKE phase 2). - Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' :type ike_encryption: str or ~azure.mgmt.network.v2017_03_01.models.IkeEncryption - :param ike_integrity: The IKE integrity algorithm (IKE phase 2). Possible - values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' :type ike_integrity: str or ~azure.mgmt.network.v2017_03_01.models.IkeIntegrity - :param dh_group: The DH Groups used in IKE Phase 1 for initial SA. - Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' :type dh_group: str or ~azure.mgmt.network.v2017_03_01.models.DhGroup - :param pfs_group: The DH Groups used in IKE Phase 2 for new child SA. - Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', - 'ECP384', 'PFS24' + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' :type pfs_group: str or ~azure.mgmt.network.v2017_03_01.models.PfsGroup """ @@ -73,13 +75,13 @@ class IpsecPolicy(Model): 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, } - def __init__(self, sa_life_time_seconds, sa_data_size_kilobytes, ipsec_encryption, ipsec_integrity, ike_encryption, ike_integrity, dh_group, pfs_group): - super(IpsecPolicy, self).__init__() - self.sa_life_time_seconds = sa_life_time_seconds - self.sa_data_size_kilobytes = sa_data_size_kilobytes - self.ipsec_encryption = ipsec_encryption - self.ipsec_integrity = ipsec_integrity - self.ike_encryption = ike_encryption - self.ike_integrity = ike_integrity - self.dh_group = dh_group - self.pfs_group = pfs_group + def __init__(self, **kwargs): + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = kwargs.get('sa_life_time_seconds', None) + self.sa_data_size_kilobytes = kwargs.get('sa_data_size_kilobytes', None) + self.ipsec_encryption = kwargs.get('ipsec_encryption', None) + self.ipsec_integrity = kwargs.get('ipsec_integrity', None) + self.ike_encryption = kwargs.get('ike_encryption', None) + self.ike_integrity = kwargs.get('ike_integrity', None) + self.dh_group = kwargs.get('dh_group', None) + self.pfs_group = kwargs.get('pfs_group', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipsec_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipsec_policy_py3.py new file mode 100644 index 000000000000..bed9d3a7f573 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipsec_policy_py3.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IpsecPolicy(Model): + """An IPSec Policy configuration for a virtual network gateway connection. + + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. + :type sa_life_time_seconds: int + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. + :type sa_data_size_kilobytes: int + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :type ipsec_encryption: str or + ~azure.mgmt.network.v2017_03_01.models.IpsecEncryption + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + 'GCMAES192', 'GCMAES256' + :type ipsec_integrity: str or + ~azure.mgmt.network.v2017_03_01.models.IpsecIntegrity + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :type ike_encryption: str or + ~azure.mgmt.network.v2017_03_01.models.IkeEncryption + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :type ike_integrity: str or + ~azure.mgmt.network.v2017_03_01.models.IkeIntegrity + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + :type dh_group: str or ~azure.mgmt.network.v2017_03_01.models.DhGroup + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' + :type pfs_group: str or ~azure.mgmt.network.v2017_03_01.models.PfsGroup + """ + + _validation = { + 'sa_life_time_seconds': {'required': True}, + 'sa_data_size_kilobytes': {'required': True}, + 'ipsec_encryption': {'required': True}, + 'ipsec_integrity': {'required': True}, + 'ike_encryption': {'required': True}, + 'ike_integrity': {'required': True}, + 'dh_group': {'required': True}, + 'pfs_group': {'required': True}, + } + + _attribute_map = { + 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, + 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, + 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, + 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, + 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, + 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, + 'dh_group': {'key': 'dhGroup', 'type': 'str'}, + 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, + } + + def __init__(self, *, sa_life_time_seconds: int, sa_data_size_kilobytes: int, ipsec_encryption, ipsec_integrity, ike_encryption, ike_integrity, dh_group, pfs_group, **kwargs) -> None: + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = sa_life_time_seconds + self.sa_data_size_kilobytes = sa_data_size_kilobytes + self.ipsec_encryption = ipsec_encryption + self.ipsec_integrity = ipsec_integrity + self.ike_encryption = ike_encryption + self.ike_integrity = ike_integrity + self.dh_group = dh_group + self.pfs_group = pfs_group diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipv6_express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipv6_express_route_circuit_peering_config.py index eacc812d3043..f2cbb7e681bd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipv6_express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipv6_express_route_circuit_peering_config.py @@ -38,10 +38,10 @@ class Ipv6ExpressRouteCircuitPeeringConfig(Model): 'state': {'key': 'state', 'type': 'str'}, } - def __init__(self, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, microsoft_peering_config=None, route_filter=None, state=None): - super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__() - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.microsoft_peering_config = microsoft_peering_config - self.route_filter = route_filter - self.state = state + def __init__(self, **kwargs): + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.route_filter = kwargs.get('route_filter', None) + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipv6_express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipv6_express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..d0c615e753e4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ipv6_express_route_circuit_peering_config_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv6ExpressRouteCircuitPeeringConfig(Model): + """Contains IPv6 peering config. + + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2017_03_01.models.RouteFilter + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeeringState + """ + + _attribute_map = { + 'primary_peer_address_prefix': {'key': 'primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'secondaryPeerAddressPrefix', 'type': 'str'}, + 'microsoft_peering_config': {'key': 'microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'route_filter': {'key': 'routeFilter', 'type': 'RouteFilter'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, microsoft_peering_config=None, route_filter=None, state=None, **kwargs) -> None: + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.microsoft_peering_config = microsoft_peering_config + self.route_filter = route_filter + self.state = state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancer.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancer.py index 93da26b96c0e..fa9933023811 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancer.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancer.py @@ -97,15 +97,15 @@ class LoadBalancer(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(LoadBalancer, self).__init__(id=id, location=location, tags=tags) - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pools = backend_address_pools - self.load_balancing_rules = load_balancing_rules - self.probes = probes - self.inbound_nat_rules = inbound_nat_rules - self.inbound_nat_pools = inbound_nat_pools - self.outbound_nat_rules = outbound_nat_rules - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancer, self).__init__(**kwargs) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.load_balancing_rules = kwargs.get('load_balancing_rules', None) + self.probes = kwargs.get('probes', None) + self.inbound_nat_rules = kwargs.get('inbound_nat_rules', None) + self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) + self.outbound_nat_rules = kwargs.get('outbound_nat_rules', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancer_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancer_py3.py new file mode 100644 index 000000000000..a1fffdab8c4c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancer_py3.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LoadBalancer(Resource): + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param frontend_ip_configurations: Object representing the frontend IPs to + be used for the load balancer + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_03_01.models.FrontendIPConfiguration] + :param backend_address_pools: Collection of backend address pools used by + a load balancer + :type backend_address_pools: + list[~azure.mgmt.network.v2017_03_01.models.BackendAddressPool] + :param load_balancing_rules: Object collection representing the load + balancing rules Gets the provisioning + :type load_balancing_rules: + list[~azure.mgmt.network.v2017_03_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer + :type probes: list[~azure.mgmt.network.v2017_03_01.models.Probe] + :param inbound_nat_rules: Collection of inbound NAT Rules used by a load + balancer. Defining inbound NAT rules on your load balancer is mutually + exclusive with defining an inbound NAT pool. Inbound NAT pools are + referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an Inbound NAT pool. They + have to reference individual inbound NAT rules. + :type inbound_nat_rules: + list[~azure.mgmt.network.v2017_03_01.models.InboundNatRule] + :param inbound_nat_pools: Defines an external port range for inbound NAT + to a single backend port on NICs associated with a load balancer. Inbound + NAT rules are created automatically for each NIC associated with the Load + Balancer using an external port from this range. Defining an Inbound NAT + pool on your Load Balancer is mutually exclusive with defining inbound Nat + rules. Inbound NAT pools are referenced from virtual machine scale sets. + NICs that are associated with individual virtual machines cannot reference + an inbound NAT pool. They have to reference individual inbound NAT rules. + :type inbound_nat_pools: + list[~azure.mgmt.network.v2017_03_01.models.InboundNatPool] + :param outbound_nat_rules: The outbound NAT rules. + :type outbound_nat_rules: + list[~azure.mgmt.network.v2017_03_01.models.OutboundNatRule] + :param resource_guid: The resource GUID property of the load balancer + resource. + :type resource_guid: str + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, + 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[OutboundNatRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancer, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pools = backend_address_pools + self.load_balancing_rules = load_balancing_rules + self.probes = probes + self.inbound_nat_rules = inbound_nat_rules + self.inbound_nat_pools = inbound_nat_pools + self.outbound_nat_rules = outbound_nat_rules + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancing_rule.py index eba442ce32f7..f4bfcc04b648 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancing_rule.py @@ -15,6 +15,8 @@ class LoadBalancingRule(SubResource): """A load balancing rule for a load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. @@ -27,8 +29,9 @@ class LoadBalancingRule(SubResource): :param probe: The reference of the load balancer probe used by the load balancing rule. :type probe: ~azure.mgmt.network.v2017_03_01.models.SubResource - :param protocol: The transport protocol for the external endpoint. - Possible values are 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :param protocol: Required. The transport protocol for the external + endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: + 'Udp', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2017_03_01.models.TransportProtocol :param load_distribution: The load distribution policy for this rule. @@ -36,9 +39,9 @@ class LoadBalancingRule(SubResource): Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' :type load_distribution: str or ~azure.mgmt.network.v2017_03_01.models.LoadDistribution - :param frontend_port: The port for the external endpoint. Port numbers for - each rule must be unique within the Load Balancer. Acceptable values are - between 1 and 65534. + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 1 and 65534. :type frontend_port: int :param backend_port: The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. @@ -85,17 +88,17 @@ class LoadBalancingRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port, id=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(LoadBalancingRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.backend_address_pool = backend_address_pool - self.probe = probe - self.protocol = protocol - self.load_distribution = load_distribution - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancingRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.probe = kwargs.get('probe', None) + self.protocol = kwargs.get('protocol', None) + self.load_distribution = kwargs.get('load_distribution', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancing_rule_py3.py new file mode 100644 index 000000000000..ad499da1a2c5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/load_balancing_rule_py3.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class LoadBalancingRule(SubResource): + """A load balancing rule for a load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param backend_address_pool: A reference to a pool of DIPs. Inbound + traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param probe: The reference of the load balancer probe used by the load + balancing rule. + :type probe: ~azure.mgmt.network.v2017_03_01.models.SubResource + :param protocol: Required. The transport protocol for the external + endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: + 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_03_01.models.TransportProtocol + :param load_distribution: The load distribution policy for this rule. + Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + :type load_distribution: str or + ~azure.mgmt.network.v2017_03_01.models.LoadDistribution + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 1 and 65534. + :type frontend_port: int + :param backend_port: The port used for internal connections on the + endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port: int, id: str=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancingRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_address_pool = backend_address_pool + self.probe = probe + self.protocol = protocol + self.load_distribution = load_distribution + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/local_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/local_network_gateway.py index 06adcab6b46f..14da73cfd977 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/local_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/local_network_gateway.py @@ -67,11 +67,11 @@ class LocalNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, local_network_address_space=None, gateway_ip_address=None, bgp_settings=None, resource_guid=None, etag=None): - super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.local_network_address_space = local_network_address_space - self.gateway_ip_address = gateway_ip_address - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(LocalNetworkGateway, self).__init__(**kwargs) + self.local_network_address_space = kwargs.get('local_network_address_space', None) + self.gateway_ip_address = kwargs.get('gateway_ip_address', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/local_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/local_network_gateway_py3.py new file mode 100644 index 000000000000..5a12afe60c44 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/local_network_gateway_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LocalNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param local_network_address_space: Local network site address space. + :type local_network_address_space: + ~azure.mgmt.network.v2017_03_01.models.AddressSpace + :param gateway_ip_address: IP address of local network gateway. + :type gateway_ip_address: str + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2017_03_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + LocalNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', + and 'Failed'. + :vartype provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, + 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, local_network_address_space=None, gateway_ip_address: str=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.local_network_address_space = local_network_address_space + self.gateway_ip_address = gateway_ip_address + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface.py index 284336566d80..9df1f1e8e737 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface.py @@ -87,16 +87,16 @@ class NetworkInterface(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address=None, primary=None, enable_accelerated_networking=None, enable_ip_forwarding=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkInterface, self).__init__(id=id, location=location, tags=tags) - self.virtual_machine = virtual_machine - self.network_security_group = network_security_group - self.ip_configurations = ip_configurations - self.dns_settings = dns_settings - self.mac_address = mac_address - self.primary = primary - self.enable_accelerated_networking = enable_accelerated_networking - self.enable_ip_forwarding = enable_ip_forwarding - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.virtual_machine = kwargs.get('virtual_machine', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.mac_address = kwargs.get('mac_address', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_association.py index f9b3c3ad734c..755e42aa7297 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_association.py @@ -34,7 +34,7 @@ class NetworkInterfaceAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(NetworkInterfaceAssociation, self).__init__() + def __init__(self, **kwargs): + super(NetworkInterfaceAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_association_py3.py new file mode 100644 index 000000000000..55aa1e9b8d1b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Network interface ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2017_03_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(NetworkInterfaceAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_dns_settings.py index 675a4a1eb08a..b6ee0ff40d51 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_dns_settings.py @@ -46,10 +46,10 @@ class NetworkInterfaceDnsSettings(Model): 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, } - def __init__(self, dns_servers=None, applied_dns_servers=None, internal_dns_name_label=None, internal_fqdn=None, internal_domain_name_suffix=None): - super(NetworkInterfaceDnsSettings, self).__init__() - self.dns_servers = dns_servers - self.applied_dns_servers = applied_dns_servers - self.internal_dns_name_label = internal_dns_name_label - self.internal_fqdn = internal_fqdn - self.internal_domain_name_suffix = internal_domain_name_suffix + def __init__(self, **kwargs): + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + self.applied_dns_servers = kwargs.get('applied_dns_servers', None) + self.internal_dns_name_label = kwargs.get('internal_dns_name_label', None) + self.internal_fqdn = kwargs.get('internal_fqdn', None) + self.internal_domain_name_suffix = kwargs.get('internal_domain_name_suffix', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_dns_settings_py3.py new file mode 100644 index 000000000000..ccdcc937def8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_dns_settings_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceDnsSettings(Model): + """DNS settings of a network interface. + + :param dns_servers: List of DNS servers IP addresses. Use + 'AzureProvidedDNS' to switch to azure provided DNS resolution. + 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + only value in dnsServers collection. + :type dns_servers: list[str] + :param applied_dns_servers: If the VM that uses this NIC is part of an + Availability Set, then this list will have the union of all DNS servers + from all NICs that are part of the Availability Set. This property is what + is configured on each of those VMs. + :type applied_dns_servers: list[str] + :param internal_dns_name_label: Relative DNS name for this NIC used for + internal communications between VMs in the same virtual network. + :type internal_dns_name_label: str + :param internal_fqdn: Fully qualified DNS name supporting internal + communications between VMs in the same virtual network. + :type internal_fqdn: str + :param internal_domain_name_suffix: Even if internalDnsNameLabel is not + specified, a DNS entry is created for the primary NIC of the VM. This DNS + name can be constructed by concatenating the VM name with the value of + internalDomainNameSuffix. + :type internal_domain_name_suffix: str + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, + 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, + } + + def __init__(self, *, dns_servers=None, applied_dns_servers=None, internal_dns_name_label: str=None, internal_fqdn: str=None, internal_domain_name_suffix: str=None, **kwargs) -> None: + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers + self.applied_dns_servers = applied_dns_servers + self.internal_dns_name_label = internal_dns_name_label + self.internal_fqdn = internal_fqdn + self.internal_domain_name_suffix = internal_domain_name_suffix diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_ip_configuration.py index 0b381e01c432..70d85a8adce1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_ip_configuration.py @@ -76,17 +76,17 @@ class NetworkInterfaceIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(NetworkInterfaceIPConfiguration, self).__init__(id=id) - self.application_gateway_backend_address_pools = application_gateway_backend_address_pools - self.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.private_ip_address_version = private_ip_address_version - self.subnet = subnet - self.primary = primary - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterfaceIPConfiguration, self).__init__(**kwargs) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_rules = kwargs.get('load_balancer_inbound_nat_rules', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_ip_configuration_py3.py new file mode 100644 index 000000000000..5e5d182fbe18 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_ip_configuration_py3.py @@ -0,0 +1,92 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class NetworkInterfaceIPConfiguration(SubResource): + """IPConfiguration in a network interface. + + :param id: Resource ID. + :type id: str + :param application_gateway_backend_address_pools: The reference of + ApplicationGatewayBackendAddressPool resource. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendAddressPool] + :param load_balancer_backend_address_pools: The reference of + LoadBalancerBackendAddressPool resource. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2017_03_01.models.BackendAddressPool] + :param load_balancer_inbound_nat_rules: A list of references of + LoadBalancerInboundNatRules. + :type load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2017_03_01.models.InboundNatRule] + :param private_ip_address: + :type private_ip_address: str + :param private_ip_allocation_method: Defines how a private IP address is + assigned. Possible values are: 'Static' and 'Dynamic'. Possible values + include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_03_01.models.IPAllocationMethod + :param private_ip_address_version: Available from Api-Version 2016-03-30 + onwards, it represents whether the specific ipconfiguration is IPv4 or + IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.network.v2017_03_01.models.IPVersion + :param subnet: + :type subnet: ~azure.mgmt.network.v2017_03_01.models.Subnet + :param primary: Gets whether this is a primary customer address on the + network interface. + :type primary: bool + :param public_ip_address: + :type public_ip_address: + ~azure.mgmt.network.v2017_03_01.models.PublicIPAddress + :param provisioning_state: + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address: str=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary: bool=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterfaceIPConfiguration, self).__init__(id=id, **kwargs) + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.private_ip_address_version = private_ip_address_version + self.subnet = subnet + self.primary = primary + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_py3.py new file mode 100644 index 000000000000..3e0265b77dfe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_interface_py3.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkInterface(Resource): + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param virtual_machine: The reference of a virtual machine. + :type virtual_machine: ~azure.mgmt.network.v2017_03_01.models.SubResource + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2017_03_01.models.NetworkSecurityGroup + :param ip_configurations: A list of IPConfigurations of the network + interface. + :type ip_configurations: + list[~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceIPConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: + ~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceDnsSettings + :param mac_address: The MAC address of the network interface. + :type mac_address: str + :param primary: Gets whether this is a primary network interface on a + virtual machine. + :type primary: bool + :param enable_accelerated_networking: If the network interface is + accelerated networking enabled. + :type enable_accelerated_networking: bool + :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on + this network interface. + :type enable_ip_forwarding: bool + :param resource_guid: The resource GUID property of the network interface + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, + 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address: str=None, primary: bool=None, enable_accelerated_networking: bool=None, enable_ip_forwarding: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterface, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.virtual_machine = virtual_machine + self.network_security_group = network_security_group + self.ip_configurations = ip_configurations + self.dns_settings = dns_settings + self.mac_address = mac_address + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.enable_ip_forwarding = enable_ip_forwarding + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_management_client_enums.py index a98be8579f6e..d857c0cc1dab 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_management_client_enums.py @@ -12,44 +12,44 @@ from enum import Enum -class TransportProtocol(Enum): +class TransportProtocol(str, Enum): udp = "Udp" tcp = "Tcp" -class IPAllocationMethod(Enum): +class IPAllocationMethod(str, Enum): static = "Static" dynamic = "Dynamic" -class IPVersion(Enum): +class IPVersion(str, Enum): ipv4 = "IPv4" ipv6 = "IPv6" -class SecurityRuleProtocol(Enum): +class SecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" asterisk = "*" -class SecurityRuleAccess(Enum): +class SecurityRuleAccess(str, Enum): allow = "Allow" deny = "Deny" -class SecurityRuleDirection(Enum): +class SecurityRuleDirection(str, Enum): inbound = "Inbound" outbound = "Outbound" -class RouteNextHopType(Enum): +class RouteNextHopType(str, Enum): virtual_network_gateway = "VirtualNetworkGateway" vnet_local = "VnetLocal" @@ -58,19 +58,19 @@ class RouteNextHopType(Enum): none = "None" -class ApplicationGatewayProtocol(Enum): +class ApplicationGatewayProtocol(str, Enum): http = "Http" https = "Https" -class ApplicationGatewayCookieBasedAffinity(Enum): +class ApplicationGatewayCookieBasedAffinity(str, Enum): enabled = "Enabled" disabled = "Disabled" -class ApplicationGatewayBackendHealthServerHealth(Enum): +class ApplicationGatewayBackendHealthServerHealth(str, Enum): unknown = "Unknown" up = "Up" @@ -79,7 +79,7 @@ class ApplicationGatewayBackendHealthServerHealth(Enum): draining = "Draining" -class ApplicationGatewaySkuName(Enum): +class ApplicationGatewaySkuName(str, Enum): standard_small = "Standard_Small" standard_medium = "Standard_Medium" @@ -88,26 +88,26 @@ class ApplicationGatewaySkuName(Enum): waf_large = "WAF_Large" -class ApplicationGatewayTier(Enum): +class ApplicationGatewayTier(str, Enum): standard = "Standard" waf = "WAF" -class ApplicationGatewaySslProtocol(Enum): +class ApplicationGatewaySslProtocol(str, Enum): tl_sv1_0 = "TLSv1_0" tl_sv1_1 = "TLSv1_1" tl_sv1_2 = "TLSv1_2" -class ApplicationGatewayRequestRoutingRuleType(Enum): +class ApplicationGatewayRequestRoutingRuleType(str, Enum): basic = "Basic" path_based_routing = "PathBasedRouting" -class ApplicationGatewayOperationalState(Enum): +class ApplicationGatewayOperationalState(str, Enum): stopped = "Stopped" starting = "Starting" @@ -115,19 +115,19 @@ class ApplicationGatewayOperationalState(Enum): stopping = "Stopping" -class ApplicationGatewayFirewallMode(Enum): +class ApplicationGatewayFirewallMode(str, Enum): detection = "Detection" prevention = "Prevention" -class AuthorizationUseStatus(Enum): +class AuthorizationUseStatus(str, Enum): available = "Available" in_use = "InUse" -class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(str, Enum): not_configured = "NotConfigured" configuring = "Configuring" @@ -135,38 +135,38 @@ class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): validation_needed = "ValidationNeeded" -class Access(Enum): +class Access(str, Enum): allow = "Allow" deny = "Deny" -class ExpressRouteCircuitPeeringType(Enum): +class ExpressRouteCircuitPeeringType(str, Enum): azure_public_peering = "AzurePublicPeering" azure_private_peering = "AzurePrivatePeering" microsoft_peering = "MicrosoftPeering" -class ExpressRouteCircuitPeeringState(Enum): +class ExpressRouteCircuitPeeringState(str, Enum): disabled = "Disabled" enabled = "Enabled" -class ExpressRouteCircuitSkuTier(Enum): +class ExpressRouteCircuitSkuTier(str, Enum): standard = "Standard" premium = "Premium" -class ExpressRouteCircuitSkuFamily(Enum): +class ExpressRouteCircuitSkuFamily(str, Enum): unlimited_data = "UnlimitedData" metered_data = "MeteredData" -class ServiceProviderProvisioningState(Enum): +class ServiceProviderProvisioningState(str, Enum): not_provisioned = "NotProvisioned" provisioning = "Provisioning" @@ -174,27 +174,27 @@ class ServiceProviderProvisioningState(Enum): deprovisioning = "Deprovisioning" -class LoadDistribution(Enum): +class LoadDistribution(str, Enum): default = "Default" source_ip = "SourceIP" source_ip_protocol = "SourceIPProtocol" -class ProbeProtocol(Enum): +class ProbeProtocol(str, Enum): http = "Http" tcp = "Tcp" -class NetworkOperationStatus(Enum): +class NetworkOperationStatus(str, Enum): in_progress = "InProgress" succeeded = "Succeeded" failed = "Failed" -class EffectiveRouteSource(Enum): +class EffectiveRouteSource(str, Enum): unknown = "Unknown" user = "User" @@ -202,13 +202,13 @@ class EffectiveRouteSource(Enum): default = "Default" -class EffectiveRouteState(Enum): +class EffectiveRouteState(str, Enum): active = "Active" invalid = "Invalid" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): succeeded = "Succeeded" updating = "Updating" @@ -216,25 +216,25 @@ class ProvisioningState(Enum): failed = "Failed" -class AssociationType(Enum): +class AssociationType(str, Enum): associated = "Associated" contains = "Contains" -class Direction(Enum): +class Direction(str, Enum): inbound = "Inbound" outbound = "Outbound" -class Protocol(Enum): +class Protocol(str, Enum): tcp = "TCP" udp = "UDP" -class NextHopType(Enum): +class NextHopType(str, Enum): internet = "Internet" virtual_appliance = "VirtualAppliance" @@ -244,14 +244,14 @@ class NextHopType(Enum): none = "None" -class PcProtocol(Enum): +class PcProtocol(str, Enum): tcp = "TCP" udp = "UDP" any = "Any" -class PcStatus(Enum): +class PcStatus(str, Enum): not_started = "NotStarted" running = "Running" @@ -260,7 +260,7 @@ class PcStatus(Enum): unknown = "Unknown" -class PcError(Enum): +class PcError(str, Enum): internal_error = "InternalError" agent_stopped = "AgentStopped" @@ -269,20 +269,20 @@ class PcError(Enum): storage_failed = "StorageFailed" -class Origin(Enum): +class Origin(str, Enum): local = "Local" inbound = "Inbound" outbound = "Outbound" -class Severity(Enum): +class Severity(str, Enum): error = "Error" warning = "Warning" -class IssueType(Enum): +class IssueType(str, Enum): unknown = "Unknown" agent_stopped = "AgentStopped" @@ -295,7 +295,7 @@ class IssueType(Enum): platform = "Platform" -class ConnectionStatus(Enum): +class ConnectionStatus(str, Enum): unknown = "Unknown" connected = "Connected" @@ -303,26 +303,26 @@ class ConnectionStatus(Enum): degraded = "Degraded" -class VirtualNetworkPeeringState(Enum): +class VirtualNetworkPeeringState(str, Enum): initiated = "Initiated" connected = "Connected" disconnected = "Disconnected" -class VirtualNetworkGatewayType(Enum): +class VirtualNetworkGatewayType(str, Enum): vpn = "Vpn" express_route = "ExpressRoute" -class VpnType(Enum): +class VpnType(str, Enum): policy_based = "PolicyBased" route_based = "RouteBased" -class VirtualNetworkGatewaySkuName(Enum): +class VirtualNetworkGatewaySkuName(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -333,7 +333,7 @@ class VirtualNetworkGatewaySkuName(Enum): vpn_gw3 = "VpnGw3" -class VirtualNetworkGatewaySkuTier(Enum): +class VirtualNetworkGatewaySkuTier(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -344,7 +344,7 @@ class VirtualNetworkGatewaySkuTier(Enum): vpn_gw3 = "VpnGw3" -class BgpPeerState(Enum): +class BgpPeerState(str, Enum): unknown = "Unknown" stopped = "Stopped" @@ -353,13 +353,13 @@ class BgpPeerState(Enum): connected = "Connected" -class ProcessorArchitecture(Enum): +class ProcessorArchitecture(str, Enum): amd64 = "Amd64" x86 = "X86" -class VirtualNetworkGatewayConnectionStatus(Enum): +class VirtualNetworkGatewayConnectionStatus(str, Enum): unknown = "Unknown" connecting = "Connecting" @@ -367,7 +367,7 @@ class VirtualNetworkGatewayConnectionStatus(Enum): not_connected = "NotConnected" -class VirtualNetworkGatewayConnectionType(Enum): +class VirtualNetworkGatewayConnectionType(str, Enum): ipsec = "IPsec" vnet2_vnet = "Vnet2Vnet" @@ -375,7 +375,7 @@ class VirtualNetworkGatewayConnectionType(Enum): vpn_client = "VPNClient" -class IpsecEncryption(Enum): +class IpsecEncryption(str, Enum): none = "None" des = "DES" @@ -388,7 +388,7 @@ class IpsecEncryption(Enum): gcmaes256 = "GCMAES256" -class IpsecIntegrity(Enum): +class IpsecIntegrity(str, Enum): md5 = "MD5" sha1 = "SHA1" @@ -398,7 +398,7 @@ class IpsecIntegrity(Enum): gcmaes256 = "GCMAES256" -class IkeEncryption(Enum): +class IkeEncryption(str, Enum): des = "DES" des3 = "DES3" @@ -407,7 +407,7 @@ class IkeEncryption(Enum): aes256 = "AES256" -class IkeIntegrity(Enum): +class IkeIntegrity(str, Enum): md5 = "MD5" sha1 = "SHA1" @@ -415,7 +415,7 @@ class IkeIntegrity(Enum): sha384 = "SHA384" -class DhGroup(Enum): +class DhGroup(str, Enum): none = "None" dh_group1 = "DHGroup1" @@ -427,7 +427,7 @@ class DhGroup(Enum): dh_group24 = "DHGroup24" -class PfsGroup(Enum): +class PfsGroup(str, Enum): none = "None" pfs1 = "PFS1" diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_security_group.py index bab1f8feb88d..482a9f5111f1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_security_group.py @@ -75,12 +75,12 @@ class NetworkSecurityGroup(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, security_rules=None, default_security_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags) - self.security_rules = security_rules - self.default_security_rules = default_security_rules + def __init__(self, **kwargs): + super(NetworkSecurityGroup, self).__init__(**kwargs) + self.security_rules = kwargs.get('security_rules', None) + self.default_security_rules = kwargs.get('default_security_rules', None) self.network_interfaces = None self.subnets = None - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_security_group_py3.py new file mode 100644 index 000000000000..ea4e6aeebb9a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_security_group_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkSecurityGroup(Resource): + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param security_rules: A collection of security rules of the network + security group. + :type security_rules: + list[~azure.mgmt.network.v2017_03_01.models.SecurityRule] + :param default_security_rules: The default security rules of network + security group. + :type default_security_rules: + list[~azure.mgmt.network.v2017_03_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network + interfaces. + :vartype network_interfaces: + list[~azure.mgmt.network.v2017_03_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2017_03_01.models.Subnet] + :param resource_guid: The resource GUID property of the network security + group resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, + 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, security_rules=None, default_security_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.security_rules = security_rules + self.default_security_rules = default_security_rules + self.network_interfaces = None + self.subnets = None + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_watcher.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_watcher.py index 19a01823ee3a..f461a2bc798c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_watcher.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_watcher.py @@ -53,7 +53,7 @@ class NetworkWatcher(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, etag=None): - super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags) - self.etag = etag + def __init__(self, **kwargs): + super(NetworkWatcher, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_watcher_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_watcher_py3.py new file mode 100644 index 000000000000..dd6913a7d521 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/network_watcher_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkWatcher(Resource): + """Network watcher in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.network.v2017_03_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, etag: str=None, **kwargs) -> None: + super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = etag + self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_parameters.py index 3e1478409a0a..54d8674c8884 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_parameters.py @@ -15,12 +15,14 @@ class NextHopParameters(Model): """Parameters that define the source and destination endpoint. - :param target_resource_id: The resource identifier of the target resource - against which the action is to be performed. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. :type target_resource_id: str - :param source_ip_address: The source IP address. + :param source_ip_address: Required. The source IP address. :type source_ip_address: str - :param destination_ip_address: The destination IP address. + :param destination_ip_address: Required. The destination IP address. :type destination_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be @@ -41,9 +43,9 @@ class NextHopParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, source_ip_address, destination_ip_address, target_nic_resource_id=None): - super(NextHopParameters, self).__init__() - self.target_resource_id = target_resource_id - self.source_ip_address = source_ip_address - self.destination_ip_address = destination_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.source_ip_address = kwargs.get('source_ip_address', None) + self.destination_ip_address = kwargs.get('destination_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_parameters_py3.py new file mode 100644 index 000000000000..50ee3d334e91 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_parameters_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopParameters(Model): + """Parameters that define the source and destination endpoint. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. + :type target_resource_id: str + :param source_ip_address: Required. The source IP address. + :type source_ip_address: str + :param destination_ip_address: Required. The destination IP address. + :type destination_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of the nics, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'source_ip_address': {'required': True}, + 'destination_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, + 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, source_ip_address: str, destination_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.source_ip_address = source_ip_address + self.destination_ip_address = destination_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_result.py index bdbf28159eba..7fcbdecd82d8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_result.py @@ -35,8 +35,8 @@ class NextHopResult(Model): 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, } - def __init__(self, next_hop_type=None, next_hop_ip_address=None, route_table_id=None): - super(NextHopResult, self).__init__() - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.route_table_id = route_table_id + def __init__(self, **kwargs): + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.route_table_id = kwargs.get('route_table_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_result_py3.py new file mode 100644 index 000000000000..889fa3054062 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/next_hop_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopResult(Model): + """The information about next hop from the specified VM. + + :param next_hop_type: Next hop type. Possible values include: 'Internet', + 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', + 'HyperNetGateway', 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_03_01.models.NextHopType + :param next_hop_ip_address: Next hop IP Address + :type next_hop_ip_address: str + :param route_table_id: The resource identifier for the route table + associated with the route being returned. If the route being returned does + not correspond to any user created routes then this field will be the + string 'System Route'. + :type route_table_id: str + """ + + _attribute_map = { + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type=None, next_hop_ip_address: str=None, route_table_id: str=None, **kwargs) -> None: + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.route_table_id = route_table_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/outbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/outbound_nat_rule.py index a713f9e0d978..ff7b3dc0b704 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/outbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/outbound_nat_rule.py @@ -15,6 +15,8 @@ class OutboundNatRule(SubResource): """Outbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param allocated_outbound_ports: The number of outbound ports to be used @@ -24,8 +26,8 @@ class OutboundNatRule(SubResource): balancer. :type frontend_ip_configurations: list[~azure.mgmt.network.v2017_03_01.models.SubResource] - :param backend_address_pool: A reference to a pool of DIPs. Outbound - traffic is randomly load balanced across IPs in the backend IPs. + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. :type backend_address_pool: ~azure.mgmt.network.v2017_03_01.models.SubResource :param provisioning_state: Gets the provisioning state of the PublicIP @@ -53,11 +55,11 @@ class OutboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, backend_address_pool, id=None, allocated_outbound_ports=None, frontend_ip_configurations=None, provisioning_state=None, name=None, etag=None): - super(OutboundNatRule, self).__init__(id=id) - self.allocated_outbound_ports = allocated_outbound_ports - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pool = backend_address_pool - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(OutboundNatRule, self).__init__(**kwargs) + self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/outbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/outbound_nat_rule_py3.py new file mode 100644 index 000000000000..f9e551d644aa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/outbound_nat_rule_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class OutboundNatRule(SubResource): + """Outbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param allocated_outbound_ports: The number of outbound ports to be used + for NAT. + :type allocated_outbound_ports: int + :param frontend_ip_configurations: The Frontend IP addresses of the load + balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_03_01.models.SubResource] + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_address_pool': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, backend_address_pool, id: str=None, allocated_outbound_ports: int=None, frontend_ip_configurations=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(OutboundNatRule, self).__init__(id=id, **kwargs) + self.allocated_outbound_ports = allocated_outbound_ports + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pool = backend_address_pool + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture.py index b732a96612d0..139bcdf2f214 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture.py @@ -15,8 +15,10 @@ class PacketCapture(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCapture(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_03_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCapture(Model): 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCapture, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCapture, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_filter.py index 781b00a9a70a..f1f1c072ec01 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_filter.py @@ -51,10 +51,10 @@ class PacketCaptureFilter(Model): 'remote_port': {'key': 'remotePort', 'type': 'str'}, } - def __init__(self, protocol="Any", local_ip_address=None, remote_ip_address=None, local_port=None, remote_port=None): - super(PacketCaptureFilter, self).__init__() - self.protocol = protocol - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.local_port = local_port - self.remote_port = remote_port + def __init__(self, **kwargs): + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', "Any") + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_filter_py3.py new file mode 100644 index 000000000000..4caedda821f4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_filter_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureFilter(Model): + """Filter that is applied to packet capture request. Multiple filters can be + applied. + + :param protocol: Protocol to be filtered on. Possible values include: + 'TCP', 'UDP', 'Any'. Default value: "Any" . + :type protocol: str or ~azure.mgmt.network.v2017_03_01.models.PcProtocol + :param local_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type local_ip_address: str + :param remote_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type remote_ip_address: str + :param local_port: Local port to be filtered on. Notation: "80" for single + port entry."80-85" for range. "80;443;" for multiple entries. Multiple + ranges not currently supported. Mixing ranges with multiple entries not + currently supported. Default = null. + :type local_port: str + :param remote_port: Remote port to be filtered on. Notation: "80" for + single port entry."80-85" for range. "80;443;" for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple + entries not currently supported. Default = null. + :type remote_port: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + } + + def __init__(self, *, protocol="Any", local_ip_address: str=None, remote_ip_address: str=None, local_port: str=None, remote_port: str=None, **kwargs) -> None: + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = protocol + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.local_port = local_port + self.remote_port = remote_port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_parameters.py index 69b68ea4d3ff..a50d949b0e4d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_parameters.py @@ -15,8 +15,10 @@ class PacketCaptureParameters(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCaptureParameters(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_03_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCaptureParameters(Model): 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCaptureParameters, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_parameters_py3.py new file mode 100644 index 000000000000..f276d9e2e60d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_parameters_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureParameters(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_03_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_03_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_py3.py new file mode 100644 index 000000000000..e2d533da03c4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCapture(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_03_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_03_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCapture, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_query_status_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_query_status_result.py index 3d6779ce0d67..04e6c8b227c2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_query_status_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_query_status_result.py @@ -43,11 +43,11 @@ class PacketCaptureQueryStatusResult(Model): 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, } - def __init__(self, name=None, id=None, capture_start_time=None, packet_capture_status=None, stop_reason=None, packet_capture_error=None): - super(PacketCaptureQueryStatusResult, self).__init__() - self.name = name - self.id = id - self.capture_start_time = capture_start_time - self.packet_capture_status = packet_capture_status - self.stop_reason = stop_reason - self.packet_capture_error = packet_capture_error + def __init__(self, **kwargs): + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.capture_start_time = kwargs.get('capture_start_time', None) + self.packet_capture_status = kwargs.get('packet_capture_status', None) + self.stop_reason = kwargs.get('stop_reason', None) + self.packet_capture_error = kwargs.get('packet_capture_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_query_status_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_query_status_result_py3.py new file mode 100644 index 000000000000..b10a052e9e28 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_query_status_result_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureQueryStatusResult(Model): + """Status of packet capture session. + + :param name: The name of the packet capture resource. + :type name: str + :param id: The ID of the packet capture resource. + :type id: str + :param capture_start_time: The start time of the packet capture session. + :type capture_start_time: datetime + :param packet_capture_status: The status of the packet capture session. + Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', + 'Unknown' + :type packet_capture_status: str or + ~azure.mgmt.network.v2017_03_01.models.PcStatus + :param stop_reason: The reason the current packet capture session was + stopped. + :type stop_reason: str + :param packet_capture_error: List of errors of packet capture session. + :type packet_capture_error: list[str or + ~azure.mgmt.network.v2017_03_01.models.PcError] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, + 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, + 'stop_reason': {'key': 'stopReason', 'type': 'str'}, + 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, id: str=None, capture_start_time=None, packet_capture_status=None, stop_reason: str=None, packet_capture_error=None, **kwargs) -> None: + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = name + self.id = id + self.capture_start_time = capture_start_time + self.packet_capture_status = packet_capture_status + self.stop_reason = stop_reason + self.packet_capture_error = packet_capture_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_result.py index 68d818972f82..332b00207fb6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_result.py @@ -18,6 +18,8 @@ class PacketCaptureResult(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar name: Name of the packet capture session. :vartype name: str :ivar id: ID of the packet capture operation. @@ -25,8 +27,8 @@ class PacketCaptureResult(Model): :param etag: Default value: "A unique read-only string that changes whenever the resource is updated." . :type etag: str - :param target: The ID of the targeted resource, only VM is currently - supported. + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -37,7 +39,7 @@ class PacketCaptureResult(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_03_01.models.PacketCaptureStorageLocation :param filters: @@ -70,15 +72,15 @@ class PacketCaptureResult(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, target, storage_location, etag="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None, provisioning_state=None): - super(PacketCaptureResult, self).__init__() + def __init__(self, **kwargs): + super(PacketCaptureResult, self).__init__(**kwargs) self.name = None self.id = None - self.etag = etag - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters - self.provisioning_state = provisioning_state + self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_result_py3.py new file mode 100644 index 000000000000..d56c8a663388 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_result_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureResult(Model): + """Information about packet capture session. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the packet capture session. + :vartype name: str + :ivar id: ID of the packet capture operation. + :vartype id: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_03_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_03_01.models.PacketCaptureFilter] + :param provisioning_state: The provisioning state of the packet capture + session. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2017_03_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, target: str, storage_location, etag: str="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, provisioning_state=None, **kwargs) -> None: + super(PacketCaptureResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = etag + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_storage_location.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_storage_location.py index 773b04d22501..62ed83d592b3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_storage_location.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_storage_location.py @@ -35,8 +35,8 @@ class PacketCaptureStorageLocation(Model): 'file_path': {'key': 'filePath', 'type': 'str'}, } - def __init__(self, storage_id=None, storage_path=None, file_path=None): - super(PacketCaptureStorageLocation, self).__init__() - self.storage_id = storage_id - self.storage_path = storage_path - self.file_path = file_path + def __init__(self, **kwargs): + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) + self.file_path = kwargs.get('file_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_storage_location_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_storage_location_py3.py new file mode 100644 index 000000000000..6925dd4f9bdf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/packet_capture_storage_location_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureStorageLocation(Model): + """Describes the storage location for a packet capture session. + + :param storage_id: The ID of the storage account to save the packet + capture session. Required if no local file path is provided. + :type storage_id: str + :param storage_path: The URI of the storage path to save the packet + capture. Must be a well-formed URI describing the location to save the + packet capture. + :type storage_path: str + :param file_path: A valid local path on the targeting VM. Must include the + name of the capture file (*.cap). For linux virtual machine it must start + with /var/captures. Required if no storage ID is provided, otherwise + optional. + :type file_path: str + """ + + _attribute_map = { + 'storage_id': {'key': 'storageId', 'type': 'str'}, + 'storage_path': {'key': 'storagePath', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + } + + def __init__(self, *, storage_id: str=None, storage_path: str=None, file_path: str=None, **kwargs) -> None: + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = storage_id + self.storage_path = storage_path + self.file_path = file_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter.py index 6b4d31ae6914..39e1c35911d9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter.py @@ -61,12 +61,12 @@ class PatchRouteFilter(SubResource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, rules=None, tags=None): - super(PatchRouteFilter, self).__init__(id=id) - self.rules = rules + def __init__(self, **kwargs): + super(PatchRouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) self.peerings = None self.provisioning_state = None self.name = None self.etag = None self.type = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter_py3.py new file mode 100644 index 000000000000..a2669c92c73c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter_py3.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilter(SubResource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2017_03_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit + peerings. + :vartype peerings: + list[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'peerings': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, rules=None, tags=None, **kwargs) -> None: + super(PatchRouteFilter, self).__init__(id=id, **kwargs) + self.rules = rules + self.peerings = None + self.provisioning_state = None + self.name = None + self.etag = None + self.type = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter_rule.py index 7d224cfe5cb5..b02e7c7c5cad 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter_rule.py @@ -18,16 +18,18 @@ class PatchRouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2017_03_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -64,11 +66,11 @@ class PatchRouteFilterRule(SubResource): route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, tags=None): - super(PatchRouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(PatchRouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None self.name = None self.etag = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter_rule_py3.py new file mode 100644 index 000000000000..b7b0d6540cfa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/patch_route_filter_rule_py3.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_03_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, tags=None, **kwargs) -> None: + super(PatchRouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = None + self.etag = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/probe.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/probe.py index b1c0afa02a30..0a8b9b52530e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/probe.py @@ -18,20 +18,22 @@ class Probe(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar load_balancing_rules: The load balancer rules that use this probe. :vartype load_balancing_rules: list[~azure.mgmt.network.v2017_03_01.models.SubResource] - :param protocol: The protocol of the end point. Possible values are: - 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the - probe to be successful. If 'Http' is specified, a 200 OK response from the - specifies URI is required for the probe to be successful. Possible values - include: 'Http', 'Tcp' + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2017_03_01.models.ProbeProtocol - :param port: The port for communicating the probe. Possible values range - from 1 to 65535, inclusive. + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. :type port: int :param interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is @@ -78,14 +80,14 @@ class Probe(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, port, id=None, interval_in_seconds=None, number_of_probes=None, request_path=None, provisioning_state=None, name=None, etag=None): - super(Probe, self).__init__(id=id) + def __init__(self, **kwargs): + super(Probe, self).__init__(**kwargs) self.load_balancing_rules = None - self.protocol = protocol - self.port = port - self.interval_in_seconds = interval_in_seconds - self.number_of_probes = number_of_probes - self.request_path = request_path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.port = kwargs.get('port', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.number_of_probes = kwargs.get('number_of_probes', None) + self.request_path = kwargs.get('request_path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/probe_py3.py new file mode 100644 index 000000000000..2dfe36a7e601 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Probe(SubResource): + """A load balancer probe. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar load_balancing_rules: The load balancer rules that use this probe. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_03_01.models.SubResource] + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_03_01.models.ProbeProtocol + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. + :type port: int + :param interval_in_seconds: The interval, in seconds, for how frequently + to probe the endpoint for health status. Typically, the interval is + slightly less than half the allocated timeout period (in seconds) which + allows two full probes before taking the instance out of rotation. The + default value is 15, the minimum value is 5. + :type interval_in_seconds: int + :param number_of_probes: The number of probes where if no response, will + result in stopping further traffic from being delivered to the endpoint. + This values allows endpoints to be taken out of rotation faster or slower + than the typical times used in Azure. + :type number_of_probes: int + :param request_path: The URI used for requesting health status from the + VM. Path is required if a protocol is set to http. Otherwise, it is not + allowed. There is no default value. + :type request_path: str + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'load_balancing_rules': {'readonly': True}, + 'protocol': {'required': True}, + 'port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, + 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, port: int, id: str=None, interval_in_seconds: int=None, number_of_probes: int=None, request_path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Probe, self).__init__(id=id, **kwargs) + self.load_balancing_rules = None + self.protocol = protocol + self.port = port + self.interval_in_seconds = interval_in_seconds + self.number_of_probes = number_of_probes + self.request_path = request_path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address.py index 675a370c97b3..fe0ec1c990bb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address.py @@ -82,14 +82,14 @@ class PublicIPAddress(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address=None, idle_timeout_in_minutes=None, resource_guid=None, provisioning_state=None, etag=None): - super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags) - self.public_ip_allocation_method = public_ip_allocation_method - self.public_ip_address_version = public_ip_address_version + def __init__(self, **kwargs): + super(PublicIPAddress, self).__init__(**kwargs) + self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) + self.public_ip_address_version = kwargs.get('public_ip_address_version', None) self.ip_configuration = None - self.dns_settings = dns_settings - self.ip_address = ip_address - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_address = kwargs.get('ip_address', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address_dns_settings.py index a248461f05d7..07dfe30433a6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address_dns_settings.py @@ -38,8 +38,8 @@ class PublicIPAddressDnsSettings(Model): 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, } - def __init__(self, domain_name_label=None, fqdn=None, reverse_fqdn=None): - super(PublicIPAddressDnsSettings, self).__init__() - self.domain_name_label = domain_name_label - self.fqdn = fqdn - self.reverse_fqdn = reverse_fqdn + def __init__(self, **kwargs): + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) + self.fqdn = kwargs.get('fqdn', None) + self.reverse_fqdn = kwargs.get('reverse_fqdn', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address_dns_settings_py3.py new file mode 100644 index 000000000000..e84aa9c10bf5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address_dns_settings_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressDnsSettings(Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :param domain_name_label: Gets or sets the Domain name label.The + concatenation of the domain name label and the regionalized DNS zone make + up the fully qualified domain name associated with the public IP address. + If a domain name label is specified, an A DNS record is created for the + public IP in the Microsoft Azure DNS system. + :type domain_name_label: str + :param fqdn: Gets the FQDN, Fully qualified domain name of the A DNS + record associated with the public IP. This is the concatenation of the + domainNameLabel and the regionalized DNS zone. + :type fqdn: str + :param reverse_fqdn: Gets or Sets the Reverse FQDN. A user-visible, fully + qualified domain name that resolves to this public IP address. If the + reverseFqdn is specified, then a PTR DNS record is created pointing from + the IP address in the in-addr.arpa domain to the reverse FQDN. + :type reverse_fqdn: str + """ + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, + } + + def __init__(self, *, domain_name_label: str=None, fqdn: str=None, reverse_fqdn: str=None, **kwargs) -> None: + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label + self.fqdn = fqdn + self.reverse_fqdn = reverse_fqdn diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address_py3.py new file mode 100644 index 000000000000..1f12d62c1f63 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/public_ip_address_py3.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PublicIPAddress(Resource): + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param public_ip_allocation_method: The public IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type public_ip_allocation_method: str or + ~azure.mgmt.network.v2017_03_01.models.IPAllocationMethod + :param public_ip_address_version: The public IP address version. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + :type public_ip_address_version: str or + ~azure.mgmt.network.v2017_03_01.models.IPVersion + :ivar ip_configuration: + :vartype ip_configuration: + ~azure.mgmt.network.v2017_03_01.models.IPConfiguration + :param dns_settings: The FQDN of the DNS record associated with the public + IP address. + :type dns_settings: + ~azure.mgmt.network.v2017_03_01.models.PublicIPAddressDnsSettings + :param ip_address: + :type ip_address: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param resource_guid: The resource GUID property of the public IP + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address: str=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.public_ip_allocation_method = public_ip_allocation_method + self.public_ip_address_version = public_ip_address_version + self.ip_configuration = None + self.dns_settings = dns_settings + self.ip_address = ip_address + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/query_troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/query_troubleshooting_parameters.py index 9b6801eb7b63..6ae1924916c6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/query_troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/query_troubleshooting_parameters.py @@ -15,7 +15,9 @@ class QueryTroubleshootingParameters(Model): """Parameters that define the resource to query the troubleshooting result. - :param target_resource_id: The target resource ID to query the + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the troubleshooting result. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class QueryTroubleshootingParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(QueryTroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/query_troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/query_troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..b5fccb87857c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/query_troubleshooting_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryTroubleshootingParameters(Model): + """Parameters that define the resource to query the troubleshooting result. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the + troubleshooting result. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource.py index 5dfb000318bf..b12801be9996 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource.py @@ -43,10 +43,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, location=None, tags=None): - super(Resource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource_navigation_link.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource_navigation_link.py index 9b4484be654a..705698f513f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource_navigation_link.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource_navigation_link.py @@ -49,10 +49,10 @@ class ResourceNavigationLink(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, linked_resource_type=None, link=None, name=None): - super(ResourceNavigationLink, self).__init__(id=id) - self.linked_resource_type = linked_resource_type - self.link = link + def __init__(self, **kwargs): + super(ResourceNavigationLink, self).__init__(**kwargs) + self.linked_resource_type = kwargs.get('linked_resource_type', None) + self.link = kwargs.get('link', None) self.provisioning_state = None - self.name = name + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource_navigation_link_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource_navigation_link_py3.py new file mode 100644 index 000000000000..5cb22d347836 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource_navigation_link_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ResourceNavigationLink(SubResource): + """ResourceNavigationLink resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource + :type link: str + :ivar provisioning_state: Provisioning state of the ResourceNavigationLink + resource. + :vartype provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, linked_resource_type: str=None, link: str=None, name: str=None, **kwargs) -> None: + super(ResourceNavigationLink, self).__init__(id=id, **kwargs) + self.linked_resource_type = linked_resource_type + self.link = link + self.provisioning_state = None + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource_py3.py new file mode 100644 index 000000000000..0678b03d46f5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/resource_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/retention_policy_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/retention_policy_parameters.py index 102f4c5c3b4c..28cb43056d47 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/retention_policy_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/retention_policy_parameters.py @@ -26,7 +26,7 @@ class RetentionPolicyParameters(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, days=0, enabled=False): - super(RetentionPolicyParameters, self).__init__() - self.days = days - self.enabled = enabled + def __init__(self, **kwargs): + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = kwargs.get('days', 0) + self.enabled = kwargs.get('enabled', False) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/retention_policy_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/retention_policy_parameters_py3.py new file mode 100644 index 000000000000..3b2ffc5e741e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/retention_policy_parameters_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RetentionPolicyParameters(Model): + """Parameters that define the retention policy for flow log. + + :param days: Number of days to retain flow log records. Default value: 0 . + :type days: int + :param enabled: Flag to enable/disable retention. Default value: False . + :type enabled: bool + """ + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, days: int=0, enabled: bool=False, **kwargs) -> None: + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = days + self.enabled = enabled diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route.py index 67e670a13540..35ab0563d7d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route.py @@ -15,13 +15,15 @@ class Route(SubResource): """Route resource. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param address_prefix: The destination CIDR to which the route applies. :type address_prefix: str - :param next_hop_type: The type of Azure hop the packet should be sent to. - Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - 'VirtualAppliance', and 'None'. Possible values include: + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' :type next_hop_type: str or @@ -55,11 +57,11 @@ class Route(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, next_hop_type, id=None, address_prefix=None, next_hop_ip_address=None, provisioning_state=None, name=None, etag=None): - super(Route, self).__init__(id=id) - self.address_prefix = address_prefix - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(Route, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter.py index 4dc8caf54449..6af20b449bc5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter.py @@ -63,9 +63,9 @@ class RouteFilter(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, rules=None): - super(RouteFilter, self).__init__(id=id, location=location, tags=tags) - self.rules = rules + def __init__(self, **kwargs): + super(RouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) self.peerings = None self.provisioning_state = None self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter_py3.py new file mode 100644 index 000000000000..9cf6fe9facba --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteFilter(Resource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2017_03_01.models.RouteFilterRule] + :ivar peerings: A collection of references to express route circuit + peerings. + :vartype peerings: + list[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'peerings': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, rules=None, **kwargs) -> None: + super(RouteFilter, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.rules = rules + self.peerings = None + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter_rule.py index ca9d87ca74b4..8f2e02e81962 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter_rule.py @@ -18,16 +18,18 @@ class RouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2017_03_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -67,12 +69,12 @@ class RouteFilterRule(SubResource): route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, location=None, tags=None): - super(RouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(RouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None self.name = None - self.location = location + self.location = kwargs.get('location', None) self.etag = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter_rule_py3.py new file mode 100644 index 000000000000..7b568bee9ecf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_filter_rule_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class RouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_03_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :param location: Resource location. + :type location: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(RouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = None + self.location = location + self.etag = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_py3.py new file mode 100644 index 000000000000..752c9c497934 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Route(SubResource): + """Route resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param address_prefix: The destination CIDR to which the route applies. + :type address_prefix: str + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_03_01.models.RouteNextHopType + :param next_hop_ip_address: The IP address packets should be forwarded to. + Next hop values are only allowed in routes where the next hop type is + VirtualAppliance. + :type next_hop_ip_address: str + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'next_hop_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type, id: str=None, address_prefix: str=None, next_hop_ip_address: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Route, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_table.py index 4a2c9d6c9e35..5718c710ace4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_table.py @@ -58,9 +58,9 @@ class RouteTable(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, routes=None, provisioning_state=None, etag=None): - super(RouteTable, self).__init__(id=id, location=location, tags=tags) - self.routes = routes + def __init__(self, **kwargs): + super(RouteTable, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) self.subnets = None - self.provisioning_state = provisioning_state - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_table_py3.py new file mode 100644 index 000000000000..18bbe33258e4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/route_table_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteTable(Resource): + """Route table resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param routes: Collection of routes contained within a route table. + :type routes: list[~azure.mgmt.network.v2017_03_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2017_03_01.models.Subnet] + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'routes': {'key': 'properties.routes', 'type': '[Route]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, routes=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(RouteTable, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.routes = routes + self.subnets = None + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_network_interface.py index b087e727a80c..e8e471837a01 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_network_interface.py @@ -27,7 +27,7 @@ class SecurityGroupNetworkInterface(Model): 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, } - def __init__(self, id=None, security_rule_associations=None): - super(SecurityGroupNetworkInterface, self).__init__() - self.id = id - self.security_rule_associations = security_rule_associations + def __init__(self, **kwargs): + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.security_rule_associations = kwargs.get('security_rule_associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_network_interface_py3.py new file mode 100644 index 000000000000..54aa9157d25d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_network_interface_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupNetworkInterface(Model): + """Network interface and all its associated security rules. + + :param id: ID of the network interface. + :type id: str + :param security_rule_associations: + :type security_rule_associations: + ~azure.mgmt.network.v2017_03_01.models.SecurityRuleAssociations + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, + } + + def __init__(self, *, id: str=None, security_rule_associations=None, **kwargs) -> None: + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = id + self.security_rule_associations = security_rule_associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_parameters.py index 5c0972e5d55e..1d547b0b0e2b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_parameters.py @@ -15,7 +15,9 @@ class SecurityGroupViewParameters(Model): """Parameters that define the VM to check security groups for. - :param target_resource_id: ID of the target VM. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. :type target_resource_id: str """ @@ -27,6 +29,6 @@ class SecurityGroupViewParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(SecurityGroupViewParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_parameters_py3.py new file mode 100644 index 000000000000..7ccc48017444 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_parameters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewParameters(Model): + """Parameters that define the VM to check security groups for. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_result.py index 2fa7b25fef4e..b97fa89ab2b3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_result.py @@ -24,6 +24,6 @@ class SecurityGroupViewResult(Model): 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, } - def __init__(self, network_interfaces=None): - super(SecurityGroupViewResult, self).__init__() - self.network_interfaces = network_interfaces + def __init__(self, **kwargs): + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_result_py3.py new file mode 100644 index 000000000000..842262f9274b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_group_view_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewResult(Model): + """The information about security rules applied to the specified VM. + + :param network_interfaces: List of network interfaces on the specified VM. + :type network_interfaces: + list[~azure.mgmt.network.v2017_03_01.models.SecurityGroupNetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule.py index 182858565f2e..2e3d856f9798 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule.py @@ -15,12 +15,15 @@ class SecurityRule(SubResource): """Network security rule. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param description: A description for this rule. Restricted to 140 chars. :type description: str - :param protocol: Network protocol this rule applies to. Possible values - are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*' + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' :type protocol: str or ~azure.mgmt.network.v2017_03_01.models.SecurityRuleProtocol :param source_port_range: The source port or range. Integer or range @@ -30,18 +33,19 @@ class SecurityRule(SubResource): range between 0 and 65535. Asterix '*' can also be used to match all ports. :type destination_port_range: str - :param source_address_prefix: The CIDR or source IP range. Asterix '*' can - also be used to match all source IPs. Default tags such as + :param source_address_prefix: Required. The CIDR or source IP range. + Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. :type source_address_prefix: str - :param destination_address_prefix: The destination address prefix. CIDR or - source IP range. Asterix '*' can also be used to match all source IPs. - Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - can also be used. + :param destination_address_prefix: Required. The destination address + prefix. CIDR or source IP range. Asterix '*' can also be used to match all + source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. :type destination_address_prefix: str - :param access: The network traffic is allowed or denied. Possible values - are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' :type access: str or ~azure.mgmt.network.v2017_03_01.models.SecurityRuleAccess :param priority: The priority of the rule. The value can be between 100 @@ -49,10 +53,10 @@ class SecurityRule(SubResource): collection. The lower the priority number, the higher the priority of the rule. :type priority: int - :param direction: The direction of the rule. The direction specifies if - rule will be evaluated on incoming or outcoming traffic. Possible values - are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', - 'Outbound' + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2017_03_01.models.SecurityRuleDirection :param provisioning_state: The provisioning state of the public IP @@ -90,17 +94,17 @@ class SecurityRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, source_address_prefix, destination_address_prefix, access, direction, id=None, description=None, source_port_range=None, destination_port_range=None, priority=None, provisioning_state=None, name=None, etag=None): - super(SecurityRule, self).__init__(id=id) - self.description = description - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_address_prefix = source_address_prefix - self.destination_address_prefix = destination_address_prefix - self.access = access - self.priority = priority - self.direction = direction - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(SecurityRule, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule_associations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule_associations.py index 68093e1e8821..f01fc87db1c9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule_associations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule_associations.py @@ -37,9 +37,9 @@ class SecurityRuleAssociations(Model): 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, } - def __init__(self, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None): - super(SecurityRuleAssociations, self).__init__() - self.network_interface_association = network_interface_association - self.subnet_association = subnet_association - self.default_security_rules = default_security_rules - self.effective_security_rules = effective_security_rules + def __init__(self, **kwargs): + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = kwargs.get('network_interface_association', None) + self.subnet_association = kwargs.get('subnet_association', None) + self.default_security_rules = kwargs.get('default_security_rules', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule_associations_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule_associations_py3.py new file mode 100644 index 000000000000..680fe52218b5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule_associations_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityRuleAssociations(Model): + """All security rules associated with the network interface. + + :param network_interface_association: + :type network_interface_association: + ~azure.mgmt.network.v2017_03_01.models.NetworkInterfaceAssociation + :param subnet_association: + :type subnet_association: + ~azure.mgmt.network.v2017_03_01.models.SubnetAssociation + :param default_security_rules: Collection of default security rules of the + network security group. + :type default_security_rules: + list[~azure.mgmt.network.v2017_03_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2017_03_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, + 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, + 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__(self, *, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None, **kwargs) -> None: + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = network_interface_association + self.subnet_association = subnet_association + self.default_security_rules = default_security_rules + self.effective_security_rules = effective_security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule_py3.py new file mode 100644 index 000000000000..1c46ec4630ef --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/security_rule_py3.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class SecurityRule(SubResource): + """Network security rule. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2017_03_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. Integer or range + between 0 and 65535. Asterix '*' can also be used to match all ports. + :type source_port_range: str + :param destination_port_range: The destination port or range. Integer or + range between 0 and 65535. Asterix '*' can also be used to match all + ports. + :type destination_port_range: str + :param source_address_prefix: Required. The CIDR or source IP range. + Asterix '*' can also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + this is an ingress rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param destination_address_prefix: Required. The destination address + prefix. CIDR or source IP range. Asterix '*' can also be used to match all + source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. + :type destination_address_prefix: str + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' + :type access: str or + ~azure.mgmt.network.v2017_03_01.models.SecurityRuleAccess + :param priority: The priority of the rule. The value can be between 100 + and 4096. The priority number must be unique for each rule in the + collection. The lower the priority number, the higher the priority of the + rule. + :type priority: int + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2017_03_01.models.SecurityRuleDirection + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'source_address_prefix': {'required': True}, + 'destination_address_prefix': {'required': True}, + 'access': {'required': True}, + 'direction': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, source_address_prefix: str, destination_address_prefix: str, access, direction, id: str=None, description: str=None, source_port_range: str=None, destination_port_range: str=None, priority: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(SecurityRule, self).__init__(id=id, **kwargs) + self.description = description + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/sub_resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/sub_resource.py index d4a564864add..3210cb8c9187 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/sub_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/sub_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/sub_resource_py3.py new file mode 100644 index 000000000000..25ef1e7dc9a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """SubResource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet.py index f737f07ff5c6..2025753e1023 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet.py @@ -62,13 +62,13 @@ class Subnet(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, address_prefix=None, network_security_group=None, route_table=None, resource_navigation_links=None, provisioning_state=None, name=None, etag=None): - super(Subnet, self).__init__(id=id) - self.address_prefix = address_prefix - self.network_security_group = network_security_group - self.route_table = route_table + def __init__(self, **kwargs): + super(Subnet, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.route_table = kwargs.get('route_table', None) self.ip_configurations = None - self.resource_navigation_links = resource_navigation_links - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.resource_navigation_links = kwargs.get('resource_navigation_links', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet_association.py index db77fe80faad..7ec6aa34bd26 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet_association.py @@ -34,7 +34,7 @@ class SubnetAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(SubnetAssociation, self).__init__() + def __init__(self, **kwargs): + super(SubnetAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet_association_py3.py new file mode 100644 index 000000000000..44db21c61bbe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Subnet ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2017_03_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(SubnetAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet_py3.py new file mode 100644 index 000000000000..b6e0c7ee77b7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/subnet_py3.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Subnet(SubResource): + """Subnet in a virtual network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param address_prefix: The address prefix for the subnet. + :type address_prefix: str + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2017_03_01.models.NetworkSecurityGroup + :param route_table: The reference of the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2017_03_01.models.RouteTable + :ivar ip_configurations: Gets an array of references to the network + interface IP configurations using subnet. + :vartype ip_configurations: + list[~azure.mgmt.network.v2017_03_01.models.IPConfiguration] + :param resource_navigation_links: Gets an array of references to the + external resources using subnet. + :type resource_navigation_links: + list[~azure.mgmt.network.v2017_03_01.models.ResourceNavigationLink] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'ip_configurations': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, + 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, address_prefix: str=None, network_security_group=None, route_table=None, resource_navigation_links=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Subnet, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.network_security_group = network_security_group + self.route_table = route_table + self.ip_configurations = None + self.resource_navigation_links = resource_navigation_links + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology.py index a04a9719a4c6..c134bfbc1908 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology.py @@ -43,9 +43,9 @@ class Topology(Model): 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, } - def __init__(self, resources=None): - super(Topology, self).__init__() + def __init__(self, **kwargs): + super(Topology, self).__init__(**kwargs) self.id = None self.created_date_time = None self.last_modified = None - self.resources = resources + self.resources = kwargs.get('resources', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_association.py index c22998da23f2..73d9406a56fa 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_association.py @@ -33,8 +33,8 @@ class TopologyAssociation(Model): 'association_type': {'key': 'associationType', 'type': 'str'}, } - def __init__(self, name=None, resource_id=None, association_type=None): - super(TopologyAssociation, self).__init__() - self.name = name - self.resource_id = resource_id - self.association_type = association_type + def __init__(self, **kwargs): + super(TopologyAssociation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.resource_id = kwargs.get('resource_id', None) + self.association_type = kwargs.get('association_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_association_py3.py new file mode 100644 index 000000000000..fb90e7a67159 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyAssociation(Model): + """Resources that have an association with the parent resource. + + :param name: The name of the resource that is associated with the parent + resource. + :type name: str + :param resource_id: The ID of the resource that is associated with the + parent resource. + :type resource_id: str + :param association_type: The association type of the child resource to the + parent resource. Possible values include: 'Associated', 'Contains' + :type association_type: str or + ~azure.mgmt.network.v2017_03_01.models.AssociationType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'association_type': {'key': 'associationType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, resource_id: str=None, association_type=None, **kwargs) -> None: + super(TopologyAssociation, self).__init__(**kwargs) + self.name = name + self.resource_id = resource_id + self.association_type = association_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_parameters.py index 04920dc9665d..c7065ef57c09 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_parameters.py @@ -15,8 +15,10 @@ class TopologyParameters(Model): """Parameters that define the representation of topology. - :param target_resource_group_name: The name of the target resource group - to perform topology on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_group_name: Required. The name of the target + resource group to perform topology on. :type target_resource_group_name: str """ @@ -28,6 +30,6 @@ class TopologyParameters(Model): 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, } - def __init__(self, target_resource_group_name): - super(TopologyParameters, self).__init__() - self.target_resource_group_name = target_resource_group_name + def __init__(self, **kwargs): + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = kwargs.get('target_resource_group_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_parameters_py3.py new file mode 100644 index 000000000000..90c2365d8dba --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyParameters(Model): + """Parameters that define the representation of topology. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group_name: Required. The name of the target + resource group to perform topology on. + :type target_resource_group_name: str + """ + + _validation = { + 'target_resource_group_name': {'required': True}, + } + + _attribute_map = { + 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, + } + + def __init__(self, *, target_resource_group_name: str, **kwargs) -> None: + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = target_resource_group_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_py3.py new file mode 100644 index 000000000000..8ae2c29158e1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Topology(Model): + """Topology of the specified resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: GUID representing the operation id. + :vartype id: str + :ivar created_date_time: The datetime when the topology was initially + created for the resource group. + :vartype created_date_time: datetime + :ivar last_modified: The datetime when the topology was last modified. + :vartype last_modified: datetime + :param resources: + :type resources: + list[~azure.mgmt.network.v2017_03_01.models.TopologyResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, + } + + def __init__(self, *, resources=None, **kwargs) -> None: + super(Topology, self).__init__(**kwargs) + self.id = None + self.created_date_time = None + self.last_modified = None + self.resources = resources diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_resource.py index d79800ffcdc7..12cb0fb2a656 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_resource.py @@ -34,9 +34,9 @@ class TopologyResource(Model): 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, } - def __init__(self, name=None, id=None, location=None, associations=None): - super(TopologyResource, self).__init__() - self.name = name - self.id = id - self.location = location - self.associations = associations + def __init__(self, **kwargs): + super(TopologyResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.associations = kwargs.get('associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_resource_py3.py new file mode 100644 index 000000000000..3da7559c744e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/topology_resource_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyResource(Model): + """The network resource topology information for the given resource group. + + :param name: Name of the resource. + :type name: str + :param id: ID of the resource. + :type id: str + :param location: Resource location. + :type location: str + :param associations: Holds the associations the resource has with other + resources in the resource group. + :type associations: + list[~azure.mgmt.network.v2017_03_01.models.TopologyAssociation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, + } + + def __init__(self, *, name: str=None, id: str=None, location: str=None, associations=None, **kwargs) -> None: + super(TopologyResource, self).__init__(**kwargs) + self.name = name + self.id = id + self.location = location + self.associations = associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_details.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_details.py index 057c4a25216f..d8086e0f491a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_details.py @@ -36,10 +36,10 @@ class TroubleshootingDetails(Model): 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, } - def __init__(self, id=None, reason_type=None, summary=None, detail=None, recommended_actions=None): - super(TroubleshootingDetails, self).__init__() - self.id = id - self.reason_type = reason_type - self.summary = summary - self.detail = detail - self.recommended_actions = recommended_actions + def __init__(self, **kwargs): + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.reason_type = kwargs.get('reason_type', None) + self.summary = kwargs.get('summary', None) + self.detail = kwargs.get('detail', None) + self.recommended_actions = kwargs.get('recommended_actions', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_details_py3.py new file mode 100644 index 000000000000..48e4f323b82d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_details_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingDetails(Model): + """Information gained from troubleshooting of specified resource. + + :param id: The id of the get troubleshoot operation. + :type id: str + :param reason_type: Reason type of failure. + :type reason_type: str + :param summary: A summary of troubleshooting. + :type summary: str + :param detail: Details on troubleshooting results. + :type detail: str + :param recommended_actions: List of recommended actions. + :type recommended_actions: + list[~azure.mgmt.network.v2017_03_01.models.TroubleshootingRecommendedActions] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'reason_type': {'key': 'reasonType', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'detail': {'key': 'detail', 'type': 'str'}, + 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, + } + + def __init__(self, *, id: str=None, reason_type: str=None, summary: str=None, detail: str=None, recommended_actions=None, **kwargs) -> None: + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = id + self.reason_type = reason_type + self.summary = summary + self.detail = detail + self.recommended_actions = recommended_actions diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_parameters.py index c4833fb8eeb3..6b11d3eb5ffc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_parameters.py @@ -15,13 +15,15 @@ class TroubleshootingParameters(Model): """Parameters that define the resource to troubleshoot. - :param target_resource_id: The target resource to troubleshoot. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. :type target_resource_id: str - :param storage_id: The ID for the storage account to save the troubleshoot - result. + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. :type storage_id: str - :param storage_path: The path to the blob to save the troubleshoot result - in. + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. :type storage_path: str """ @@ -37,8 +39,8 @@ class TroubleshootingParameters(Model): 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, } - def __init__(self, target_resource_id, storage_id, storage_path): - super(TroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.storage_path = storage_path + def __init__(self, **kwargs): + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..e010b7bdc9de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_parameters_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingParameters(Model): + """Parameters that define the resource to troubleshoot. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. + :type target_resource_id: str + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. + :type storage_id: str + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. + :type storage_path: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'storage_path': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, storage_path: str, **kwargs) -> None: + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.storage_path = storage_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_recommended_actions.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_recommended_actions.py index cbc5e31177c7..be395be4ad54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_recommended_actions.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_recommended_actions.py @@ -34,9 +34,9 @@ class TroubleshootingRecommendedActions(Model): 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, } - def __init__(self, action_id=None, action_text=None, action_uri=None, action_uri_text=None): - super(TroubleshootingRecommendedActions, self).__init__() - self.action_id = action_id - self.action_text = action_text - self.action_uri = action_uri - self.action_uri_text = action_uri_text + def __init__(self, **kwargs): + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = kwargs.get('action_id', None) + self.action_text = kwargs.get('action_text', None) + self.action_uri = kwargs.get('action_uri', None) + self.action_uri_text = kwargs.get('action_uri_text', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_recommended_actions_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_recommended_actions_py3.py new file mode 100644 index 000000000000..05c3f654353b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_recommended_actions_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingRecommendedActions(Model): + """Recommended actions based on discovered issues. + + :param action_id: ID of the recommended action. + :type action_id: str + :param action_text: Description of recommended actions. + :type action_text: str + :param action_uri: The uri linking to a documentation for the recommended + troubleshooting actions. + :type action_uri: str + :param action_uri_text: The information from the URI for the recommended + troubleshooting actions. + :type action_uri_text: str + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'action_text': {'key': 'actionText', 'type': 'str'}, + 'action_uri': {'key': 'actionUri', 'type': 'str'}, + 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, + } + + def __init__(self, *, action_id: str=None, action_text: str=None, action_uri: str=None, action_uri_text: str=None, **kwargs) -> None: + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = action_id + self.action_text = action_text + self.action_uri = action_uri + self.action_uri_text = action_uri_text diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_result.py index 328f46d80e31..8f70b405c67b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_result.py @@ -33,9 +33,9 @@ class TroubleshootingResult(Model): 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, } - def __init__(self, start_time=None, end_time=None, code=None, results=None): - super(TroubleshootingResult, self).__init__() - self.start_time = start_time - self.end_time = end_time - self.code = code - self.results = results + def __init__(self, **kwargs): + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.code = kwargs.get('code', None) + self.results = kwargs.get('results', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_result_py3.py new file mode 100644 index 000000000000..028ba7c4d8f7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/troubleshooting_result_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingResult(Model): + """Troubleshooting information gained from specified resource. + + :param start_time: The start time of the troubleshooting. + :type start_time: datetime + :param end_time: The end time of the troubleshooting. + :type end_time: datetime + :param code: The result code of the troubleshooting. + :type code: str + :param results: Information from troubleshooting. + :type results: + list[~azure.mgmt.network.v2017_03_01.models.TroubleshootingDetails] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, + } + + def __init__(self, *, start_time=None, end_time=None, code: str=None, results=None, **kwargs) -> None: + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.code = code + self.results = results diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/tunnel_connection_health.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/tunnel_connection_health.py index 013e8abf31a4..6fa96d9095c8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/tunnel_connection_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/tunnel_connection_health.py @@ -52,8 +52,8 @@ class TunnelConnectionHealth(Model): 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, } - def __init__(self): - super(TunnelConnectionHealth, self).__init__() + def __init__(self, **kwargs): + super(TunnelConnectionHealth, self).__init__(**kwargs) self.tunnel = None self.connection_status = None self.ingress_bytes_transferred = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/tunnel_connection_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/tunnel_connection_health_py3.py new file mode 100644 index 000000000000..7c305d85486b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/tunnel_connection_health_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TunnelConnectionHealth(Model): + """VirtualNetworkGatewayConnection properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tunnel: Tunnel name. + :vartype tunnel: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values include: 'Unknown', 'Connecting', 'Connected', + 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayConnectionStatus + :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this + connection + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: The Egress Bytes Transferred in this + connection + :vartype egress_bytes_transferred: long + :ivar last_connection_established_utc_time: The time at which connection + was established in Utc format. + :vartype last_connection_established_utc_time: str + """ + + _validation = { + 'tunnel': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'last_connection_established_utc_time': {'readonly': True}, + } + + _attribute_map = { + 'tunnel': {'key': 'tunnel', 'type': 'str'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TunnelConnectionHealth, self).__init__(**kwargs) + self.tunnel = None + self.connection_status = None + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.last_connection_established_utc_time = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage.py index 2582daae4dcc..67df48f30dff 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage.py @@ -18,14 +18,16 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar unit: An enum describing the unit of measurement. Default value: - "Count" . + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . :vartype unit: str - :param current_value: The current value of the usage. + :param current_value: Required. The current value of the usage. :type current_value: long - :param limit: The limit of usage. + :param limit: Required. The limit of usage. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.network.v2017_03_01.models.UsageName """ @@ -45,8 +47,8 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() - self.current_value = current_value - self.limit = limit - self.name = name + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage_name.py index df7f344bfb9b..bd1813944fdc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage_name_py3.py new file mode 100644 index 000000000000..4e5e3e10de15 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage_py3.py new file mode 100644 index 000000000000..484f0b6dab56 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes network resource usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . + :vartype unit: str + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.network.v2017_03_01.models.UsageName + """ + + _validation = { + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_parameters.py index f6f436c1ad60..e9b097e9f71a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_parameters.py @@ -15,28 +15,30 @@ class VerificationIPFlowParameters(Model): """Parameters that define the IP flow to be verified. - :param target_resource_id: The ID of the target resource to perform - next-hop on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. :type target_resource_id: str - :param direction: The direction of the packet represented as a 5-tuple. - Possible values include: 'Inbound', 'Outbound' + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2017_03_01.models.Direction - :param protocol: Protocol to be verified on. Possible values include: - 'TCP', 'UDP' + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' :type protocol: str or ~azure.mgmt.network.v2017_03_01.models.Protocol - :param local_port: The local port. Acceptable values are a single integer - in the range (0-65535). Support for * for the source port, which depends - on the direction. + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type local_port: str - :param remote_port: The remote port. Acceptable values are a single - integer in the range (0-65535). Support for * for the source port, which - depends on the direction. + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type remote_port: str - :param local_ip_address: The local IP address. Acceptable values are valid - IPv4 addresses. + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. :type local_ip_address: str - :param remote_ip_address: The remote IP address. Acceptable values are - valid IPv4 addresses. + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. :type remote_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be @@ -65,13 +67,13 @@ class VerificationIPFlowParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, direction, protocol, local_port, remote_port, local_ip_address, remote_ip_address, target_nic_resource_id=None): - super(VerificationIPFlowParameters, self).__init__() - self.target_resource_id = target_resource_id - self.direction = direction - self.protocol = protocol - self.local_port = local_port - self.remote_port = remote_port - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.direction = kwargs.get('direction', None) + self.protocol = kwargs.get('protocol', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_parameters_py3.py new file mode 100644 index 000000000000..aff5e0aa0b90 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_parameters_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowParameters(Model): + """Parameters that define the IP flow to be verified. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. + :type target_resource_id: str + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' + :type direction: str or ~azure.mgmt.network.v2017_03_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' + :type protocol: str or ~azure.mgmt.network.v2017_03_01.models.Protocol + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type local_port: str + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type remote_port: str + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. + :type local_ip_address: str + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. + :type remote_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of them, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'local_port': {'required': True}, + 'remote_port': {'required': True}, + 'local_ip_address': {'required': True}, + 'remote_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, direction, protocol, local_port: str, remote_port: str, local_ip_address: str, remote_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.direction = direction + self.protocol = protocol + self.local_port = local_port + self.remote_port = remote_port + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_result.py index 9cd06048a358..5cf740485586 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_result.py @@ -28,7 +28,7 @@ class VerificationIPFlowResult(Model): 'rule_name': {'key': 'ruleName', 'type': 'str'}, } - def __init__(self, access=None, rule_name=None): - super(VerificationIPFlowResult, self).__init__() - self.access = access - self.rule_name = rule_name + def __init__(self, **kwargs): + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.rule_name = kwargs.get('rule_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_result_py3.py new file mode 100644 index 000000000000..d2ec9de63f88 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/verification_ip_flow_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowResult(Model): + """Results of IP flow verification on the target resource. + + :param access: Indicates whether the traffic is allowed or denied. + Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_03_01.models.Access + :param rule_name: Name of the rule. If input is not matched against any + security rule, it is not displayed. + :type rule_name: str + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + } + + def __init__(self, *, access=None, rule_name: str=None, **kwargs) -> None: + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = access + self.rule_name = rule_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network.py index f146545b905a..9b275c04ad37 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network.py @@ -70,12 +70,12 @@ class VirtualNetwork(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid=None, provisioning_state=None, etag=None): - super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags) - self.address_space = address_space - self.dhcp_options = dhcp_options - self.subnets = subnets - self.virtual_network_peerings = virtual_network_peerings - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetwork, self).__init__(**kwargs) + self.address_space = kwargs.get('address_space', None) + self.dhcp_options = kwargs.get('dhcp_options', None) + self.subnets = kwargs.get('subnets', None) + self.virtual_network_peerings = kwargs.get('virtual_network_peerings', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway.py index 3cd78abd12ed..5b82d30ec28a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway.py @@ -98,17 +98,17 @@ class VirtualNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp=None, active_active=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid=None, etag=None): - super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.ip_configurations = ip_configurations - self.gateway_type = gateway_type - self.vpn_type = vpn_type - self.enable_bgp = enable_bgp - self.active_active = active_active - self.gateway_default_site = gateway_default_site - self.sku = sku - self.vpn_client_configuration = vpn_client_configuration - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(VirtualNetworkGateway, self).__init__(**kwargs) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.gateway_type = kwargs.get('gateway_type', None) + self.vpn_type = kwargs.get('vpn_type', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.active_active = kwargs.get('active_active', None) + self.gateway_default_site = kwargs.get('gateway_default_site', None) + self.sku = kwargs.get('sku', None) + self.vpn_client_configuration = kwargs.get('vpn_client_configuration', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_connection.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_connection.py index 105495d01f83..b8bb11d26166 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_connection.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_connection.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayConnection(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -30,7 +32,7 @@ class VirtualNetworkGatewayConnection(Resource): :type tags: dict[str, str] :param authorization_key: The authorizationKey. :type authorization_key: str - :param virtual_network_gateway1: + :param virtual_network_gateway1: Required. :type virtual_network_gateway1: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway :param virtual_network_gateway2: @@ -39,8 +41,8 @@ class VirtualNetworkGatewayConnection(Resource): :param local_network_gateway2: :type local_network_gateway2: ~azure.mgmt.network.v2017_03_01.models.LocalNetworkGateway - :param connection_type: Gateway connection type. Possible values are: - 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' :type connection_type: str or ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayConnectionType @@ -125,23 +127,23 @@ class VirtualNetworkGatewayConnection(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, virtual_network_gateway1, connection_type, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight=None, shared_key=None, peer=None, enable_bgp=None, use_policy_based_traffic_selectors=None, ipsec_policies=None, resource_guid=None, etag=None): - super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnection, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) self.connection_status = None self.tunnel_connection_status = None self.egress_bytes_transferred = None self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors - self.ipsec_policies = ipsec_policies - self.resource_guid = resource_guid + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_connection_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_connection_py3.py new file mode 100644 index 000000000000..8b13cf677fce --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_connection_py3.py @@ -0,0 +1,149 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnection(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: + :type virtual_network_gateway2: + ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway + :param local_network_gateway2: + :type local_network_gateway2: + ~azure.mgmt.network.v2017_03_01.models.LocalNetworkGateway + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2017_03_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2017_03_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2017_03_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, use_policy_based_traffic_selectors: bool=None, ipsec_policies=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_ip_configuration.py index f9f0802020ab..28273b85ce5e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_ip_configuration.py @@ -55,11 +55,11 @@ class VirtualNetworkGatewayIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name=None, etag=None): - super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id) - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address + def __init__(self, **kwargs): + super(VirtualNetworkGatewayIPConfiguration, self).__init__(**kwargs) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..50a787e6b122 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_ip_configuration_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_03_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_03_01.models.SubResource + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :ivar provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_py3.py new file mode 100644 index 000000000000..fa8d489d6033 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_py3.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param ip_configurations: IP configurations for virtual network gateway. + :type ip_configurations: + list[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible + values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', + 'ExpressRoute' + :type gateway_type: str or + ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayType + :param vpn_type: The type of this virtual network gateway. Possible values + are: 'PolicyBased' and 'RouteBased'. Possible values include: + 'PolicyBased', 'RouteBased' + :type vpn_type: str or ~azure.mgmt.network.v2017_03_01.models.VpnType + :param enable_bgp: Whether BGP is enabled for this virtual network gateway + or not. + :type enable_bgp: bool + :param active_active: ActiveActive flag + :type active_active: bool + :param gateway_default_site: The reference of the LocalNetworkGateway + resource which represents local network site having default routes. Assign + Null value in case of removing existing default site setting. + :type gateway_default_site: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param sku: The reference of the VirtualNetworkGatewaySku resource which + represents the SKU selected for Virtual network gateway. + :type sku: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewaySku + :param vpn_client_configuration: The reference of the + VpnClientConfiguration resource which represents the P2S VpnClient + configurations. + :type vpn_client_configuration: + ~azure.mgmt.network.v2017_03_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2017_03_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + VirtualNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGateway resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, + 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, + 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'active_active': {'key': 'properties.activeActive', 'type': 'bool'}, + 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, + 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, + 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp: bool=None, active_active: bool=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.ip_configurations = ip_configurations + self.gateway_type = gateway_type + self.vpn_type = vpn_type + self.enable_bgp = enable_bgp + self.active_active = active_active + self.gateway_default_site = gateway_default_site + self.sku = sku + self.vpn_client_configuration = vpn_client_configuration + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_sku.py index c1a7139dce00..92755d65f8ce 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_sku.py @@ -35,8 +35,8 @@ class VirtualNetworkGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(VirtualNetworkGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_sku_py3.py new file mode 100644 index 000000000000..f35aa1d9ddd5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_gateway_sku_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkGatewaySku(Model): + """VirtualNetworkGatewaySku details. + + :param name: Gateway SKU name. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type name: str or + ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewaySkuName + :param tier: Gateway SKU tier. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type tier: str or + ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewaySkuTier + :param capacity: The capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_peering.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_peering.py index fbf95650a3ab..04102d3ad22a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_peering.py @@ -65,14 +65,14 @@ class VirtualNetworkPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, allow_virtual_network_access=None, allow_forwarded_traffic=None, allow_gateway_transit=None, use_remote_gateways=None, remote_virtual_network=None, peering_state=None, provisioning_state=None, name=None, etag=None): - super(VirtualNetworkPeering, self).__init__(id=id) - self.allow_virtual_network_access = allow_virtual_network_access - self.allow_forwarded_traffic = allow_forwarded_traffic - self.allow_gateway_transit = allow_gateway_transit - self.use_remote_gateways = use_remote_gateways - self.remote_virtual_network = remote_virtual_network - self.peering_state = peering_state - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetworkPeering, self).__init__(**kwargs) + self.allow_virtual_network_access = kwargs.get('allow_virtual_network_access', None) + self.allow_forwarded_traffic = kwargs.get('allow_forwarded_traffic', None) + self.allow_gateway_transit = kwargs.get('allow_gateway_transit', None) + self.use_remote_gateways = kwargs.get('use_remote_gateways', None) + self.remote_virtual_network = kwargs.get('remote_virtual_network', None) + self.peering_state = kwargs.get('peering_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_peering_py3.py new file mode 100644 index 000000000000..3ab4316efc18 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_peering_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkPeering(SubResource): + """Peerings in a virtual network resource. + + :param id: Resource ID. + :type id: str + :param allow_virtual_network_access: Whether the VMs in the linked virtual + network space would be able to access all the VMs in local Virtual network + space. + :type allow_virtual_network_access: bool + :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs + in the remote virtual network will be allowed/disallowed. + :type allow_forwarded_traffic: bool + :param allow_gateway_transit: If gateway links can be used in remote + virtual networking to link to this virtual network. + :type allow_gateway_transit: bool + :param use_remote_gateways: If remote gateways can be used on this virtual + network. If the flag is set to true, and allowGatewayTransit on remote + peering is also true, virtual network will use gateways of remote virtual + network for transit. Only one peering can have this flag set to true. This + flag cannot be set if virtual network already has a gateway. + :type use_remote_gateways: bool + :param remote_virtual_network: The reference of the remote virtual + network. + :type remote_virtual_network: + ~azure.mgmt.network.v2017_03_01.models.SubResource + :param peering_state: The status of the virtual network peering. Possible + values are 'Initiated', 'Connected', and 'Disconnected'. Possible values + include: 'Initiated', 'Connected', 'Disconnected' + :type peering_state: str or + ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkPeeringState + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, + 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, + 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, + 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, allow_virtual_network_access: bool=None, allow_forwarded_traffic: bool=None, allow_gateway_transit: bool=None, use_remote_gateways: bool=None, remote_virtual_network=None, peering_state=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkPeering, self).__init__(id=id, **kwargs) + self.allow_virtual_network_access = allow_virtual_network_access + self.allow_forwarded_traffic = allow_forwarded_traffic + self.allow_gateway_transit = allow_gateway_transit + self.use_remote_gateways = use_remote_gateways + self.remote_virtual_network = remote_virtual_network + self.peering_state = peering_state + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_py3.py new file mode 100644 index 000000000000..da82362ffb62 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetwork(Resource): + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param address_space: The AddressSpace that contains an array of IP + address ranges that can be used by subnets. + :type address_space: ~azure.mgmt.network.v2017_03_01.models.AddressSpace + :param dhcp_options: The dhcpOptions that contains an array of DNS servers + available to VMs deployed in the virtual network. + :type dhcp_options: ~azure.mgmt.network.v2017_03_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2017_03_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkPeering] + :param resource_guid: The resourceGuid property of the Virtual Network + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.address_space = address_space + self.dhcp_options = dhcp_options + self.subnets = subnets + self.virtual_network_peerings = virtual_network_peerings + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage.py index 512ae10790e0..30193f6c6d99 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage.py @@ -47,8 +47,8 @@ class VirtualNetworkUsage(Model): 'unit': {'key': 'unit', 'type': 'str'}, } - def __init__(self): - super(VirtualNetworkUsage, self).__init__() + def __init__(self, **kwargs): + super(VirtualNetworkUsage, self).__init__(**kwargs) self.current_value = None self.id = None self.limit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage_name.py index 01fcbf0875eb..607ccec3b964 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage_name.py @@ -34,7 +34,7 @@ class VirtualNetworkUsageName(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self): - super(VirtualNetworkUsageName, self).__init__() + def __init__(self, **kwargs): + super(VirtualNetworkUsageName, self).__init__(**kwargs) self.localized_value = None self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage_name_py3.py new file mode 100644 index 000000000000..1651ebda7e77 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage_name_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsageName(Model): + """Usage strings container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar localized_value: Localized subnet size and usage string. + :vartype localized_value: str + :ivar value: Subnet size and usage string. + :vartype value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsageName, self).__init__(**kwargs) + self.localized_value = None + self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage_py3.py new file mode 100644 index 000000000000..6719965f11f9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_usage_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsage(Model): + """Usage details for subnet. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar current_value: Indicates number of IPs used from the Subnet. + :vartype current_value: float + :ivar id: Subnet identifier. + :vartype id: str + :ivar limit: Indicates the size of the subnet. + :vartype limit: float + :ivar name: The name containing common and localized value for usage. + :vartype name: + ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkUsageName + :ivar unit: Usage units. Returns 'Count' + :vartype unit: str + """ + + _validation = { + 'current_value': {'readonly': True}, + 'id': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'name': {'key': 'name', 'type': 'VirtualNetworkUsageName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsage, self).__init__(**kwargs) + self.current_value = None + self.id = None + self.limit = None + self.name = None + self.unit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_configuration.py index a008ff357486..4de441359361 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_configuration.py @@ -35,8 +35,8 @@ class VpnClientConfiguration(Model): 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, } - def __init__(self, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None): - super(VpnClientConfiguration, self).__init__() - self.vpn_client_address_pool = vpn_client_address_pool - self.vpn_client_root_certificates = vpn_client_root_certificates - self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + def __init__(self, **kwargs): + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = kwargs.get('vpn_client_address_pool', None) + self.vpn_client_root_certificates = kwargs.get('vpn_client_root_certificates', None) + self.vpn_client_revoked_certificates = kwargs.get('vpn_client_revoked_certificates', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_configuration_py3.py new file mode 100644 index 000000000000..24d3c344f939 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_configuration_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientConfiguration(Model): + """VpnClientConfiguration for P2S client. + + :param vpn_client_address_pool: The reference of the address space + resource which represents Address space for P2S VpnClient. + :type vpn_client_address_pool: + ~azure.mgmt.network.v2017_03_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual + network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2017_03_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for + Virtual network gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2017_03_01.models.VpnClientRevokedCertificate] + """ + + _attribute_map = { + 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, + 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, + } + + def __init__(self, *, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, **kwargs) -> None: + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = vpn_client_address_pool + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_parameters.py index 57fcd9146f10..857b66fd970e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_parameters.py @@ -15,8 +15,11 @@ class VpnClientParameters(Model): """Vpn Client Parameters for package generation. - :param processor_architecture: VPN client Processor Architecture. Possible - values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' + All required parameters must be populated in order to send to Azure. + + :param processor_architecture: Required. VPN client Processor + Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + include: 'Amd64', 'X86' :type processor_architecture: str or ~azure.mgmt.network.v2017_03_01.models.ProcessorArchitecture """ @@ -29,6 +32,6 @@ class VpnClientParameters(Model): 'processor_architecture': {'key': 'processorArchitecture', 'type': 'str'}, } - def __init__(self, processor_architecture): - super(VpnClientParameters, self).__init__() - self.processor_architecture = processor_architecture + def __init__(self, **kwargs): + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = kwargs.get('processor_architecture', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_parameters_py3.py new file mode 100644 index 000000000000..6842568e084f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_parameters_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientParameters(Model): + """Vpn Client Parameters for package generation. + + All required parameters must be populated in order to send to Azure. + + :param processor_architecture: Required. VPN client Processor + Architecture. Possible values are: 'AMD64' and 'X86'. Possible values + include: 'Amd64', 'X86' + :type processor_architecture: str or + ~azure.mgmt.network.v2017_03_01.models.ProcessorArchitecture + """ + + _validation = { + 'processor_architecture': {'required': True}, + } + + _attribute_map = { + 'processor_architecture': {'key': 'processorArchitecture', 'type': 'str'}, + } + + def __init__(self, *, processor_architecture, **kwargs) -> None: + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = processor_architecture diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_revoked_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_revoked_certificate.py index ebd6a4bbba2f..1fa6f6a1ef23 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_revoked_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_revoked_certificate.py @@ -46,9 +46,9 @@ class VpnClientRevokedCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, thumbprint=None, name=None, etag=None): - super(VpnClientRevokedCertificate, self).__init__(id=id) - self.thumbprint = thumbprint + def __init__(self, **kwargs): + super(VpnClientRevokedCertificate, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_revoked_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_revoked_certificate_py3.py new file mode 100644 index 000000000000..7c1e05f283a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_revoked_certificate_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + :ivar provisioning_state: The provisioning state of the VPN client revoked + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, thumbprint: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRevokedCertificate, self).__init__(id=id, **kwargs) + self.thumbprint = thumbprint + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_root_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_root_certificate.py index 6d820d3a8c11..48c7033d42ec 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_root_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_root_certificate.py @@ -18,9 +18,11 @@ class VpnClientRootCertificate(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param public_cert_data: The certificate public data. + :param public_cert_data: Required. The certificate public data. :type public_cert_data: str :ivar provisioning_state: The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and @@ -47,9 +49,9 @@ class VpnClientRootCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, public_cert_data, id=None, name=None, etag=None): - super(VpnClientRootCertificate, self).__init__(id=id) - self.public_cert_data = public_cert_data + def __init__(self, **kwargs): + super(VpnClientRootCertificate, self).__init__(**kwargs) + self.public_cert_data = kwargs.get('public_cert_data', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_root_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_root_certificate_py3.py new file mode 100644 index 000000000000..db8a1e547705 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/vpn_client_root_certificate_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param public_cert_data: Required. The certificate public data. + :type public_cert_data: str + :ivar provisioning_state: The provisioning state of the VPN client root + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'public_cert_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, public_cert_data: str, id: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRootCertificate, self).__init__(id=id, **kwargs) + self.public_cert_data = public_cert_data + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/network_management_client.py index 0c398e6d1586..9b7710270611 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/network_management_client.py @@ -15,7 +15,8 @@ from .version import VERSION from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.application_gateways_operations import ApplicationGatewaysOperations from .operations.express_route_circuit_authorizations_operations import ExpressRouteCircuitAuthorizationsOperations @@ -227,7 +228,7 @@ def check_dns_name_availability( api_version = "2017-03-01" # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability' + url = self.check_dns_name_availability.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -269,3 +270,4 @@ def check_dns_name_availability( return client_raw_response return deserialized + check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/application_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/application_gateways_operations.py index bd790aa4bb47..1e19d5cb011d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/application_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/application_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ApplicationGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def get( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def _create_or_update_initial( self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_03_01.models.ApplicationGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.ApplicationGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.ApplicationGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ApplicationGateway', response) if raw: @@ -312,12 +276,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -339,7 +305,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -385,6 +351,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -404,7 +371,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -449,12 +416,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} def _start_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -490,7 +458,7 @@ def _start_initial( return client_raw_response def start( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -498,12 +466,14 @@ def start( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -513,46 +483,26 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} def _stop_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -588,7 +538,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -596,12 +546,14 @@ def stop( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -611,46 +563,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} def _backend_health_initial( self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth' + url = self.backend_health.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -695,7 +627,7 @@ def _backend_health_initial( return deserialized def backend_health( - self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the backend health of the specified application gateway in a resource group. @@ -707,13 +639,17 @@ def backend_health( referenced in backend health. :type expand: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGatewayBackendHealth or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApplicationGatewayBackendHealth or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendHealth] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.ApplicationGatewayBackendHealth]] :raises: :class:`CloudError` """ raw_result = self._backend_health_initial( @@ -724,30 +660,8 @@ def backend_health( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ApplicationGatewayBackendHealth', response) if raw: @@ -756,12 +670,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} def list_available_waf_rule_sets( self, custom_headers=None, raw=False, **operation_config): @@ -780,7 +696,7 @@ def list_available_waf_rule_sets( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets' + url = self.list_available_waf_rule_sets.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -819,3 +735,4 @@ def list_available_waf_rule_sets( return client_raw_response return deserialized + list_available_waf_rule_sets.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/bgp_service_communities_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/bgp_service_communities_operations.py index 2c1c895f9830..78dcf1ea90cb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/bgp_service_communities_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/bgp_service_communities_operations.py @@ -22,7 +22,7 @@ class BgpServiceCommunitiesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_circuit_authorizations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_circuit_authorizations_operations.py index b7b3159990a2..6e495e596ba7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_circuit_authorizations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_circuit_authorizations_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified authorization from the specified express route circuit. @@ -91,12 +91,14 @@ def delete( :param authorization_name: The name of the authorization. :type authorization_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def get( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): @@ -166,7 +148,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an authorization in the specified express route circuit. @@ -278,13 +261,17 @@ def create_or_update( :type authorization_parameters: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitAuthorization :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitAuthorization or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitAuthorization or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitAuthorization] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitAuthorization]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -296,30 +283,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitAuthorization', response) if raw: @@ -328,12 +293,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +324,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -404,3 +371,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_circuit_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_circuit_peerings_operations.py index 921319db48e7..cb154c9cb410 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_circuit_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_circuit_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param peering_name: The name of the peering. :type peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def get( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -275,13 +258,17 @@ def create_or_update( :type peering_parameters: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitPeering or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitPeering', response) if raw: @@ -325,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -401,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_circuits_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_circuits_operations.py index 4325be483d6b..52cc8d3f1f53 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_circuits_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_circuits_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param circuit_name: The name of the express route circuit. :type circuit_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def get( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuit :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuit or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuit] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuit]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuit', response) if raw: @@ -312,18 +276,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _list_arp_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}' + url = self.list_arp_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -368,7 +334,7 @@ def _list_arp_table_initial( return deserialized def list_arp_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -381,14 +347,17 @@ def list_arp_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsArpTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsArpTableListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitsArpTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitsArpTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_arp_table_initial( @@ -400,30 +369,8 @@ def list_arp_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', response) if raw: @@ -432,18 +379,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} def _list_routes_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}' + url = self.list_routes_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -488,7 +437,7 @@ def _list_routes_table_initial( return deserialized def list_routes_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -501,14 +450,18 @@ def list_routes_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitsRoutesTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitsRoutesTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_initial( @@ -520,30 +473,8 @@ def list_routes_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', response) if raw: @@ -552,18 +483,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} def _list_routes_table_summary_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}' + url = self.list_routes_table_summary.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -608,7 +541,7 @@ def _list_routes_table_summary_initial( return deserialized def list_routes_table_summary( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -621,14 +554,18 @@ def list_routes_table_summary( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableSummaryListResult or ClientRawResponse - if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableSummaryListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_summary_initial( @@ -640,30 +577,8 @@ def list_routes_table_summary( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', response) if raw: @@ -672,12 +587,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} def get_stats( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -699,7 +616,7 @@ def get_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats' + url = self.get_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -740,6 +657,7 @@ def get_stats( return client_raw_response return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} def get_peering_stats( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -763,7 +681,7 @@ def get_peering_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats' + url = self.get_peering_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -805,6 +723,7 @@ def get_peering_stats( return client_raw_response return deserialized + get_peering_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -826,7 +745,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -872,6 +791,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -891,7 +811,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -936,3 +856,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_service_providers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_service_providers_operations.py index 56632a1f965b..7b1728569782 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_service_providers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/express_route_service_providers_operations.py @@ -22,7 +22,7 @@ class ExpressRouteServiceProvidersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/load_balancers_operations.py index 821a16731734..977bafe03604 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/load_balancers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param load_balancer_name: The name of the load balancer. :type load_balancer_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def get( self, resource_group_name, load_balancer_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( balancer operation. :type parameters: ~azure.mgmt.network.v2017_03_01.models.LoadBalancer :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns LoadBalancer - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.LoadBalancer] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.LoadBalancer]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LoadBalancer', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -340,7 +306,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -385,6 +351,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -406,7 +373,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -452,3 +419,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/local_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/local_network_gateways_operations.py index 35269a7aa139..671327420a16 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/local_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/local_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LocalNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a local network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_03_01.models.LocalNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - LocalNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.LocalNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.LocalNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LocalNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def get( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def _delete_initial( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type local_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +309,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -389,3 +355,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/network_interfaces_operations.py index 934f82ce8c1d..95a4cf477174 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/network_interfaces_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ models = models @@ -43,7 +43,7 @@ def _delete_initial( api_version = "2017-03-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def get( self, resource_group_name, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( api_version = "2017-03-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -203,6 +185,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def _create_or_update_initial( @@ -210,7 +193,7 @@ def _create_or_update_initial( api_version = "2017-03-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_03_01.models.NetworkInterface :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkInterface or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.NetworkInterface] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.NetworkInterface]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkInterface', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -347,7 +313,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -392,6 +358,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -415,7 +382,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -461,6 +428,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} def _get_effective_route_table_initial( @@ -468,7 +436,7 @@ def _get_effective_route_table_initial( api_version = "2017-03-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable' + url = self.get_effective_route_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -511,7 +479,7 @@ def _get_effective_route_table_initial( return deserialized def get_effective_route_table( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -519,13 +487,17 @@ def get_effective_route_table( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveRouteListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.EffectiveRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.EffectiveRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_effective_route_table_initial( @@ -535,30 +507,8 @@ def get_effective_route_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveRouteListResult', response) if raw: @@ -567,12 +517,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_effective_route_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} def _list_effective_network_security_groups_initial( @@ -580,7 +532,7 @@ def _list_effective_network_security_groups_initial( api_version = "2017-03-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups' + url = self.list_effective_network_security_groups.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -623,7 +575,7 @@ def _list_effective_network_security_groups_initial( return deserialized def list_effective_network_security_groups( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -631,14 +583,18 @@ def list_effective_network_security_groups( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveNetworkSecurityGroupListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveNetworkSecurityGroupListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.EffectiveNetworkSecurityGroupListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.EffectiveNetworkSecurityGroupListResult]] :raises: :class:`CloudError` """ raw_result = self._list_effective_network_security_groups_initial( @@ -648,30 +604,8 @@ def list_effective_network_security_groups( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', response) if raw: @@ -680,12 +614,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_effective_network_security_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} def list_virtual_machine_scale_set_vm_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, custom_headers=None, raw=False, **operation_config): @@ -715,7 +651,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces' + url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -763,6 +699,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} def list_virtual_machine_scale_set_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -789,7 +726,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces' + url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -836,6 +773,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} def get_virtual_machine_scale_set_network_interface( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -865,7 +803,7 @@ def get_virtual_machine_scale_set_network_interface( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}' + url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -910,3 +848,4 @@ def get_virtual_machine_scale_set_network_interface( return client_raw_response return deserialized + get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/network_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/network_security_groups_operations.py index 8691b1d3a709..5b588c36029c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/network_security_groups_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/network_security_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkSecurityGroupsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -88,12 +88,14 @@ def delete( group. :type network_security_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -103,40 +105,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def get( self, resource_group_name, network_security_group_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -203,12 +185,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -257,7 +240,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network security group in the specified resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_03_01.models.NetworkSecurityGroup :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.NetworkSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.NetworkSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkSecurityGroup', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -345,7 +311,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -390,6 +356,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -411,7 +378,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -457,3 +424,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/network_watchers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/network_watchers_operations.py index 2a02978443c1..610a8c469045 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/network_watchers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/network_watchers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkWatchersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -62,7 +62,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -109,6 +109,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def get( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -170,12 +171,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def _delete_initial( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -211,7 +213,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -219,12 +221,14 @@ def delete( :param network_watcher_name: The name of the network watcher. :type network_watcher_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -234,40 +238,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -289,7 +273,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -335,6 +319,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -354,7 +339,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -399,6 +384,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'} def get_topology( self, resource_group_name, network_watcher_name, target_resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -424,7 +410,7 @@ def get_topology( parameters = models.TopologyParameters(target_resource_group_name=target_resource_group_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology' + url = self.get_topology.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -469,12 +455,13 @@ def get_topology( return client_raw_response return deserialized + get_topology.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'} def _verify_ip_flow_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify' + url = self.verify_ip_flow.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -523,7 +510,7 @@ def _verify_ip_flow_initial( return deserialized def verify_ip_flow( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Verify IP flow from the specified VM to a location given the currently configured NSG rules. @@ -535,13 +522,17 @@ def verify_ip_flow( :type parameters: ~azure.mgmt.network.v2017_03_01.models.VerificationIPFlowParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VerificationIPFlowResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VerificationIPFlowResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.VerificationIPFlowResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.VerificationIPFlowResult]] :raises: :class:`CloudError` """ raw_result = self._verify_ip_flow_initial( @@ -552,30 +543,8 @@ def verify_ip_flow( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VerificationIPFlowResult', response) if raw: @@ -584,18 +553,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + verify_ip_flow.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} def _get_next_hop_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop' + url = self.get_next_hop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -644,7 +615,7 @@ def _get_next_hop_initial( return deserialized def get_next_hop( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -656,13 +627,16 @@ def get_next_hop( :type parameters: ~azure.mgmt.network.v2017_03_01.models.NextHopParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NextHopResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NextHopResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.NextHopResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.NextHopResult]] :raises: :class:`CloudError` """ raw_result = self._get_next_hop_initial( @@ -673,30 +647,8 @@ def get_next_hop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NextHopResult', response) if raw: @@ -705,12 +657,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_next_hop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} def _get_vm_security_rules_initial( @@ -718,7 +672,7 @@ def _get_vm_security_rules_initial( parameters = models.SecurityGroupViewParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView' + url = self.get_vm_security_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -767,7 +721,7 @@ def _get_vm_security_rules_initial( return deserialized def get_vm_security_rules( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the configured and effective security group rules on the specified VM. @@ -778,13 +732,16 @@ def get_vm_security_rules( :param target_resource_id: ID of the target VM. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - SecurityGroupViewResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityGroupViewResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.SecurityGroupViewResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.SecurityGroupViewResult]] :raises: :class:`CloudError` """ raw_result = self._get_vm_security_rules_initial( @@ -795,30 +752,8 @@ def get_vm_security_rules( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('SecurityGroupViewResult', response) if raw: @@ -827,18 +762,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vm_security_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} def _get_troubleshooting_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot' + url = self.get_troubleshooting.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -887,7 +824,7 @@ def _get_troubleshooting_initial( return deserialized def get_troubleshooting( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -899,13 +836,16 @@ def get_troubleshooting( :type parameters: ~azure.mgmt.network.v2017_03_01.models.TroubleshootingParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_initial( @@ -916,30 +856,8 @@ def get_troubleshooting( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -948,12 +866,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} def _get_troubleshooting_result_initial( @@ -961,7 +881,7 @@ def _get_troubleshooting_result_initial( parameters = models.QueryTroubleshootingParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult' + url = self.get_troubleshooting_result.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1010,7 +930,7 @@ def _get_troubleshooting_result_initial( return deserialized def get_troubleshooting_result( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,13 +941,16 @@ def get_troubleshooting_result( troubleshooting result. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_result_initial( @@ -1038,30 +961,8 @@ def get_troubleshooting_result( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -1070,18 +971,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} def _set_flow_log_configuration_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog' + url = self.set_flow_log_configuration.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1130,7 +1033,7 @@ def _set_flow_log_configuration_initial( return deserialized def set_flow_log_configuration( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1143,13 +1046,16 @@ def set_flow_log_configuration( :type parameters: ~azure.mgmt.network.v2017_03_01.models.FlowLogInformation :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._set_flow_log_configuration_initial( @@ -1160,30 +1066,8 @@ def set_flow_log_configuration( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1192,12 +1076,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_flow_log_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} def _get_flow_log_status_initial( @@ -1205,7 +1091,7 @@ def _get_flow_log_status_initial( parameters = models.FlowLogStatusParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus' + url = self.get_flow_log_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1254,7 +1140,7 @@ def _get_flow_log_status_initial( return deserialized def get_flow_log_status( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1266,13 +1152,16 @@ def get_flow_log_status( logging status. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._get_flow_log_status_initial( @@ -1283,30 +1172,8 @@ def get_flow_log_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1315,12 +1182,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_flow_log_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} def _check_connectivity_initial( @@ -1328,7 +1197,7 @@ def _check_connectivity_initial( parameters = models.ConnectivityParameters(source=source, destination=destination) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck' + url = self.check_connectivity.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1377,7 +1246,7 @@ def _check_connectivity_initial( return deserialized def check_connectivity( - self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, polling=True, **operation_config): """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1394,13 +1263,16 @@ def check_connectivity( :type destination: ~azure.mgmt.network.v2017_03_01.models.ConnectivityDestination :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectivityInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectivityInformation + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.ConnectivityInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.ConnectivityInformation]] :raises: :class:`CloudError` """ raw_result = self._check_connectivity_initial( @@ -1412,30 +1284,8 @@ def check_connectivity( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectivityInformation', response) if raw: @@ -1444,9 +1294,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + check_connectivity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/packet_captures_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/packet_captures_operations.py index 7a50fa54d52f..4cb99cf611b2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/packet_captures_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/packet_captures_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PacketCapturesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -91,7 +91,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -104,13 +104,16 @@ def create( operation. :type parameters: ~azure.mgmt.network.v2017_03_01.models.PacketCapture :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PacketCaptureResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.PacketCaptureResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.PacketCaptureResult]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -122,30 +125,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureResult', response) if raw: @@ -154,12 +135,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def get( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -224,12 +207,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _delete_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -266,7 +250,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -276,12 +260,14 @@ def delete( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -292,46 +278,26 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _stop_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -368,7 +334,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -378,12 +344,14 @@ def stop( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -394,46 +362,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} def _get_status_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus' + url = self.get_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -479,7 +427,7 @@ def _get_status_initial( return deserialized def get_status( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -490,13 +438,17 @@ def get_status( session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureQueryStatusResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PacketCaptureQueryStatusResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.PacketCaptureQueryStatusResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.PacketCaptureQueryStatusResult]] :raises: :class:`CloudError` """ raw_result = self._get_status_initial( @@ -507,30 +459,8 @@ def get_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureQueryStatusResult', response) if raw: @@ -539,12 +469,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} def list( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -568,7 +500,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -615,3 +547,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/public_ip_addresses_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/public_ip_addresses_operations.py index c6702a6ef40d..e47695214d80 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/public_ip_addresses_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/public_ip_addresses_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PublicIPAddressesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ models = models @@ -43,7 +43,7 @@ def _delete_initial( api_version = "2017-03-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param public_ip_address_name: The name of the subnet. :type public_ip_address_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def get( self, resource_group_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( api_version = "2017-03-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -203,6 +185,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def _create_or_update_initial( @@ -210,7 +193,7 @@ def _create_or_update_initial( api_version = "2017-03-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_03_01.models.PublicIPAddress :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PublicIPAddress or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.PublicIPAddress] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.PublicIPAddress]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('PublicIPAddress', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -347,7 +313,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -392,6 +358,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -415,7 +382,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -461,6 +428,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} def list_virtual_machine_scale_set_public_ip_addresses( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -488,7 +456,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses' + url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -535,6 +503,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses'} def list_virtual_machine_scale_set_vm_public_ip_addresses( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -568,7 +537,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses' + url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -618,6 +587,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses'} def get_virtual_machine_scale_set_public_ip_address( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -651,7 +621,7 @@ def get_virtual_machine_scale_set_public_ip_address( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}' + url = self.get_virtual_machine_scale_set_public_ip_address.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -698,3 +668,4 @@ def get_virtual_machine_scale_set_public_ip_address( return client_raw_response return deserialized + get_virtual_machine_scale_set_public_ip_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/route_filter_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/route_filter_rules_operations.py index afbea3b6ec0d..d6ee40dd0fcf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/route_filter_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/route_filter_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFilterRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param rule_name: The name of the rule. :type rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def get( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -273,13 +256,16 @@ def create_or_update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_03_01.models.RouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -291,30 +277,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilterRule', response) if raw: @@ -323,18 +287,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -382,7 +348,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -396,13 +362,16 @@ def update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_03_01.models.PatchRouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -414,30 +383,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilterRule', response) if raw: @@ -446,12 +393,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def list_by_route_filter( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): @@ -475,7 +424,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules' + url = self.list_by_route_filter.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -522,3 +471,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_route_filter.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/route_filters_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/route_filters_operations.py index b883f6be5f7b..f17b7a9102ca 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/route_filters_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/route_filters_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFiltersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_filter_name: The name of the route filter. :type route_filter_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def get( self, resource_group_name, route_filter_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type route_filter_parameters: ~azure.mgmt.network.v2017_03_01.models.RouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilter', response) if raw: @@ -316,18 +280,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -374,7 +340,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -386,13 +352,16 @@ def update( :type route_filter_parameters: ~azure.mgmt.network.v2017_03_01.models.PatchRouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -403,30 +372,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilter', response) if raw: @@ -435,12 +382,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -462,7 +411,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -508,6 +457,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -527,7 +477,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -572,3 +522,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/route_tables_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/route_tables_operations.py index 9c9d764d335e..78cc446b6dd7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/route_tables_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/route_tables_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteTablesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_table_name: The name of the route table. :type route_table_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def get( self, resource_group_name, route_table_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( table operation. :type parameters: ~azure.mgmt.network.v2017_03_01.models.RouteTable :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteTable - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.RouteTable] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.RouteTable]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteTable', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -342,7 +308,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -388,6 +354,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -452,3 +419,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/routes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/routes_operations.py index 53c4b98177d9..d329dc9204d5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/routes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/routes_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RoutesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param route_name: The name of the route. :type route_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def get( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -272,13 +255,16 @@ def create_or_update( route operation. :type route_parameters: ~azure.mgmt.network.v2017_03_01.models.Route :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Route or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Route or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.Route] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.Route]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -290,30 +276,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Route', response) if raw: @@ -322,12 +286,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def list( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): @@ -351,7 +317,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -398,3 +364,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/security_rules_operations.py index 87670cfecab5..7871fbdce2c4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/security_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( :param security_rule_name: The name of the security rule. :type security_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def get( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a security rule in the specified network security group. @@ -277,13 +260,16 @@ def create_or_update( :type security_rule_parameters: ~azure.mgmt.network.v2017_03_01.models.SecurityRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns SecurityRule - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.SecurityRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.SecurityRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -295,30 +281,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('SecurityRule', response) if raw: @@ -327,12 +291,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def list( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +323,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -404,3 +370,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/subnets_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/subnets_operations.py index c6a65771833a..14e8da047e40 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/subnets_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/subnets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SubnetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param subnet_name: The name of the subnet. :type subnet_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def get( self, resource_group_name, virtual_network_name, subnet_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -276,13 +259,16 @@ def create_or_update( subnet operation. :type subnet_parameters: ~azure.mgmt.network.v2017_03_01.models.Subnet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Subnet or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Subnet or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.Subnet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.Subnet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -294,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Subnet', response) if raw: @@ -326,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -355,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -402,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/usages_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/usages_operations.py index 08cdbf139a14..bbcb185ceaca 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/usages_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/usages_operations.py @@ -22,7 +22,7 @@ class UsagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_network_gateway_connections_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_network_gateway_connections_operations.py index 52824c7da184..ff82f6c42ff8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_network_gateway_connections_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_network_gateway_connections_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway connection in the specified resource group. @@ -106,13 +106,17 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayConnection :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGatewayConnection or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnection or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayConnection] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGatewayConnection]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +127,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGatewayConnection', response) if raw: @@ -155,12 +137,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def get( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -185,7 +169,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -226,12 +210,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -267,7 +252,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -276,12 +261,14 @@ def delete( virtual network gateway connection. :type virtual_network_gateway_connection_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -291,40 +278,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _set_shared_key_initial( @@ -332,7 +299,7 @@ def _set_shared_key_initial( parameters = models.ConnectionSharedKey(value=value) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.set_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -381,7 +348,7 @@ def _set_shared_key_initial( return deserialized def set_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, polling=True, **operation_config): """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -395,13 +362,16 @@ def set_shared_key( :param value: The virtual network connection shared key value. :type value: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectionSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.ConnectionSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.ConnectionSharedKey]] :raises: :class:`CloudError` """ raw_result = self._set_shared_key_initial( @@ -412,30 +382,8 @@ def set_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ConnectionSharedKey', response) if raw: @@ -444,12 +392,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def get_shared_key( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -473,7 +423,7 @@ def get_shared_key( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.get_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -514,6 +464,7 @@ def get_shared_key( return client_raw_response return deserialized + get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -536,7 +487,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -582,6 +533,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} def _reset_shared_key_initial( @@ -589,7 +541,7 @@ def _reset_shared_key_initial( parameters = models.ConnectionResetSharedKey(key_length=key_length) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset' + url = self.reset_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -636,7 +588,7 @@ def _reset_shared_key_initial( return deserialized def reset_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, polling=True, **operation_config): """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -651,13 +603,17 @@ def reset_shared_key( length, should between 1 and 128. :type key_length: int :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionResetSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConnectionResetSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.ConnectionResetSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.ConnectionResetSharedKey]] :raises: :class:`CloudError` """ raw_result = self._reset_shared_key_initial( @@ -668,30 +624,8 @@ def reset_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectionResetSharedKey', response) if raw: @@ -700,9 +634,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_network_gateways_operations.py index 606d25abc419..f555377aa370 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def get( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +309,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -389,12 +355,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} def _reset_initial( self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset' + url = self.reset.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -439,7 +406,7 @@ def _reset_initial( return deserialized def reset( - self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, polling=True, **operation_config): """Resets the primary of the virtual network gateway in the specified resource group. @@ -452,13 +419,16 @@ def reset( the begin reset of the active-active feature enabled gateway. :type gateway_vip: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._reset_initial( @@ -469,30 +439,8 @@ def reset( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -501,12 +449,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} def generatevpnclientpackage( self, resource_group_name, virtual_network_gateway_name, processor_architecture, custom_headers=None, raw=False, **operation_config): @@ -535,7 +485,7 @@ def generatevpnclientpackage( parameters = models.VpnClientParameters(processor_architecture=processor_architecture) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage' + url = self.generatevpnclientpackage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -580,12 +530,13 @@ def generatevpnclientpackage( return client_raw_response return deserialized + generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} def _get_bgp_peer_status_initial( self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus' + url = self.get_bgp_peer_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -630,7 +581,7 @@ def _get_bgp_peer_status_initial( return deserialized def get_bgp_peer_status( - self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, polling=True, **operation_config): """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -641,13 +592,16 @@ def get_bgp_peer_status( :param peer: The IP address of the peer to retrieve the status of. :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - BgpPeerStatusListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BgpPeerStatusListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.BgpPeerStatusListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.BgpPeerStatusListResult]] :raises: :class:`CloudError` """ raw_result = self._get_bgp_peer_status_initial( @@ -658,30 +612,8 @@ def get_bgp_peer_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('BgpPeerStatusListResult', response) if raw: @@ -690,18 +622,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_bgp_peer_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} def _get_learned_routes_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes' + url = self.get_learned_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -744,7 +678,7 @@ def _get_learned_routes_initial( return deserialized def get_learned_routes( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -754,13 +688,16 @@ def get_learned_routes( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_learned_routes_initial( @@ -770,30 +707,8 @@ def get_learned_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -802,18 +717,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} def _get_advertised_routes_initial( self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes' + url = self.get_advertised_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -857,7 +774,7 @@ def _get_advertised_routes_initial( return deserialized def get_advertised_routes( - self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -869,13 +786,16 @@ def get_advertised_routes( :param peer: The IP address of the peer :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_advertised_routes_initial( @@ -886,30 +806,8 @@ def get_advertised_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -918,9 +816,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_network_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_network_peerings_operations.py index 287827d65237..69972ca5a32e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_network_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_network_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( peering. :type virtual_network_peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def get( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -275,13 +258,16 @@ def create_or_update( :type virtual_network_peering_parameters: ~azure.mgmt.network.v2017_03_01.models.VirtualNetworkPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkPeering + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.VirtualNetworkPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +279,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkPeering', response) if raw: @@ -325,12 +289,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +320,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -401,3 +367,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_networks_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_networks_operations.py index b57d5077adfe..2e1bebbdfd2a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_networks_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_03_01/operations/virtual_networks_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworksOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-03-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param virtual_network_name: The name of the virtual network. :type virtual_network_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def get( self, resource_group_name, virtual_network_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_03_01.models.VirtualNetwork :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetwork or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_03_01.models.VirtualNetwork] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_03_01.models.VirtualNetwork]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetwork', response) if raw: @@ -316,12 +280,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -341,7 +307,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -386,6 +352,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -453,6 +420,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks'} def check_ip_address_availability( self, resource_group_name, virtual_network_name, ip_address=None, custom_headers=None, raw=False, **operation_config): @@ -476,7 +444,7 @@ def check_ip_address_availability( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability' + url = self.check_ip_address_availability.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -519,6 +487,7 @@ def check_ip_address_availability( return client_raw_response return deserialized + check_ip_address_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'} def list_usage( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -542,7 +511,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages' + url = self.list_usage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -589,3 +558,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/__init__.py index 6ba17d6be7c9..838e369bb685 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/__init__.py @@ -9,157 +9,310 @@ # regenerated. # -------------------------------------------------------------------------- -from .sub_resource import SubResource -from .backend_address_pool import BackendAddressPool -from .inbound_nat_rule import InboundNatRule -from .security_rule import SecurityRule -from .network_interface_dns_settings import NetworkInterfaceDnsSettings -from .network_interface import NetworkInterface -from .network_security_group import NetworkSecurityGroup -from .route import Route -from .route_table import RouteTable -from .service_endpoint_properties_format import ServiceEndpointPropertiesFormat -from .public_ip_address_dns_settings import PublicIPAddressDnsSettings -from .public_ip_address import PublicIPAddress -from .ip_configuration import IPConfiguration -from .resource_navigation_link import ResourceNavigationLink -from .subnet import Subnet -from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration -from .application_gateway_backend_address import ApplicationGatewayBackendAddress -from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool -from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining -from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings -from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer -from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings -from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool -from .application_gateway_backend_health import ApplicationGatewayBackendHealth -from .application_gateway_sku import ApplicationGatewaySku -from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy -from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration -from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate -from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate -from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration -from .application_gateway_frontend_port import ApplicationGatewayFrontendPort -from .application_gateway_http_listener import ApplicationGatewayHttpListener -from .application_gateway_path_rule import ApplicationGatewayPathRule -from .application_gateway_probe_health_response_match import ApplicationGatewayProbeHealthResponseMatch -from .application_gateway_probe import ApplicationGatewayProbe -from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule -from .application_gateway_redirect_configuration import ApplicationGatewayRedirectConfiguration -from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap -from .application_gateway_firewall_disabled_rule_group import ApplicationGatewayFirewallDisabledRuleGroup -from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration -from .application_gateway import ApplicationGateway -from .application_gateway_firewall_rule import ApplicationGatewayFirewallRule -from .application_gateway_firewall_rule_group import ApplicationGatewayFirewallRuleGroup -from .application_gateway_firewall_rule_set import ApplicationGatewayFirewallRuleSet -from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult -from .application_gateway_available_ssl_options import ApplicationGatewayAvailableSslOptions -from .application_gateway_ssl_predefined_policy import ApplicationGatewaySslPredefinedPolicy -from .resource import Resource -from .dns_name_availability_result import DnsNameAvailabilityResult -from .endpoint_service_result import EndpointServiceResult -from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization -from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig -from .route_filter_rule import RouteFilterRule -from .express_route_circuit_stats import ExpressRouteCircuitStats -from .express_route_circuit_peering import ExpressRouteCircuitPeering -from .route_filter import RouteFilter -from .ipv6_express_route_circuit_peering_config import Ipv6ExpressRouteCircuitPeeringConfig -from .express_route_circuit_sku import ExpressRouteCircuitSku -from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties -from .express_route_circuit import ExpressRouteCircuit -from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable -from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult -from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable -from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult -from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary -from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult -from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered -from .express_route_service_provider import ExpressRouteServiceProvider -from .frontend_ip_configuration import FrontendIPConfiguration -from .load_balancing_rule import LoadBalancingRule -from .probe import Probe -from .inbound_nat_pool import InboundNatPool -from .outbound_nat_rule import OutboundNatRule -from .load_balancer import LoadBalancer -from .error_details import ErrorDetails -from .error import Error -from .azure_async_operation_result import AzureAsyncOperationResult -from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation -from .effective_network_security_rule import EffectiveNetworkSecurityRule -from .effective_network_security_group import EffectiveNetworkSecurityGroup -from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult -from .effective_route import EffectiveRoute -from .effective_route_list_result import EffectiveRouteListResult -from .network_watcher import NetworkWatcher -from .topology_parameters import TopologyParameters -from .topology_association import TopologyAssociation -from .topology_resource import TopologyResource -from .topology import Topology -from .verification_ip_flow_parameters import VerificationIPFlowParameters -from .verification_ip_flow_result import VerificationIPFlowResult -from .next_hop_parameters import NextHopParameters -from .next_hop_result import NextHopResult -from .security_group_view_parameters import SecurityGroupViewParameters -from .network_interface_association import NetworkInterfaceAssociation -from .subnet_association import SubnetAssociation -from .security_rule_associations import SecurityRuleAssociations -from .security_group_network_interface import SecurityGroupNetworkInterface -from .security_group_view_result import SecurityGroupViewResult -from .packet_capture_storage_location import PacketCaptureStorageLocation -from .packet_capture_filter import PacketCaptureFilter -from .packet_capture_parameters import PacketCaptureParameters -from .packet_capture import PacketCapture -from .packet_capture_result import PacketCaptureResult -from .packet_capture_query_status_result import PacketCaptureQueryStatusResult -from .troubleshooting_parameters import TroubleshootingParameters -from .query_troubleshooting_parameters import QueryTroubleshootingParameters -from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions -from .troubleshooting_details import TroubleshootingDetails -from .troubleshooting_result import TroubleshootingResult -from .retention_policy_parameters import RetentionPolicyParameters -from .flow_log_status_parameters import FlowLogStatusParameters -from .flow_log_information import FlowLogInformation -from .connectivity_source import ConnectivitySource -from .connectivity_destination import ConnectivityDestination -from .connectivity_parameters import ConnectivityParameters -from .connectivity_issue import ConnectivityIssue -from .connectivity_hop import ConnectivityHop -from .connectivity_information import ConnectivityInformation -from .patch_route_filter_rule import PatchRouteFilterRule -from .patch_route_filter import PatchRouteFilter -from .bgp_community import BGPCommunity -from .bgp_service_community import BgpServiceCommunity -from .usage_name import UsageName -from .usage import Usage -from .virtual_network_peering import VirtualNetworkPeering -from .address_space import AddressSpace -from .dhcp_options import DhcpOptions -from .virtual_network import VirtualNetwork -from .ip_address_availability_result import IPAddressAvailabilityResult -from .virtual_network_usage_name import VirtualNetworkUsageName -from .virtual_network_usage import VirtualNetworkUsage -from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration -from .virtual_network_gateway_sku import VirtualNetworkGatewaySku -from .vpn_client_root_certificate import VpnClientRootCertificate -from .vpn_client_revoked_certificate import VpnClientRevokedCertificate -from .vpn_client_configuration import VpnClientConfiguration -from .bgp_settings import BgpSettings -from .bgp_peer_status import BgpPeerStatus -from .gateway_route import GatewayRoute -from .virtual_network_gateway import VirtualNetworkGateway -from .vpn_client_parameters import VpnClientParameters -from .bgp_peer_status_list_result import BgpPeerStatusListResult -from .gateway_route_list_result import GatewayRouteListResult -from .tunnel_connection_health import TunnelConnectionHealth -from .local_network_gateway import LocalNetworkGateway -from .ipsec_policy import IpsecPolicy -from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection -from .connection_reset_shared_key import ConnectionResetSharedKey -from .connection_shared_key import ConnectionSharedKey -from .virtual_network_connection_gateway_reference import VirtualNetworkConnectionGatewayReference -from .virtual_network_gateway_connection_list_entity import VirtualNetworkGatewayConnectionListEntity +try: + from .sub_resource_py3 import SubResource + from .backend_address_pool_py3 import BackendAddressPool + from .inbound_nat_rule_py3 import InboundNatRule + from .security_rule_py3 import SecurityRule + from .network_interface_dns_settings_py3 import NetworkInterfaceDnsSettings + from .network_interface_py3 import NetworkInterface + from .network_security_group_py3 import NetworkSecurityGroup + from .route_py3 import Route + from .route_table_py3 import RouteTable + from .service_endpoint_properties_format_py3 import ServiceEndpointPropertiesFormat + from .public_ip_address_dns_settings_py3 import PublicIPAddressDnsSettings + from .public_ip_address_py3 import PublicIPAddress + from .ip_configuration_py3 import IPConfiguration + from .resource_navigation_link_py3 import ResourceNavigationLink + from .subnet_py3 import Subnet + from .network_interface_ip_configuration_py3 import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address_py3 import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool_py3 import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining_py3 import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings_py3 import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server_py3 import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings_py3 import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool_py3 import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health_py3 import ApplicationGatewayBackendHealth + from .application_gateway_sku_py3 import ApplicationGatewaySku + from .application_gateway_ssl_policy_py3 import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration_py3 import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate_py3 import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate_py3 import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration_py3 import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port_py3 import ApplicationGatewayFrontendPort + from .application_gateway_http_listener_py3 import ApplicationGatewayHttpListener + from .application_gateway_path_rule_py3 import ApplicationGatewayPathRule + from .application_gateway_probe_health_response_match_py3 import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_probe_py3 import ApplicationGatewayProbe + from .application_gateway_request_routing_rule_py3 import ApplicationGatewayRequestRoutingRule + from .application_gateway_redirect_configuration_py3 import ApplicationGatewayRedirectConfiguration + from .application_gateway_url_path_map_py3 import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group_py3 import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration_py3 import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway_py3 import ApplicationGateway + from .application_gateway_firewall_rule_py3 import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group_py3 import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set_py3 import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result_py3 import ApplicationGatewayAvailableWafRuleSetsResult + from .application_gateway_available_ssl_options_py3 import ApplicationGatewayAvailableSslOptions + from .application_gateway_ssl_predefined_policy_py3 import ApplicationGatewaySslPredefinedPolicy + from .resource_py3 import Resource + from .dns_name_availability_result_py3 import DnsNameAvailabilityResult + from .endpoint_service_result_py3 import EndpointServiceResult + from .express_route_circuit_authorization_py3 import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config_py3 import ExpressRouteCircuitPeeringConfig + from .route_filter_rule_py3 import RouteFilterRule + from .express_route_circuit_stats_py3 import ExpressRouteCircuitStats + from .express_route_circuit_peering_py3 import ExpressRouteCircuitPeering + from .route_filter_py3 import RouteFilter + from .ipv6_express_route_circuit_peering_config_py3 import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku_py3 import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties_py3 import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit_py3 import ExpressRouteCircuit + from .express_route_circuit_arp_table_py3 import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result_py3 import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table_py3 import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result_py3 import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary_py3 import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result_py3 import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered_py3 import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider_py3 import ExpressRouteServiceProvider + from .frontend_ip_configuration_py3 import FrontendIPConfiguration + from .load_balancing_rule_py3 import LoadBalancingRule + from .probe_py3 import Probe + from .inbound_nat_pool_py3 import InboundNatPool + from .outbound_nat_rule_py3 import OutboundNatRule + from .load_balancer_py3 import LoadBalancer + from .error_details_py3 import ErrorDetails + from .error_py3 import Error + from .azure_async_operation_result_py3 import AzureAsyncOperationResult + from .effective_network_security_group_association_py3 import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule_py3 import EffectiveNetworkSecurityRule + from .effective_network_security_group_py3 import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result_py3 import EffectiveNetworkSecurityGroupListResult + from .effective_route_py3 import EffectiveRoute + from .effective_route_list_result_py3 import EffectiveRouteListResult + from .network_watcher_py3 import NetworkWatcher + from .topology_parameters_py3 import TopologyParameters + from .topology_association_py3 import TopologyAssociation + from .topology_resource_py3 import TopologyResource + from .topology_py3 import Topology + from .verification_ip_flow_parameters_py3 import VerificationIPFlowParameters + from .verification_ip_flow_result_py3 import VerificationIPFlowResult + from .next_hop_parameters_py3 import NextHopParameters + from .next_hop_result_py3 import NextHopResult + from .security_group_view_parameters_py3 import SecurityGroupViewParameters + from .network_interface_association_py3 import NetworkInterfaceAssociation + from .subnet_association_py3 import SubnetAssociation + from .security_rule_associations_py3 import SecurityRuleAssociations + from .security_group_network_interface_py3 import SecurityGroupNetworkInterface + from .security_group_view_result_py3 import SecurityGroupViewResult + from .packet_capture_storage_location_py3 import PacketCaptureStorageLocation + from .packet_capture_filter_py3 import PacketCaptureFilter + from .packet_capture_parameters_py3 import PacketCaptureParameters + from .packet_capture_py3 import PacketCapture + from .packet_capture_result_py3 import PacketCaptureResult + from .packet_capture_query_status_result_py3 import PacketCaptureQueryStatusResult + from .troubleshooting_parameters_py3 import TroubleshootingParameters + from .query_troubleshooting_parameters_py3 import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions_py3 import TroubleshootingRecommendedActions + from .troubleshooting_details_py3 import TroubleshootingDetails + from .troubleshooting_result_py3 import TroubleshootingResult + from .retention_policy_parameters_py3 import RetentionPolicyParameters + from .flow_log_status_parameters_py3 import FlowLogStatusParameters + from .flow_log_information_py3 import FlowLogInformation + from .connectivity_source_py3 import ConnectivitySource + from .connectivity_destination_py3 import ConnectivityDestination + from .connectivity_parameters_py3 import ConnectivityParameters + from .connectivity_issue_py3 import ConnectivityIssue + from .connectivity_hop_py3 import ConnectivityHop + from .connectivity_information_py3 import ConnectivityInformation + from .patch_route_filter_rule_py3 import PatchRouteFilterRule + from .patch_route_filter_py3 import PatchRouteFilter + from .bgp_community_py3 import BGPCommunity + from .bgp_service_community_py3 import BgpServiceCommunity + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .virtual_network_peering_py3 import VirtualNetworkPeering + from .address_space_py3 import AddressSpace + from .dhcp_options_py3 import DhcpOptions + from .virtual_network_py3 import VirtualNetwork + from .ip_address_availability_result_py3 import IPAddressAvailabilityResult + from .virtual_network_usage_name_py3 import VirtualNetworkUsageName + from .virtual_network_usage_py3 import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration_py3 import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku_py3 import VirtualNetworkGatewaySku + from .vpn_client_root_certificate_py3 import VpnClientRootCertificate + from .vpn_client_revoked_certificate_py3 import VpnClientRevokedCertificate + from .vpn_client_configuration_py3 import VpnClientConfiguration + from .bgp_settings_py3 import BgpSettings + from .bgp_peer_status_py3 import BgpPeerStatus + from .gateway_route_py3 import GatewayRoute + from .virtual_network_gateway_py3 import VirtualNetworkGateway + from .vpn_client_parameters_py3 import VpnClientParameters + from .bgp_peer_status_list_result_py3 import BgpPeerStatusListResult + from .gateway_route_list_result_py3 import GatewayRouteListResult + from .tunnel_connection_health_py3 import TunnelConnectionHealth + from .local_network_gateway_py3 import LocalNetworkGateway + from .ipsec_policy_py3 import IpsecPolicy + from .virtual_network_gateway_connection_py3 import VirtualNetworkGatewayConnection + from .connection_reset_shared_key_py3 import ConnectionResetSharedKey + from .connection_shared_key_py3 import ConnectionSharedKey + from .virtual_network_connection_gateway_reference_py3 import VirtualNetworkConnectionGatewayReference + from .virtual_network_gateway_connection_list_entity_py3 import VirtualNetworkGatewayConnectionListEntity +except (SyntaxError, ImportError): + from .sub_resource import SubResource + from .backend_address_pool import BackendAddressPool + from .inbound_nat_rule import InboundNatRule + from .security_rule import SecurityRule + from .network_interface_dns_settings import NetworkInterfaceDnsSettings + from .network_interface import NetworkInterface + from .network_security_group import NetworkSecurityGroup + from .route import Route + from .route_table import RouteTable + from .service_endpoint_properties_format import ServiceEndpointPropertiesFormat + from .public_ip_address_dns_settings import PublicIPAddressDnsSettings + from .public_ip_address import PublicIPAddress + from .ip_configuration import IPConfiguration + from .resource_navigation_link import ResourceNavigationLink + from .subnet import Subnet + from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health import ApplicationGatewayBackendHealth + from .application_gateway_sku import ApplicationGatewaySku + from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port import ApplicationGatewayFrontendPort + from .application_gateway_http_listener import ApplicationGatewayHttpListener + from .application_gateway_path_rule import ApplicationGatewayPathRule + from .application_gateway_probe_health_response_match import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_probe import ApplicationGatewayProbe + from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule + from .application_gateway_redirect_configuration import ApplicationGatewayRedirectConfiguration + from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway import ApplicationGateway + from .application_gateway_firewall_rule import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult + from .application_gateway_available_ssl_options import ApplicationGatewayAvailableSslOptions + from .application_gateway_ssl_predefined_policy import ApplicationGatewaySslPredefinedPolicy + from .resource import Resource + from .dns_name_availability_result import DnsNameAvailabilityResult + from .endpoint_service_result import EndpointServiceResult + from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig + from .route_filter_rule import RouteFilterRule + from .express_route_circuit_stats import ExpressRouteCircuitStats + from .express_route_circuit_peering import ExpressRouteCircuitPeering + from .route_filter import RouteFilter + from .ipv6_express_route_circuit_peering_config import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit import ExpressRouteCircuit + from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider import ExpressRouteServiceProvider + from .frontend_ip_configuration import FrontendIPConfiguration + from .load_balancing_rule import LoadBalancingRule + from .probe import Probe + from .inbound_nat_pool import InboundNatPool + from .outbound_nat_rule import OutboundNatRule + from .load_balancer import LoadBalancer + from .error_details import ErrorDetails + from .error import Error + from .azure_async_operation_result import AzureAsyncOperationResult + from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule import EffectiveNetworkSecurityRule + from .effective_network_security_group import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult + from .effective_route import EffectiveRoute + from .effective_route_list_result import EffectiveRouteListResult + from .network_watcher import NetworkWatcher + from .topology_parameters import TopologyParameters + from .topology_association import TopologyAssociation + from .topology_resource import TopologyResource + from .topology import Topology + from .verification_ip_flow_parameters import VerificationIPFlowParameters + from .verification_ip_flow_result import VerificationIPFlowResult + from .next_hop_parameters import NextHopParameters + from .next_hop_result import NextHopResult + from .security_group_view_parameters import SecurityGroupViewParameters + from .network_interface_association import NetworkInterfaceAssociation + from .subnet_association import SubnetAssociation + from .security_rule_associations import SecurityRuleAssociations + from .security_group_network_interface import SecurityGroupNetworkInterface + from .security_group_view_result import SecurityGroupViewResult + from .packet_capture_storage_location import PacketCaptureStorageLocation + from .packet_capture_filter import PacketCaptureFilter + from .packet_capture_parameters import PacketCaptureParameters + from .packet_capture import PacketCapture + from .packet_capture_result import PacketCaptureResult + from .packet_capture_query_status_result import PacketCaptureQueryStatusResult + from .troubleshooting_parameters import TroubleshootingParameters + from .query_troubleshooting_parameters import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions + from .troubleshooting_details import TroubleshootingDetails + from .troubleshooting_result import TroubleshootingResult + from .retention_policy_parameters import RetentionPolicyParameters + from .flow_log_status_parameters import FlowLogStatusParameters + from .flow_log_information import FlowLogInformation + from .connectivity_source import ConnectivitySource + from .connectivity_destination import ConnectivityDestination + from .connectivity_parameters import ConnectivityParameters + from .connectivity_issue import ConnectivityIssue + from .connectivity_hop import ConnectivityHop + from .connectivity_information import ConnectivityInformation + from .patch_route_filter_rule import PatchRouteFilterRule + from .patch_route_filter import PatchRouteFilter + from .bgp_community import BGPCommunity + from .bgp_service_community import BgpServiceCommunity + from .usage_name import UsageName + from .usage import Usage + from .virtual_network_peering import VirtualNetworkPeering + from .address_space import AddressSpace + from .dhcp_options import DhcpOptions + from .virtual_network import VirtualNetwork + from .ip_address_availability_result import IPAddressAvailabilityResult + from .virtual_network_usage_name import VirtualNetworkUsageName + from .virtual_network_usage import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku import VirtualNetworkGatewaySku + from .vpn_client_root_certificate import VpnClientRootCertificate + from .vpn_client_revoked_certificate import VpnClientRevokedCertificate + from .vpn_client_configuration import VpnClientConfiguration + from .bgp_settings import BgpSettings + from .bgp_peer_status import BgpPeerStatus + from .gateway_route import GatewayRoute + from .virtual_network_gateway import VirtualNetworkGateway + from .vpn_client_parameters import VpnClientParameters + from .bgp_peer_status_list_result import BgpPeerStatusListResult + from .gateway_route_list_result import GatewayRouteListResult + from .tunnel_connection_health import TunnelConnectionHealth + from .local_network_gateway import LocalNetworkGateway + from .ipsec_policy import IpsecPolicy + from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection + from .connection_reset_shared_key import ConnectionResetSharedKey + from .connection_shared_key import ConnectionSharedKey + from .virtual_network_connection_gateway_reference import VirtualNetworkConnectionGatewayReference + from .virtual_network_gateway_connection_list_entity import VirtualNetworkGatewayConnectionListEntity from .application_gateway_paged import ApplicationGatewayPaged from .application_gateway_ssl_predefined_policy_paged import ApplicationGatewaySslPredefinedPolicyPaged from .endpoint_service_result_paged import EndpointServiceResultPaged diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/address_space.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/address_space.py index d7050c78a457..fbf42c9e0ade 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/address_space.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/address_space.py @@ -25,6 +25,6 @@ class AddressSpace(Model): 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, } - def __init__(self, address_prefixes=None): - super(AddressSpace, self).__init__() - self.address_prefixes = address_prefixes + def __init__(self, **kwargs): + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = kwargs.get('address_prefixes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/address_space_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/address_space_py3.py new file mode 100644 index 000000000000..9794cc805efa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/address_space_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AddressSpace(Model): + """AddressSpace contains an array of IP address ranges that can be used by + subnets of the virtual network. + + :param address_prefixes: A list of address blocks reserved for this + virtual network in CIDR notation. + :type address_prefixes: list[str] + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__(self, *, address_prefixes=None, **kwargs) -> None: + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = address_prefixes diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway.py index c895cc72870c..69d4288dff53 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway.py @@ -130,24 +130,24 @@ class ApplicationGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, redirect_configurations=None, web_application_firewall_configuration=None, resource_guid=None, provisioning_state=None, etag=None): - super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.ssl_policy = ssl_policy + def __init__(self, **kwargs): + super(ApplicationGateway, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.ssl_policy = kwargs.get('ssl_policy', None) self.operational_state = None - self.gateway_ip_configurations = gateway_ip_configurations - self.authentication_certificates = authentication_certificates - self.ssl_certificates = ssl_certificates - self.frontend_ip_configurations = frontend_ip_configurations - self.frontend_ports = frontend_ports - self.probes = probes - self.backend_address_pools = backend_address_pools - self.backend_http_settings_collection = backend_http_settings_collection - self.http_listeners = http_listeners - self.url_path_maps = url_path_maps - self.request_routing_rules = request_routing_rules - self.redirect_configurations = redirect_configurations - self.web_application_firewall_configuration = web_application_firewall_configuration - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.gateway_ip_configurations = kwargs.get('gateway_ip_configurations', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.ssl_certificates = kwargs.get('ssl_certificates', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.frontend_ports = kwargs.get('frontend_ports', None) + self.probes = kwargs.get('probes', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) + self.http_listeners = kwargs.get('http_listeners', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.redirect_configurations = kwargs.get('redirect_configurations', None) + self.web_application_firewall_configuration = kwargs.get('web_application_firewall_configuration', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_authentication_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_authentication_certificate.py index 18f36b7401a7..dff594340e59 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_authentication_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_authentication_certificate.py @@ -42,10 +42,10 @@ class ApplicationGatewayAuthenticationCertificate(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, data=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id) - self.data = data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayAuthenticationCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_authentication_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_authentication_certificate_py3.py new file mode 100644 index 000000000000..f31145eb222c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_authentication_certificate_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayAuthenticationCertificate(SubResource): + """Authentication certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Certificate public data. + :type data: str + :param provisioning_state: Provisioning state of the authentication + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_ssl_options.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_ssl_options.py index aa48867288fa..c90929e5994d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_ssl_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_ssl_options.py @@ -62,9 +62,9 @@ class ApplicationGatewayAvailableSslOptions(Resource): 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, } - def __init__(self, id=None, location=None, tags=None, predefined_policies=None, default_policy=None, available_cipher_suites=None, available_protocols=None): - super(ApplicationGatewayAvailableSslOptions, self).__init__(id=id, location=location, tags=tags) - self.predefined_policies = predefined_policies - self.default_policy = default_policy - self.available_cipher_suites = available_cipher_suites - self.available_protocols = available_protocols + def __init__(self, **kwargs): + super(ApplicationGatewayAvailableSslOptions, self).__init__(**kwargs) + self.predefined_policies = kwargs.get('predefined_policies', None) + self.default_policy = kwargs.get('default_policy', None) + self.available_cipher_suites = kwargs.get('available_cipher_suites', None) + self.available_protocols = kwargs.get('available_protocols', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_ssl_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_ssl_options_py3.py new file mode 100644 index 000000000000..3d4928d9de11 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_ssl_options_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayAvailableSslOptions(Resource): + """Response for ApplicationGatewayAvailableSslOptions API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param predefined_policies: List of available Ssl predefined policy. + :type predefined_policies: + list[~azure.mgmt.network.v2017_06_01.models.SubResource] + :param default_policy: Name of the Ssl predefined policy applied by + default to application gateway. Possible values include: + 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type default_policy: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslPolicyName + :param available_cipher_suites: List of available Ssl cipher suites. + :type available_cipher_suites: list[str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslCipherSuite] + :param available_protocols: List of available Ssl protocols. + :type available_protocols: list[str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslProtocol] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'predefined_policies': {'key': 'properties.predefinedPolicies', 'type': '[SubResource]'}, + 'default_policy': {'key': 'properties.defaultPolicy', 'type': 'str'}, + 'available_cipher_suites': {'key': 'properties.availableCipherSuites', 'type': '[str]'}, + 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, predefined_policies=None, default_policy=None, available_cipher_suites=None, available_protocols=None, **kwargs) -> None: + super(ApplicationGatewayAvailableSslOptions, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.predefined_policies = predefined_policies + self.default_policy = default_policy + self.available_cipher_suites = available_cipher_suites + self.available_protocols = available_protocols diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_waf_rule_sets_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_waf_rule_sets_result.py index 5b7bcef06010..c98a359f2d8b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_waf_rule_sets_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_waf_rule_sets_result.py @@ -24,6 +24,6 @@ class ApplicationGatewayAvailableWafRuleSetsResult(Model): 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, } - def __init__(self, value=None): - super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_waf_rule_sets_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_waf_rule_sets_result_py3.py new file mode 100644 index 000000000000..095d7d5d6ae6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_available_waf_rule_sets_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayAvailableWafRuleSetsResult(Model): + """Response for ApplicationGatewayAvailableWafRuleSets API service call. + + :param value: The list of application gateway rule sets. + :type value: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayFirewallRuleSet] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address.py index 6005027d0845..e7a61fe1705c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address.py @@ -26,7 +26,7 @@ class ApplicationGatewayBackendAddress(Model): 'ip_address': {'key': 'ipAddress', 'type': 'str'}, } - def __init__(self, fqdn=None, ip_address=None): - super(ApplicationGatewayBackendAddress, self).__init__() - self.fqdn = fqdn - self.ip_address = ip_address + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = kwargs.get('fqdn', None) + self.ip_address = kwargs.get('ip_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address_pool.py index dda6d0452fec..e918d9ab4ddf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address_pool.py @@ -47,11 +47,11 @@ class ApplicationGatewayBackendAddressPool(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayBackendAddressPool, self).__init__(id=id) - self.backend_ip_configurations = backend_ip_configurations - self.backend_addresses = backend_addresses - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddressPool, self).__init__(**kwargs) + self.backend_ip_configurations = kwargs.get('backend_ip_configurations', None) + self.backend_addresses = kwargs.get('backend_addresses', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address_pool_py3.py new file mode 100644 index 000000000000..9b0112373b5a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address_pool_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + :param id: Resource ID. + :type id: str + :param backend_ip_configurations: Collection of references to IPs defined + in network interfaces. + :type backend_ip_configurations: + list[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses + :type backend_addresses: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendAddress] + :param provisioning_state: Provisioning state of the backend address pool + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Resource that is unique within a resource group. This name + can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = backend_ip_configurations + self.backend_addresses = backend_addresses + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address_py3.py new file mode 100644 index 000000000000..d18e476244d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_address_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendAddress(Model): + """Backend address of an application gateway. + + :param fqdn: Fully qualified domain name (FQDN). + :type fqdn: str + :param ip_address: IP address + :type ip_address: str + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__(self, *, fqdn: str=None, ip_address: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = fqdn + self.ip_address = ip_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health.py index 6c0a5cad5b56..7809fd2605b4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health.py @@ -24,6 +24,6 @@ class ApplicationGatewayBackendHealth(Model): 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, } - def __init__(self, backend_address_pools=None): - super(ApplicationGatewayBackendHealth, self).__init__() - self.backend_address_pools = backend_address_pools + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = kwargs.get('backend_address_pools', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_http_settings.py index d7141d80e780..21a03592027b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_http_settings.py @@ -29,7 +29,7 @@ class ApplicationGatewayBackendHealthHttpSettings(Model): 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, } - def __init__(self, backend_http_settings=None, servers=None): - super(ApplicationGatewayBackendHealthHttpSettings, self).__init__() - self.backend_http_settings = backend_http_settings - self.servers = servers + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.servers = kwargs.get('servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_http_settings_py3.py new file mode 100644 index 000000000000..40765105cb0d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_http_settings_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthHttpSettings(Model): + """Application gateway BackendHealthHttp settings. + + :param backend_http_settings: Reference of an + ApplicationGatewayBackendHttpSettings resource. + :type backend_http_settings: + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendHealthServer] + """ + + _attribute_map = { + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, + 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, + } + + def __init__(self, *, backend_http_settings=None, servers=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = backend_http_settings + self.servers = servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_pool.py index 7a20b413b9a0..e40a1bab64c3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_pool.py @@ -30,7 +30,7 @@ class ApplicationGatewayBackendHealthPool(Model): 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, } - def __init__(self, backend_address_pool=None, backend_http_settings_collection=None): - super(ApplicationGatewayBackendHealthPool, self).__init__() - self.backend_address_pool = backend_address_pool - self.backend_http_settings_collection = backend_http_settings_collection + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_pool_py3.py new file mode 100644 index 000000000000..7b1073c5b5f1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_pool_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthPool(Model): + """Application gateway BackendHealth pool. + + :param backend_address_pool: Reference of an + ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of + ApplicationGatewayBackendHealthHttpSettings resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, + } + + def __init__(self, *, backend_address_pool=None, backend_http_settings_collection=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_http_settings_collection = backend_http_settings_collection diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_py3.py new file mode 100644 index 000000000000..8dae80ab89ba --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealth(Model): + """List of ApplicationGatewayBackendHealthPool resources. + + :param backend_address_pools: + :type backend_address_pools: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendHealthPool] + """ + + _attribute_map = { + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, + } + + def __init__(self, *, backend_address_pools=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = backend_address_pools diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_server.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_server.py index 70c6119ec6c3..ff1fba1ed79d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_server.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_server.py @@ -32,8 +32,8 @@ class ApplicationGatewayBackendHealthServer(Model): 'health': {'key': 'health', 'type': 'str'}, } - def __init__(self, address=None, ip_configuration=None, health=None): - super(ApplicationGatewayBackendHealthServer, self).__init__() - self.address = address - self.ip_configuration = ip_configuration - self.health = health + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + self.ip_configuration = kwargs.get('ip_configuration', None) + self.health = kwargs.get('health', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_server_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_server_py3.py new file mode 100644 index 000000000000..69c234472b59 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_health_server_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthServer(Model): + """Application gateway backendhealth http settings. + + :param address: IP address or FQDN of backend server. + :type address: str + :param ip_configuration: Reference of IP configuration of backend server. + :type ip_configuration: + ~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceIPConfiguration + :param health: Health of backend server. Possible values include: + 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + :type health: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendHealthServerHealth + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'health': {'key': 'health', 'type': 'str'}, + } + + def __init__(self, *, address: str=None, ip_configuration=None, health=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = address + self.ip_configuration = ip_configuration + self.health = health diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_http_settings.py index fe94e4aa50aa..480faa6d29ae 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_http_settings.py @@ -87,21 +87,21 @@ class ApplicationGatewayBackendHttpSettings(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, port=None, protocol=None, cookie_based_affinity=None, request_timeout=None, probe=None, authentication_certificates=None, connection_draining=None, host_name=None, pick_host_name_from_backend_address=None, affinity_cookie_name=None, probe_enabled=None, path=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id) - self.port = port - self.protocol = protocol - self.cookie_based_affinity = cookie_based_affinity - self.request_timeout = request_timeout - self.probe = probe - self.authentication_certificates = authentication_certificates - self.connection_draining = connection_draining - self.host_name = host_name - self.pick_host_name_from_backend_address = pick_host_name_from_backend_address - self.affinity_cookie_name = affinity_cookie_name - self.probe_enabled = probe_enabled - self.path = path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHttpSettings, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.protocol = kwargs.get('protocol', None) + self.cookie_based_affinity = kwargs.get('cookie_based_affinity', None) + self.request_timeout = kwargs.get('request_timeout', None) + self.probe = kwargs.get('probe', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.connection_draining = kwargs.get('connection_draining', None) + self.host_name = kwargs.get('host_name', None) + self.pick_host_name_from_backend_address = kwargs.get('pick_host_name_from_backend_address', None) + self.affinity_cookie_name = kwargs.get('affinity_cookie_name', None) + self.probe_enabled = kwargs.get('probe_enabled', None) + self.path = kwargs.get('path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_http_settings_py3.py new file mode 100644 index 000000000000..5d6dcd711905 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_backend_http_settings_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendHttpSettings(SubResource): + """Backend address pool settings of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Port + :type port: int + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayProtocol + :param cookie_based_affinity: Cookie based affinity. Possible values + include: 'Enabled', 'Disabled' + :type cookie_based_affinity: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayCookieBasedAffinity + :param request_timeout: Request timeout in seconds. Application Gateway + will fail the request if response is not received within RequestTimeout. + Acceptable values are from 1 second to 86400 seconds. + :type request_timeout: int + :param probe: Probe resource of an application gateway. + :type probe: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param authentication_certificates: Array of references to application + gateway authentication certificates. + :type authentication_certificates: + list[~azure.mgmt.network.v2017_06_01.models.SubResource] + :param connection_draining: Connection draining of the backend http + settings resource. + :type connection_draining: + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayConnectionDraining + :param host_name: Host header to be sent to the backend servers. + :type host_name: str + :param pick_host_name_from_backend_address: Whether to pick host header + should be picked from the host name of the backend server. Default value + is false. + :type pick_host_name_from_backend_address: bool + :param affinity_cookie_name: Cookie name to use for the affinity cookie. + :type affinity_cookie_name: str + :param probe_enabled: Whether the probe is enabled. Default value is + false. + :type probe_enabled: bool + :param path: Path which should be used as a prefix for all HTTP requests. + Null means no path will be prefixed. Default value is null. + :type path: str + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, + 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, + 'connection_draining': {'key': 'properties.connectionDraining', 'type': 'ApplicationGatewayConnectionDraining'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'pick_host_name_from_backend_address': {'key': 'properties.pickHostNameFromBackendAddress', 'type': 'bool'}, + 'affinity_cookie_name': {'key': 'properties.affinityCookieName', 'type': 'str'}, + 'probe_enabled': {'key': 'properties.probeEnabled', 'type': 'bool'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, protocol=None, cookie_based_affinity=None, request_timeout: int=None, probe=None, authentication_certificates=None, connection_draining=None, host_name: str=None, pick_host_name_from_backend_address: bool=None, affinity_cookie_name: str=None, probe_enabled: bool=None, path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id, **kwargs) + self.port = port + self.protocol = protocol + self.cookie_based_affinity = cookie_based_affinity + self.request_timeout = request_timeout + self.probe = probe + self.authentication_certificates = authentication_certificates + self.connection_draining = connection_draining + self.host_name = host_name + self.pick_host_name_from_backend_address = pick_host_name_from_backend_address + self.affinity_cookie_name = affinity_cookie_name + self.probe_enabled = probe_enabled + self.path = path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_connection_draining.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_connection_draining.py index 8f9b88b571e2..531b3cb05dd3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_connection_draining.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_connection_draining.py @@ -17,10 +17,12 @@ class ApplicationGatewayConnectionDraining(Model): active for a specified time after the backend server got removed from the configuration. - :param enabled: Whether connection draining is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. :type enabled: bool - :param drain_timeout_in_sec: The number of seconds connection draining is - active. Acceptable values are from 1 second to 3600 seconds. + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. :type drain_timeout_in_sec: int """ @@ -34,7 +36,7 @@ class ApplicationGatewayConnectionDraining(Model): 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, } - def __init__(self, enabled, drain_timeout_in_sec): - super(ApplicationGatewayConnectionDraining, self).__init__() - self.enabled = enabled - self.drain_timeout_in_sec = drain_timeout_in_sec + def __init__(self, **kwargs): + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.drain_timeout_in_sec = kwargs.get('drain_timeout_in_sec', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_connection_draining_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_connection_draining_py3.py new file mode 100644 index 000000000000..c46fb01cae72 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_connection_draining_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayConnectionDraining(Model): + """Connection draining allows open connections to a backend server to be + active for a specified time after the backend server got removed from the + configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. + :type enabled: bool + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. + :type drain_timeout_in_sec: int + """ + + _validation = { + 'enabled': {'required': True}, + 'drain_timeout_in_sec': {'required': True, 'maximum': 3600, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool, drain_timeout_in_sec: int, **kwargs) -> None: + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = enabled + self.drain_timeout_in_sec = drain_timeout_in_sec diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_disabled_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_disabled_rule_group.py index 02c88980e857..085ae3d78c5c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_disabled_rule_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_disabled_rule_group.py @@ -15,7 +15,10 @@ class ApplicationGatewayFirewallDisabledRuleGroup(Model): """Allows to disable rules within a rule group or an entire rule group. - :param rule_group_name: The name of the rule group that will be disabled. + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. :type rule_group_name: str :param rules: The list of rules that will be disabled. If null, all rules of the rule group will be disabled. @@ -31,7 +34,7 @@ class ApplicationGatewayFirewallDisabledRuleGroup(Model): 'rules': {'key': 'rules', 'type': '[int]'}, } - def __init__(self, rule_group_name, rules=None): - super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__() - self.rule_group_name = rule_group_name - self.rules = rules + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_disabled_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_disabled_rule_group_py3.py new file mode 100644 index 000000000000..44ac696b801c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_disabled_rule_group_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallDisabledRuleGroup(Model): + """Allows to disable rules within a rule group or an entire rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. + :type rule_group_name: str + :param rules: The list of rules that will be disabled. If null, all rules + of the rule group will be disabled. + :type rules: list[int] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[int]'}, + } + + def __init__(self, *, rule_group_name: str, rules=None, **kwargs) -> None: + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule.py index f3f7da7cc11b..661b0d146e16 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule.py @@ -15,7 +15,10 @@ class ApplicationGatewayFirewallRule(Model): """A web application firewall rule. - :param rule_id: The identifier of the web application firewall rule. + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. :type rule_id: int :param description: The description of the web application firewall rule. :type description: str @@ -30,7 +33,7 @@ class ApplicationGatewayFirewallRule(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, rule_id, description=None): - super(ApplicationGatewayFirewallRule, self).__init__() - self.rule_id = rule_id - self.description = description + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_group.py index b3ae90ab94b6..f8b093f796c7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_group.py @@ -15,13 +15,16 @@ class ApplicationGatewayFirewallRuleGroup(Model): """A web application firewall rule group. - :param rule_group_name: The name of the web application firewall rule - group. + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. :type rule_group_name: str :param description: The description of the web application firewall rule group. :type description: str - :param rules: The rules of the web application firewall rule group. + :param rules: Required. The rules of the web application firewall rule + group. :type rules: list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayFirewallRule] """ @@ -37,8 +40,8 @@ class ApplicationGatewayFirewallRuleGroup(Model): 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, } - def __init__(self, rule_group_name, rules, description=None): - super(ApplicationGatewayFirewallRuleGroup, self).__init__() - self.rule_group_name = rule_group_name - self.description = description - self.rules = rules + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.description = kwargs.get('description', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_group_py3.py new file mode 100644 index 000000000000..c7815664805e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_group_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRuleGroup(Model): + """A web application firewall rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. + :type rule_group_name: str + :param description: The description of the web application firewall rule + group. + :type description: str + :param rules: Required. The rules of the web application firewall rule + group. + :type rules: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayFirewallRule] + """ + + _validation = { + 'rule_group_name': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, + } + + def __init__(self, *, rule_group_name: str, rules, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.description = description + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_py3.py new file mode 100644 index 000000000000..e332fbd16853 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRule(Model): + """A web application firewall rule. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. + :type rule_id: int + :param description: The description of the web application firewall rule. + :type description: str + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, rule_id: int, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = rule_id + self.description = description diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_set.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_set.py index b568c29702a8..1d58f962ac9a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_set.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_set.py @@ -18,6 +18,8 @@ class ApplicationGatewayFirewallRuleSet(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -31,13 +33,14 @@ class ApplicationGatewayFirewallRuleSet(Resource): :param provisioning_state: The provisioning state of the web application firewall rule set. :type provisioning_state: str - :param rule_set_type: The type of the web application firewall rule set. + :param rule_set_type: Required. The type of the web application firewall + rule set. :type rule_set_type: str - :param rule_set_version: The version of the web application firewall rule - set type. + :param rule_set_version: Required. The version of the web application + firewall rule set type. :type rule_set_version: str - :param rule_groups: The rule groups of the web application firewall rule - set. + :param rule_groups: Required. The rule groups of the web application + firewall rule set. :type rule_groups: list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayFirewallRuleGroup] """ @@ -62,9 +65,9 @@ class ApplicationGatewayFirewallRuleSet(Resource): 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, } - def __init__(self, rule_set_type, rule_set_version, rule_groups, id=None, location=None, tags=None, provisioning_state=None): - super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags) - self.provisioning_state = provisioning_state - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.rule_groups = rule_groups + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleSet, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.rule_groups = kwargs.get('rule_groups', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_set_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_set_py3.py new file mode 100644 index 000000000000..5df851b1412d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_set_py3.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayFirewallRuleSet(Resource): + """A web application firewall rule set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param provisioning_state: The provisioning state of the web application + firewall rule set. + :type provisioning_state: str + :param rule_set_type: Required. The type of the web application firewall + rule set. + :type rule_set_type: str + :param rule_set_version: Required. The version of the web application + firewall rule set type. + :type rule_set_version: str + :param rule_groups: Required. The rule groups of the web application + firewall rule set. + :type rule_groups: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayFirewallRuleGroup] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'rule_groups': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, + } + + def __init__(self, *, rule_set_type: str, rule_set_version: str, rule_groups, id: str=None, location: str=None, tags=None, provisioning_state: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.rule_groups = rule_groups diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_ip_configuration.py index 3205a619bd0f..4c807142f87d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_ip_configuration.py @@ -54,13 +54,13 @@ class ApplicationGatewayFrontendIPConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..bfd62f91348f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_ip_configuration_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): + """Frontend IP configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param private_ip_address: PrivateIPAddress of the network interface IP + Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: PrivateIP allocation method. Possible + values include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_06_01.models.IPAllocationMethod + :param subnet: Reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param provisioning_state: Provisioning state of the public IP resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_port.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_port.py index 2b1b32d1b79e..318c0554db0a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_port.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_port.py @@ -41,10 +41,10 @@ class ApplicationGatewayFrontendPort(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, port=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayFrontendPort, self).__init__(id=id) - self.port = port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendPort, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_port_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_port_py3.py new file mode 100644 index 000000000000..03c6c0a31e9c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_frontend_port_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Frontend port + :type port: int + :param provisioning_state: Provisioning state of the frontend port + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendPort, self).__init__(id=id, **kwargs) + self.port = port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_http_listener.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_http_listener.py index 43b46895a55c..ecdc721cb515 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_http_listener.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_http_listener.py @@ -61,15 +61,15 @@ class ApplicationGatewayHttpListener(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name=None, ssl_certificate=None, require_server_name_indication=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayHttpListener, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.frontend_port = frontend_port - self.protocol = protocol - self.host_name = host_name - self.ssl_certificate = ssl_certificate - self.require_server_name_indication = require_server_name_indication - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayHttpListener, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.protocol = kwargs.get('protocol', None) + self.host_name = kwargs.get('host_name', None) + self.ssl_certificate = kwargs.get('ssl_certificate', None) + self.require_server_name_indication = kwargs.get('require_server_name_indication', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_http_listener_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_http_listener_py3.py new file mode 100644 index 000000000000..456590eec064 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_http_listener_py3.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayHttpListener(SubResource): + """Http listener of an application gateway. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: Frontend IP configuration resource of an + application gateway. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayProtocol + :param host_name: Host name of HTTP listener. + :type host_name: str + :param ssl_certificate: SSL certificate resource of an application + gateway. + :type ssl_certificate: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param require_server_name_indication: Applicable only if protocol is + https. Enables SNI for multi-hosting. + :type require_server_name_indication: bool + :param provisioning_state: Provisioning state of the HTTP listener + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, + 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name: str=None, ssl_certificate=None, require_server_name_indication: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayHttpListener, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.frontend_port = frontend_port + self.protocol = protocol + self.host_name = host_name + self.ssl_certificate = ssl_certificate + self.require_server_name_indication = require_server_name_indication + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ip_configuration.py index d1feba163f6c..c4516efb6683 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ip_configuration.py @@ -44,10 +44,10 @@ class ApplicationGatewayIPConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, subnet=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayIPConfiguration, self).__init__(id=id) - self.subnet = subnet - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayIPConfiguration, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..f2695c84b4f5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ip_configuration_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 + private IP configuration is allowed. + + :param id: Resource ID. + :type id: str + :param subnet: Reference of the subnet resource. A subnet from where + application gateway gets its private address. + :type subnet: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param provisioning_state: Provisioning state of the application gateway + subnet resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, subnet=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.subnet = subnet + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_path_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_path_rule.py index db7d8eb7a9d5..572a5d28c101 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_path_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_path_rule.py @@ -56,13 +56,13 @@ class ApplicationGatewayPathRule(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, paths=None, backend_address_pool=None, backend_http_settings=None, redirect_configuration=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayPathRule, self).__init__(id=id) - self.paths = paths - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.redirect_configuration = redirect_configuration - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayPathRule, self).__init__(**kwargs) + self.paths = kwargs.get('paths', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_path_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_path_rule_py3.py new file mode 100644 index 000000000000..d46f90fe716b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_path_rule_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayPathRule(SubResource): + """Path rule of URL path map of an application gateway. + + :param id: Resource ID. + :type id: str + :param paths: Path rules of URL path map. + :type paths: list[str] + :param backend_address_pool: Backend address pool resource of URL path map + path rule. + :type backend_address_pool: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param backend_http_settings: Backend http settings resource of URL path + map path rule. + :type backend_http_settings: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of URL path + map path rule. + :type redirect_configuration: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param provisioning_state: Path rule of URL path map resource. Possible + values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'paths': {'key': 'properties.paths', 'type': '[str]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, paths=None, backend_address_pool=None, backend_http_settings=None, redirect_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayPathRule, self).__init__(id=id, **kwargs) + self.paths = paths + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.redirect_configuration = redirect_configuration + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe.py index f284bb1ab7d6..955ab12a0989 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe.py @@ -76,18 +76,18 @@ class ApplicationGatewayProbe(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, protocol=None, host=None, path=None, interval=None, timeout=None, unhealthy_threshold=None, pick_host_name_from_backend_http_settings=None, min_servers=None, match=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayProbe, self).__init__(id=id) - self.protocol = protocol - self.host = host - self.path = path - self.interval = interval - self.timeout = timeout - self.unhealthy_threshold = unhealthy_threshold - self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings - self.min_servers = min_servers - self.match = match - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayProbe, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.host = kwargs.get('host', None) + self.path = kwargs.get('path', None) + self.interval = kwargs.get('interval', None) + self.timeout = kwargs.get('timeout', None) + self.unhealthy_threshold = kwargs.get('unhealthy_threshold', None) + self.pick_host_name_from_backend_http_settings = kwargs.get('pick_host_name_from_backend_http_settings', None) + self.min_servers = kwargs.get('min_servers', None) + self.match = kwargs.get('match', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe_health_response_match.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe_health_response_match.py index beaef556eb99..b439b9677f8b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe_health_response_match.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe_health_response_match.py @@ -28,7 +28,7 @@ class ApplicationGatewayProbeHealthResponseMatch(Model): 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, } - def __init__(self, body=None, status_codes=None): - super(ApplicationGatewayProbeHealthResponseMatch, self).__init__() - self.body = body - self.status_codes = status_codes + def __init__(self, **kwargs): + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = kwargs.get('body', None) + self.status_codes = kwargs.get('status_codes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe_health_response_match_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe_health_response_match_py3.py new file mode 100644 index 000000000000..6ed2ee8c04ed --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe_health_response_match_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayProbeHealthResponseMatch(Model): + """Application gateway probe health response match. + + :param body: Body that must be contained in the health response. Default + value is empty. + :type body: str + :param status_codes: Allowed ranges of healthy status codes. Default range + of healthy status codes is 200-399. + :type status_codes: list[str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'str'}, + 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, + } + + def __init__(self, *, body: str=None, status_codes=None, **kwargs) -> None: + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = body + self.status_codes = status_codes diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe_py3.py new file mode 100644 index 000000000000..1f65edb060f9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayProbe(SubResource): + """Probe of the application gateway. + + :param id: Resource ID. + :type id: str + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is + sent to ://: + :type path: str + :param interval: The probing interval in seconds. This is the time + interval between two consecutive probes. Acceptable values are from 1 + second to 86400 seconds. + :type interval: int + :param timeout: the probe timeout in seconds. Probe marked as failed if + valid response is not received with this timeout period. Acceptable values + are from 1 second to 86400 seconds. + :type timeout: int + :param unhealthy_threshold: The probe retry count. Backend server is + marked down after consecutive probe failure count reaches + UnhealthyThreshold. Acceptable values are from 1 second to 20. + :type unhealthy_threshold: int + :param pick_host_name_from_backend_http_settings: Whether the host header + should be picked from the backend http settings. Default value is false. + :type pick_host_name_from_backend_http_settings: bool + :param min_servers: Minimum number of servers that are always marked + healthy. Default value is 0. + :type min_servers: int + :param match: Criterion for classifying a healthy probe response. + :type match: + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayProbeHealthResponseMatch + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host': {'key': 'properties.host', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, + 'pick_host_name_from_backend_http_settings': {'key': 'properties.pickHostNameFromBackendHttpSettings', 'type': 'bool'}, + 'min_servers': {'key': 'properties.minServers', 'type': 'int'}, + 'match': {'key': 'properties.match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, protocol=None, host: str=None, path: str=None, interval: int=None, timeout: int=None, unhealthy_threshold: int=None, pick_host_name_from_backend_http_settings: bool=None, min_servers: int=None, match=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayProbe, self).__init__(id=id, **kwargs) + self.protocol = protocol + self.host = host + self.path = path + self.interval = interval + self.timeout = timeout + self.unhealthy_threshold = unhealthy_threshold + self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings + self.min_servers = min_servers + self.match = match + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_py3.py new file mode 100644 index 000000000000..8b0a8e22d758 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_py3.py @@ -0,0 +1,153 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGateway(Resource): + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslPolicy + :ivar operational_state: Operational state of the application gateway + resource. Possible values include: 'Stopped', 'Starting', 'Running', + 'Stopping' + :vartype operational_state: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayOperationalState + :param gateway_ip_configurations: Subnets of application the gateway + resource. + :type gateway_ip_configurations: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayIPConfiguration] + :param authentication_certificates: Authentication certificates of the + application gateway resource. + :type authentication_certificates: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayAuthenticationCertificate] + :param ssl_certificates: SSL certificates of the application gateway + resource. + :type ssl_certificates: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslCertificate] + :param frontend_ip_configurations: Frontend IP addresses of the + application gateway resource. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayFrontendIPConfiguration] + :param frontend_ports: Frontend ports of the application gateway resource. + :type frontend_ports: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayProbe] + :param backend_address_pools: Backend address pool of the application + gateway resource. + :type backend_address_pools: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendAddressPool] + :param backend_http_settings_collection: Backend http settings of the + application gateway resource. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendHttpSettings] + :param http_listeners: Http listeners of the application gateway resource. + :type http_listeners: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayHttpListener] + :param url_path_maps: URL path map of the application gateway resource. + :type url_path_maps: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application + gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayRequestRoutingRule] + :param redirect_configurations: Redirect configurations of the application + gateway resource. + :type redirect_configurations: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayRedirectConfiguration] + :param web_application_firewall_configuration: Web application firewall + configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param resource_guid: Resource GUID property of the application gateway + resource. + :type resource_guid: str + :param provisioning_state: Provisioning state of the application gateway + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operational_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, + 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, + 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, + 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, + 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, + 'redirect_configurations': {'key': 'properties.redirectConfigurations', 'type': '[ApplicationGatewayRedirectConfiguration]'}, + 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, redirect_configurations=None, web_application_firewall_configuration=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.ssl_policy = ssl_policy + self.operational_state = None + self.gateway_ip_configurations = gateway_ip_configurations + self.authentication_certificates = authentication_certificates + self.ssl_certificates = ssl_certificates + self.frontend_ip_configurations = frontend_ip_configurations + self.frontend_ports = frontend_ports + self.probes = probes + self.backend_address_pools = backend_address_pools + self.backend_http_settings_collection = backend_http_settings_collection + self.http_listeners = http_listeners + self.url_path_maps = url_path_maps + self.request_routing_rules = request_routing_rules + self.redirect_configurations = redirect_configurations + self.web_application_firewall_configuration = web_application_firewall_configuration + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_redirect_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_redirect_configuration.py index a8c71a75e547..df4d3b703f5f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_redirect_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_redirect_configuration.py @@ -66,16 +66,16 @@ class ApplicationGatewayRedirectConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, redirect_type=None, target_listener=None, target_url=None, include_path=None, include_query_string=None, request_routing_rules=None, url_path_maps=None, path_rules=None, name=None, etag=None, type=None): - super(ApplicationGatewayRedirectConfiguration, self).__init__(id=id) - self.redirect_type = redirect_type - self.target_listener = target_listener - self.target_url = target_url - self.include_path = include_path - self.include_query_string = include_query_string - self.request_routing_rules = request_routing_rules - self.url_path_maps = url_path_maps - self.path_rules = path_rules - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayRedirectConfiguration, self).__init__(**kwargs) + self.redirect_type = kwargs.get('redirect_type', None) + self.target_listener = kwargs.get('target_listener', None) + self.target_url = kwargs.get('target_url', None) + self.include_path = kwargs.get('include_path', None) + self.include_query_string = kwargs.get('include_query_string', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.path_rules = kwargs.get('path_rules', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_redirect_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_redirect_configuration_py3.py new file mode 100644 index 000000000000..d672274c28db --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_redirect_configuration_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRedirectConfiguration(SubResource): + """Redirect configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param redirect_type: Supported http redirection types - Permanent, + Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', + 'SeeOther', 'Temporary' + :type redirect_type: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayRedirectType + :param target_listener: Reference to a listener to redirect the request + to. + :type target_listener: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param target_url: Url to redirect the request to. + :type target_url: str + :param include_path: Include path in the redirected url. + :type include_path: bool + :param include_query_string: Include query string in the redirected url. + :type include_query_string: bool + :param request_routing_rules: Request routing specifying redirect + configuration. + :type request_routing_rules: + list[~azure.mgmt.network.v2017_06_01.models.SubResource] + :param url_path_maps: Url path maps specifying default redirect + configuration. + :type url_path_maps: + list[~azure.mgmt.network.v2017_06_01.models.SubResource] + :param path_rules: Path rules specifying redirect configuration. + :type path_rules: list[~azure.mgmt.network.v2017_06_01.models.SubResource] + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'redirect_type': {'key': 'properties.redirectType', 'type': 'str'}, + 'target_listener': {'key': 'properties.targetListener', 'type': 'SubResource'}, + 'target_url': {'key': 'properties.targetUrl', 'type': 'str'}, + 'include_path': {'key': 'properties.includePath', 'type': 'bool'}, + 'include_query_string': {'key': 'properties.includeQueryString', 'type': 'bool'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[SubResource]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[SubResource]'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[SubResource]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, redirect_type=None, target_listener=None, target_url: str=None, include_path: bool=None, include_query_string: bool=None, request_routing_rules=None, url_path_maps=None, path_rules=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayRedirectConfiguration, self).__init__(id=id, **kwargs) + self.redirect_type = redirect_type + self.target_listener = target_listener + self.target_url = target_url + self.include_path = include_path + self.include_query_string = include_query_string + self.request_routing_rules = request_routing_rules + self.url_path_maps = url_path_maps + self.path_rules = path_rules + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_request_routing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_request_routing_rule.py index 4d80c332e4e2..85adb6678c43 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_request_routing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_request_routing_rule.py @@ -64,15 +64,15 @@ class ApplicationGatewayRequestRoutingRule(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, redirect_configuration=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id) - self.rule_type = rule_type - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.http_listener = http_listener - self.url_path_map = url_path_map - self.redirect_configuration = redirect_configuration - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayRequestRoutingRule, self).__init__(**kwargs) + self.rule_type = kwargs.get('rule_type', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.http_listener = kwargs.get('http_listener', None) + self.url_path_map = kwargs.get('url_path_map', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_request_routing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_request_routing_rule_py3.py new file mode 100644 index 000000000000..07e581832dfb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_request_routing_rule_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRequestRoutingRule(SubResource): + """Request routing rule of an application gateway. + + :param id: Resource ID. + :type id: str + :param rule_type: Rule type. Possible values include: 'Basic', + 'PathBasedRouting' + :type rule_type: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayRequestRoutingRuleType + :param backend_address_pool: Backend address pool resource of the + application gateway. + :type backend_address_pool: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param backend_http_settings: Frontend port resource of the application + gateway. + :type backend_http_settings: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of the + application gateway. + :type redirect_configuration: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param provisioning_state: Provisioning state of the request routing rule + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, + 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, redirect_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id, **kwargs) + self.rule_type = rule_type + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.http_listener = http_listener + self.url_path_map = url_path_map + self.redirect_configuration = redirect_configuration + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_sku.py index 61717b20136a..e01e714569d2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_sku.py @@ -34,8 +34,8 @@ class ApplicationGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(ApplicationGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_sku_py3.py new file mode 100644 index 000000000000..0dd0664fbe0b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_sku_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySku(Model): + """SKU of an application gateway. + + :param name: Name of an application gateway SKU. Possible values include: + 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', + 'WAF_Large' + :type name: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySkuName + :param tier: Tier of an application gateway. Possible values include: + 'Standard', 'WAF' + :type tier: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayTier + :param capacity: Capacity (instance count) of an application gateway. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_certificate.py index 104629e84a5c..1dfedd4908df 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_certificate.py @@ -50,12 +50,12 @@ class ApplicationGatewaySslCertificate(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, data=None, password=None, public_cert_data=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewaySslCertificate, self).__init__(id=id) - self.data = data - self.password = password - self.public_cert_data = public_cert_data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewaySslCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.password = kwargs.get('password', None) + self.public_cert_data = kwargs.get('public_cert_data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_certificate_py3.py new file mode 100644 index 000000000000..ddb6745c9005 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_certificate_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Base-64 encoded pfx certificate. Only applicable in PUT + Request. + :type data: str + :param password: Password for the pfx file specified in data. Only + applicable in PUT request. + :type password: str + :param public_cert_data: Base-64 encoded Public cert data corresponding to + pfx specified in data. Only applicable in GET request. + :type public_cert_data: str + :param provisioning_state: Provisioning state of the SSL certificate + resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, password: str=None, public_cert_data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewaySslCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.password = password + self.public_cert_data = public_cert_data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_policy.py index 3d060d0e738d..1c9038fba0a1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_policy.py @@ -47,10 +47,10 @@ class ApplicationGatewaySslPolicy(Model): 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, } - def __init__(self, disabled_ssl_protocols=None, policy_type=None, policy_name=None, cipher_suites=None, min_protocol_version=None): - super(ApplicationGatewaySslPolicy, self).__init__() - self.disabled_ssl_protocols = disabled_ssl_protocols - self.policy_type = policy_type - self.policy_name = policy_name - self.cipher_suites = cipher_suites - self.min_protocol_version = min_protocol_version + def __init__(self, **kwargs): + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = kwargs.get('disabled_ssl_protocols', None) + self.policy_type = kwargs.get('policy_type', None) + self.policy_name = kwargs.get('policy_name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_policy_py3.py new file mode 100644 index 000000000000..f087f490e18e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_policy_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySslPolicy(Model): + """Application Gateway Ssl policy. + + :param disabled_ssl_protocols: Ssl protocols to be disabled on application + gateway. + :type disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslProtocol] + :param policy_type: Type of Ssl Policy. Possible values include: + 'Predefined', 'Custom' + :type policy_type: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslPolicyType + :param policy_name: Name of Ssl predefined policy. Possible values + include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type policy_name: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslPolicyName + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order to application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, + 'policy_type': {'key': 'policyType', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'cipher_suites': {'key': 'cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, *, disabled_ssl_protocols=None, policy_type=None, policy_name=None, cipher_suites=None, min_protocol_version=None, **kwargs) -> None: + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = disabled_ssl_protocols + self.policy_type = policy_type + self.policy_name = policy_name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_predefined_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_predefined_policy.py index 69df773bb385..d13a9a9da5aa 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_predefined_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_predefined_policy.py @@ -37,8 +37,8 @@ class ApplicationGatewaySslPredefinedPolicy(SubResource): 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, } - def __init__(self, id=None, name=None, cipher_suites=None, min_protocol_version=None): - super(ApplicationGatewaySslPredefinedPolicy, self).__init__(id=id) - self.name = name - self.cipher_suites = cipher_suites - self.min_protocol_version = min_protocol_version + def __init__(self, **kwargs): + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_predefined_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_predefined_policy_py3.py new file mode 100644 index 000000000000..2b01d1178408 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_ssl_predefined_policy_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslPredefinedPolicy(SubResource): + """An Ssl predefined policy. + + :param id: Resource ID. + :type id: str + :param name: Name of Ssl predefined policy. + :type name: str + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order for application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, cipher_suites=None, min_protocol_version=None, **kwargs) -> None: + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(id=id, **kwargs) + self.name = name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_url_path_map.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_url_path_map.py index 5e6d18f04c28..e6961e9d89de 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_url_path_map.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_url_path_map.py @@ -58,13 +58,13 @@ class ApplicationGatewayUrlPathMap(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, default_backend_address_pool=None, default_backend_http_settings=None, default_redirect_configuration=None, path_rules=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayUrlPathMap, self).__init__(id=id) - self.default_backend_address_pool = default_backend_address_pool - self.default_backend_http_settings = default_backend_http_settings - self.default_redirect_configuration = default_redirect_configuration - self.path_rules = path_rules - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayUrlPathMap, self).__init__(**kwargs) + self.default_backend_address_pool = kwargs.get('default_backend_address_pool', None) + self.default_backend_http_settings = kwargs.get('default_backend_http_settings', None) + self.default_redirect_configuration = kwargs.get('default_redirect_configuration', None) + self.path_rules = kwargs.get('path_rules', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_url_path_map_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_url_path_map_py3.py new file mode 100644 index 000000000000..aefa12dbe3d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_url_path_map_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayUrlPathMap(SubResource): + """UrlPathMaps give a url path to the backend mapping information for + PathBasedRouting. + + :param id: Resource ID. + :type id: str + :param default_backend_address_pool: Default backend address pool resource + of URL path map. + :type default_backend_address_pool: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param default_backend_http_settings: Default backend http settings + resource of URL path map. + :type default_backend_http_settings: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param default_redirect_configuration: Default redirect configuration + resource of URL path map. + :type default_redirect_configuration: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayPathRule] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, + 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, + 'default_redirect_configuration': {'key': 'properties.defaultRedirectConfiguration', 'type': 'SubResource'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, default_backend_address_pool=None, default_backend_http_settings=None, default_redirect_configuration=None, path_rules=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayUrlPathMap, self).__init__(id=id, **kwargs) + self.default_backend_address_pool = default_backend_address_pool + self.default_backend_http_settings = default_backend_http_settings + self.default_redirect_configuration = default_redirect_configuration + self.path_rules = path_rules + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_web_application_firewall_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_web_application_firewall_configuration.py index c64a1549fd2b..8b0dee698d9e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_web_application_firewall_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_web_application_firewall_configuration.py @@ -15,16 +15,19 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): """Application gateway web application firewall configuration. - :param enabled: Whether the web application firewall is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. :type enabled: bool - :param firewall_mode: Web application firewall mode. Possible values - include: 'Detection', 'Prevention' + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' :type firewall_mode: str or ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayFirewallMode - :param rule_set_type: The type of the web application firewall rule set. - Possible values are: 'OWASP'. + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. :type rule_set_type: str - :param rule_set_version: The version of the rule set type. + :param rule_set_version: Required. The version of the rule set type. :type rule_set_version: str :param disabled_rule_groups: The disabled rule groups. :type disabled_rule_groups: @@ -46,10 +49,10 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, } - def __init__(self, enabled, firewall_mode, rule_set_type, rule_set_version, disabled_rule_groups=None): - super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__() - self.enabled = enabled - self.firewall_mode = firewall_mode - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.disabled_rule_groups = disabled_rule_groups + def __init__(self, **kwargs): + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.firewall_mode = kwargs.get('firewall_mode', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.disabled_rule_groups = kwargs.get('disabled_rule_groups', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_web_application_firewall_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_web_application_firewall_configuration_py3.py new file mode 100644 index 000000000000..ae26a0ad7366 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_web_application_firewall_configuration_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayWebApplicationFirewallConfiguration(Model): + """Application gateway web application firewall configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. + :type enabled: bool + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' + :type firewall_mode: str or + ~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayFirewallMode + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. + :type rule_set_type: str + :param rule_set_version: Required. The version of the rule set type. + :type rule_set_version: str + :param disabled_rule_groups: The disabled rule groups. + :type disabled_rule_groups: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayFirewallDisabledRuleGroup] + """ + + _validation = { + 'enabled': {'required': True}, + 'firewall_mode': {'required': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, + } + + def __init__(self, *, enabled: bool, firewall_mode, rule_set_type: str, rule_set_version: str, disabled_rule_groups=None, **kwargs) -> None: + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = enabled + self.firewall_mode = firewall_mode + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.disabled_rule_groups = disabled_rule_groups diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/azure_async_operation_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/azure_async_operation_result.py index 60684d2b61e0..91074a57597b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/azure_async_operation_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/azure_async_operation_result.py @@ -36,7 +36,7 @@ class AzureAsyncOperationResult(Model): 'error': {'key': 'error', 'type': 'Error'}, } - def __init__(self, status=None, error=None): - super(AzureAsyncOperationResult, self).__init__() - self.status = status - self.error = error + def __init__(self, **kwargs): + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/azure_async_operation_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/azure_async_operation_result_py3.py new file mode 100644 index 000000000000..698c3f40958a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/azure_async_operation_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureAsyncOperationResult(Model): + """The response body contains the status of the specified asynchronous + operation, indicating whether it has succeeded, is in progress, or has + failed. Note that this status is distinct from the HTTP status code + returned for the Get Operation Status operation itself. If the asynchronous + operation succeeded, the response body includes the HTTP status code for + the successful request. If the asynchronous operation failed, the response + body includes the HTTP status code for the failed request and error + information regarding the failure. + + :param status: Status of the Azure async operation. Possible values are: + 'InProgress', 'Succeeded', and 'Failed'. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or + ~azure.mgmt.network.v2017_06_01.models.NetworkOperationStatus + :param error: + :type error: ~azure.mgmt.network.v2017_06_01.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, status=None, error=None, **kwargs) -> None: + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/backend_address_pool.py index 0b55696b00f4..dc64679c904e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/backend_address_pool.py @@ -59,11 +59,11 @@ class BackendAddressPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, provisioning_state=None, name=None, etag=None): - super(BackendAddressPool, self).__init__(id=id) + def __init__(self, **kwargs): + super(BackendAddressPool, self).__init__(**kwargs) self.backend_ip_configurations = None self.load_balancing_rules = None self.outbound_nat_rule = None - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/backend_address_pool_py3.py new file mode 100644 index 000000000000..1b1c2eb47f92 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/backend_address_pool_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class BackendAddressPool(SubResource): + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar backend_ip_configurations: Gets collection of references to IP + addresses defined in network interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: Gets load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_06_01.models.SubResource] + :ivar outbound_nat_rule: Gets outbound rules that use this backend address + pool. + :vartype outbound_nat_rule: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param provisioning_state: Get provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configurations': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'outbound_nat_rule': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'outbound_nat_rule': {'key': 'properties.outboundNatRule', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(BackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = None + self.load_balancing_rules = None + self.outbound_nat_rule = None + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_community.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_community.py index 8275a0e4048c..472a170e9ceb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_community.py @@ -42,11 +42,11 @@ class BGPCommunity(Model): 'service_group': {'key': 'serviceGroup', 'type': 'str'}, } - def __init__(self, service_supported_region=None, community_name=None, community_value=None, community_prefixes=None, is_authorized_to_use=None, service_group=None): - super(BGPCommunity, self).__init__() - self.service_supported_region = service_supported_region - self.community_name = community_name - self.community_value = community_value - self.community_prefixes = community_prefixes - self.is_authorized_to_use = is_authorized_to_use - self.service_group = service_group + def __init__(self, **kwargs): + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = kwargs.get('service_supported_region', None) + self.community_name = kwargs.get('community_name', None) + self.community_value = kwargs.get('community_value', None) + self.community_prefixes = kwargs.get('community_prefixes', None) + self.is_authorized_to_use = kwargs.get('is_authorized_to_use', None) + self.service_group = kwargs.get('service_group', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_community_py3.py new file mode 100644 index 000000000000..86b740c84404 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_community_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BGPCommunity(Model): + """Contains bgp community information offered in Service Community resources. + + :param service_supported_region: The region which the service support. + e.g. For O365, region is Global. + :type service_supported_region: str + :param community_name: The name of the bgp community. e.g. Skype. + :type community_name: str + :param community_value: The value of the bgp community. For more + information: + https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + :type community_value: str + :param community_prefixes: The prefixes that the bgp community contains. + :type community_prefixes: list[str] + :param is_authorized_to_use: Customer is authorized to use bgp community + or not. + :type is_authorized_to_use: bool + :param service_group: The service group of the bgp community contains. + :type service_group: str + """ + + _attribute_map = { + 'service_supported_region': {'key': 'serviceSupportedRegion', 'type': 'str'}, + 'community_name': {'key': 'communityName', 'type': 'str'}, + 'community_value': {'key': 'communityValue', 'type': 'str'}, + 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, + 'is_authorized_to_use': {'key': 'isAuthorizedToUse', 'type': 'bool'}, + 'service_group': {'key': 'serviceGroup', 'type': 'str'}, + } + + def __init__(self, *, service_supported_region: str=None, community_name: str=None, community_value: str=None, community_prefixes=None, is_authorized_to_use: bool=None, service_group: str=None, **kwargs) -> None: + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = service_supported_region + self.community_name = community_name + self.community_value = community_value + self.community_prefixes = community_prefixes + self.is_authorized_to_use = is_authorized_to_use + self.service_group = service_group diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status.py index 52f0333d8c6f..f8f76069c160 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status.py @@ -59,8 +59,8 @@ class BgpPeerStatus(Model): 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, } - def __init__(self): - super(BgpPeerStatus, self).__init__() + def __init__(self, **kwargs): + super(BgpPeerStatus, self).__init__(**kwargs) self.local_address = None self.neighbor = None self.asn = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status_list_result.py index 05f737e85546..b1c7a2169a40 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status_list_result.py @@ -23,6 +23,6 @@ class BgpPeerStatusListResult(Model): 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, } - def __init__(self, value=None): - super(BgpPeerStatusListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status_list_result_py3.py new file mode 100644 index 000000000000..64d183df2955 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatusListResult(Model): + """Response for list BGP peer status API service call. + + :param value: List of BGP peers + :type value: list[~azure.mgmt.network.v2017_06_01.models.BgpPeerStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status_py3.py new file mode 100644 index 000000000000..823335042bdc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_peer_status_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatus(Model): + """BGP peer status details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The virtual network gateway's local address + :vartype local_address: str + :ivar neighbor: The remote BGP peer + :vartype neighbor: str + :ivar asn: The autonomous system number of the remote BGP peer + :vartype asn: int + :ivar state: The BGP peer state. Possible values include: 'Unknown', + 'Stopped', 'Idle', 'Connecting', 'Connected' + :vartype state: str or ~azure.mgmt.network.v2017_06_01.models.BgpPeerState + :ivar connected_duration: For how long the peering has been up + :vartype connected_duration: str + :ivar routes_received: The number of routes learned from this peer + :vartype routes_received: long + :ivar messages_sent: The number of BGP messages sent + :vartype messages_sent: long + :ivar messages_received: The number of BGP messages received + :vartype messages_received: long + """ + + _validation = { + 'local_address': {'readonly': True}, + 'neighbor': {'readonly': True}, + 'asn': {'readonly': True}, + 'state': {'readonly': True}, + 'connected_duration': {'readonly': True}, + 'routes_received': {'readonly': True}, + 'messages_sent': {'readonly': True}, + 'messages_received': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'str'}, + 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, + 'routes_received': {'key': 'routesReceived', 'type': 'long'}, + 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, + 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(BgpPeerStatus, self).__init__(**kwargs) + self.local_address = None + self.neighbor = None + self.asn = None + self.state = None + self.connected_duration = None + self.routes_received = None + self.messages_sent = None + self.messages_received = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_service_community.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_service_community.py index 24afc74aeca2..3d0642eda2fe 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_service_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_service_community.py @@ -50,7 +50,7 @@ class BgpServiceCommunity(Resource): 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, } - def __init__(self, id=None, location=None, tags=None, service_name=None, bgp_communities=None): - super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags) - self.service_name = service_name - self.bgp_communities = bgp_communities + def __init__(self, **kwargs): + super(BgpServiceCommunity, self).__init__(**kwargs) + self.service_name = kwargs.get('service_name', None) + self.bgp_communities = kwargs.get('bgp_communities', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_service_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_service_community_py3.py new file mode 100644 index 000000000000..f80f3bf95524 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_service_community_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BgpServiceCommunity(Resource): + """Service Community Properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param service_name: The name of the bgp community. e.g. Skype. + :type service_name: str + :param bgp_communities: Get a list of bgp communities. + :type bgp_communities: + list[~azure.mgmt.network.v2017_06_01.models.BGPCommunity] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, + 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, service_name: str=None, bgp_communities=None, **kwargs) -> None: + super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.service_name = service_name + self.bgp_communities = bgp_communities diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_settings.py index c5730da2e43e..e6e8d1b90aa6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_settings.py @@ -31,8 +31,8 @@ class BgpSettings(Model): 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, } - def __init__(self, asn=None, bgp_peering_address=None, peer_weight=None): - super(BgpSettings, self).__init__() - self.asn = asn - self.bgp_peering_address = bgp_peering_address - self.peer_weight = peer_weight + def __init__(self, **kwargs): + super(BgpSettings, self).__init__(**kwargs) + self.asn = kwargs.get('asn', None) + self.bgp_peering_address = kwargs.get('bgp_peering_address', None) + self.peer_weight = kwargs.get('peer_weight', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_settings_py3.py new file mode 100644 index 000000000000..cb3b3e6795f7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/bgp_settings_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpSettings(Model): + """BGP settings details. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of + this BGP speaker. + :type bgp_peering_address: str + :param peer_weight: The weight added to routes learned from this BGP + speaker. + :type peer_weight: int + """ + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, + } + + def __init__(self, *, asn: int=None, bgp_peering_address: str=None, peer_weight: int=None, **kwargs) -> None: + super(BgpSettings, self).__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + self.peer_weight = peer_weight diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_reset_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_reset_shared_key.py index 3338112a7fe7..1ade077795ed 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_reset_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_reset_shared_key.py @@ -15,8 +15,10 @@ class ConnectionResetSharedKey(Model): """The virtual network connection reset shared key. - :param key_length: The virtual network connection reset shared key length, - should between 1 and 128. + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. :type key_length: int """ @@ -28,6 +30,6 @@ class ConnectionResetSharedKey(Model): 'key_length': {'key': 'keyLength', 'type': 'int'}, } - def __init__(self, key_length): - super(ConnectionResetSharedKey, self).__init__() - self.key_length = key_length + def __init__(self, **kwargs): + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = kwargs.get('key_length', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_reset_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_reset_shared_key_py3.py new file mode 100644 index 000000000000..47326d4c2082 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_reset_shared_key_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionResetSharedKey(Model): + """The virtual network connection reset shared key. + + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. + :type key_length: int + """ + + _validation = { + 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, + } + + _attribute_map = { + 'key_length': {'key': 'keyLength', 'type': 'int'}, + } + + def __init__(self, *, key_length: int, **kwargs) -> None: + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = key_length diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_shared_key.py index 2c1b0ed9a914..742f1cb15126 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_shared_key.py @@ -15,7 +15,9 @@ class ConnectionSharedKey(Model): """Response for GetConnectionSharedKey API service call. - :param value: The virtual network connection shared key value. + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. :type value: str """ @@ -27,6 +29,6 @@ class ConnectionSharedKey(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, value): - super(ConnectionSharedKey, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_shared_key_py3.py new file mode 100644 index 000000000000..11b88da35e17 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connection_shared_key_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionSharedKey(Model): + """Response for GetConnectionSharedKey API service call. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, **kwargs) -> None: + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_destination.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_destination.py index cd0e8818b591..964c425a29d3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_destination.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_destination.py @@ -31,8 +31,8 @@ class ConnectivityDestination(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id=None, address=None, port=None): - super(ConnectivityDestination, self).__init__() - self.resource_id = resource_id - self.address = address - self.port = port + def __init__(self, **kwargs): + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_destination_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_destination_py3.py new file mode 100644 index 000000000000..c51619081ed6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_destination_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityDestination(Model): + """Parameters that define destination of connection. + + :param resource_id: The ID of the resource to which a connection attempt + will be made. + :type resource_id: str + :param address: The IP address or URI the resource to which a connection + attempt will be made. + :type address: str + :param port: Port on which check connectivity will be performed. + :type port: int + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str=None, address: str=None, port: int=None, **kwargs) -> None: + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_hop.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_hop.py index 04510362b420..ae2b8c1dc847 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_hop.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_hop.py @@ -51,8 +51,8 @@ class ConnectivityHop(Model): 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, } - def __init__(self): - super(ConnectivityHop, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityHop, self).__init__(**kwargs) self.type = None self.id = None self.address = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_hop_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_hop_py3.py new file mode 100644 index 000000000000..2e569cee7bab --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_hop_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityHop(Model): + """Information about a hop between the source and the destination. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the hop. + :vartype type: str + :ivar id: The ID of the hop. + :vartype id: str + :ivar address: The IP address of the hop. + :vartype address: str + :ivar resource_id: The ID of the resource corresponding to this hop. + :vartype resource_id: str + :ivar next_hop_ids: List of next hop identifiers. + :vartype next_hop_ids: list[str] + :ivar issues: List of issues. + :vartype issues: + list[~azure.mgmt.network.v2017_06_01.models.ConnectivityIssue] + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'address': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'next_hop_ids': {'readonly': True}, + 'issues': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'next_hop_ids': {'key': 'nextHopIds', 'type': '[str]'}, + 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityHop, self).__init__(**kwargs) + self.type = None + self.id = None + self.address = None + self.resource_id = None + self.next_hop_ids = None + self.issues = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_information.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_information.py index cfe924e93bdf..93e29c7ac6d4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_information.py @@ -57,8 +57,8 @@ class ConnectivityInformation(Model): 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, } - def __init__(self): - super(ConnectivityInformation, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityInformation, self).__init__(**kwargs) self.hops = None self.connection_status = None self.avg_latency_in_ms = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_information_py3.py new file mode 100644 index 000000000000..2074ddcb41d7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_information_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityInformation(Model): + """Information on the connectivity status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar hops: List of hops between the source and the destination. + :vartype hops: + list[~azure.mgmt.network.v2017_06_01.models.ConnectivityHop] + :ivar connection_status: The connection status. Possible values include: + 'Unknown', 'Connected', 'Disconnected', 'Degraded' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_06_01.models.ConnectionStatus + :ivar avg_latency_in_ms: Average latency in milliseconds. + :vartype avg_latency_in_ms: int + :ivar min_latency_in_ms: Minimum latency in milliseconds. + :vartype min_latency_in_ms: int + :ivar max_latency_in_ms: Maximum latency in milliseconds. + :vartype max_latency_in_ms: int + :ivar probes_sent: Total number of probes sent. + :vartype probes_sent: int + :ivar probes_failed: Number of failed probes. + :vartype probes_failed: int + """ + + _validation = { + 'hops': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'avg_latency_in_ms': {'readonly': True}, + 'min_latency_in_ms': {'readonly': True}, + 'max_latency_in_ms': {'readonly': True}, + 'probes_sent': {'readonly': True}, + 'probes_failed': {'readonly': True}, + } + + _attribute_map = { + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, + 'probes_sent': {'key': 'probesSent', 'type': 'int'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityInformation, self).__init__(**kwargs) + self.hops = None + self.connection_status = None + self.avg_latency_in_ms = None + self.min_latency_in_ms = None + self.max_latency_in_ms = None + self.probes_sent = None + self.probes_failed = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_issue.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_issue.py index 588fbe4636e1..e7d8fc60bfe6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_issue.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_issue.py @@ -47,8 +47,8 @@ class ConnectivityIssue(Model): 'context': {'key': 'context', 'type': '[{str}]'}, } - def __init__(self): - super(ConnectivityIssue, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityIssue, self).__init__(**kwargs) self.origin = None self.severity = None self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_issue_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_issue_py3.py new file mode 100644 index 000000000000..61f943249899 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_issue_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityIssue(Model): + """Information about an issue encountered in the process of checking for + connectivity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar origin: The origin of the issue. Possible values include: 'Local', + 'Inbound', 'Outbound' + :vartype origin: str or ~azure.mgmt.network.v2017_06_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: + 'Error', 'Warning' + :vartype severity: str or ~azure.mgmt.network.v2017_06_01.models.Severity + :ivar type: The type of issue. Possible values include: 'Unknown', + 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', + 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform' + :vartype type: str or ~azure.mgmt.network.v2017_06_01.models.IssueType + :ivar context: Provides additional context on the issue. + :vartype context: list[dict[str, str]] + """ + + _validation = { + 'origin': {'readonly': True}, + 'severity': {'readonly': True}, + 'type': {'readonly': True}, + 'context': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'context': {'key': 'context', 'type': '[{str}]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityIssue, self).__init__(**kwargs) + self.origin = None + self.severity = None + self.type = None + self.context = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_parameters.py index 704e22a98cf9..8570b7fa9df2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_parameters.py @@ -15,9 +15,11 @@ class ConnectivityParameters(Model): """Parameters that determine how the connectivity check will be performed. - :param source: + All required parameters must be populated in order to send to Azure. + + :param source: Required. :type source: ~azure.mgmt.network.v2017_06_01.models.ConnectivitySource - :param destination: + :param destination: Required. :type destination: ~azure.mgmt.network.v2017_06_01.models.ConnectivityDestination """ @@ -32,7 +34,7 @@ class ConnectivityParameters(Model): 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, } - def __init__(self, source, destination): - super(ConnectivityParameters, self).__init__() - self.source = source - self.destination = destination + def __init__(self, **kwargs): + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_parameters_py3.py new file mode 100644 index 000000000000..487e9efd51ce --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_parameters_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityParameters(Model): + """Parameters that determine how the connectivity check will be performed. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. + :type source: ~azure.mgmt.network.v2017_06_01.models.ConnectivitySource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2017_06_01.models.ConnectivityDestination + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectivitySource'}, + 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, + } + + def __init__(self, *, source, destination, **kwargs) -> None: + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = source + self.destination = destination diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_source.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_source.py index c42bfc0aa09d..3fd82793f8d7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_source.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_source.py @@ -15,8 +15,10 @@ class ConnectivitySource(Model): """Parameters that define the source of the connection. - :param resource_id: The ID of the resource from which a connectivity check - will be initiated. + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. :type resource_id: str :param port: The source port from which a connectivity check will be performed. @@ -32,7 +34,7 @@ class ConnectivitySource(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id, port=None): - super(ConnectivitySource, self).__init__() - self.resource_id = resource_id - self.port = port + def __init__(self, **kwargs): + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_source_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_source_py3.py new file mode 100644 index 000000000000..f7833d1bef76 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_source_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivitySource(Model): + """Parameters that define the source of the connection. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. + :type resource_id: str + :param port: The source port from which a connectivity check will be + performed. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str, port: int=None, **kwargs) -> None: + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = resource_id + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dhcp_options.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dhcp_options.py index 8744ba6fc9b1..93b68a7f037c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dhcp_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dhcp_options.py @@ -25,6 +25,6 @@ class DhcpOptions(Model): 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, } - def __init__(self, dns_servers=None): - super(DhcpOptions, self).__init__() - self.dns_servers = dns_servers + def __init__(self, **kwargs): + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dhcp_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dhcp_options_py3.py new file mode 100644 index 000000000000..7dc4651973a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dhcp_options_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DhcpOptions(Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in + the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + options. + + :param dns_servers: The list of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = dns_servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dns_name_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dns_name_availability_result.py index 15a0238e49a7..86ba19eb407b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dns_name_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dns_name_availability_result.py @@ -23,6 +23,6 @@ class DnsNameAvailabilityResult(Model): 'available': {'key': 'available', 'type': 'bool'}, } - def __init__(self, available=None): - super(DnsNameAvailabilityResult, self).__init__() - self.available = available + def __init__(self, **kwargs): + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dns_name_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dns_name_availability_result_py3.py new file mode 100644 index 000000000000..de0117c27715 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/dns_name_availability_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DnsNameAvailabilityResult(Model): + """Response for the CheckDnsNameAvailability API service call. + + :param available: Domain availability (True/False). + :type available: bool + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + } + + def __init__(self, *, available: bool=None, **kwargs) -> None: + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = available diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group.py index 9a4377adefba..0bffa82ed8ae 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group.py @@ -37,9 +37,9 @@ class EffectiveNetworkSecurityGroup(Model): 'tag_map': {'key': 'tagMap', 'type': '{[str]}'}, } - def __init__(self, network_security_group=None, association=None, effective_security_rules=None, tag_map=None): - super(EffectiveNetworkSecurityGroup, self).__init__() - self.network_security_group = network_security_group - self.association = association - self.effective_security_rules = effective_security_rules - self.tag_map = tag_map + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = kwargs.get('network_security_group', None) + self.association = kwargs.get('association', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) + self.tag_map = kwargs.get('tag_map', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_association.py index 8beaa4816477..3a1b827ce699 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_association.py @@ -27,7 +27,7 @@ class EffectiveNetworkSecurityGroupAssociation(Model): 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, } - def __init__(self, subnet=None, network_interface=None): - super(EffectiveNetworkSecurityGroupAssociation, self).__init__() - self.subnet = subnet - self.network_interface = network_interface + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.network_interface = kwargs.get('network_interface', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_association_py3.py new file mode 100644 index 000000000000..c7b678502c7c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_association_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupAssociation(Model): + """The effective network security group association. + + :param subnet: The ID of the subnet if assigned. + :type subnet: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: + ~azure.mgmt.network.v2017_06_01.models.SubResource + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, + } + + def __init__(self, *, subnet=None, network_interface=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = subnet + self.network_interface = network_interface diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_list_result.py index 0880178b82c7..3e30c361c08c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_list_result.py @@ -34,7 +34,7 @@ class EffectiveNetworkSecurityGroupListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None): - super(EffectiveNetworkSecurityGroupListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_list_result_py3.py new file mode 100644 index 000000000000..9771d412d511 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_list_result_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupListResult(Model): + """Response for list effective network security groups API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective network security groups. + :type value: + list[~azure.mgmt.network.v2017_06_01.models.EffectiveNetworkSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_py3.py new file mode 100644 index 000000000000..c716f118c727 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_group_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroup(Model): + """Effective network security group. + + :param network_security_group: The ID of network security group that is + applied. + :type network_security_group: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param association: Associated resources. + :type association: + ~azure.mgmt.network.v2017_06_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2017_06_01.models.EffectiveNetworkSecurityRule] + :param tag_map: Mapping of tags to list of IP Addresses included within + the tag. + :type tag_map: dict[str, list[str]] + """ + + _attribute_map = { + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, + 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + 'tag_map': {'key': 'tagMap', 'type': '{[str]}'}, + } + + def __init__(self, *, network_security_group=None, association=None, effective_security_rules=None, tag_map=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = network_security_group + self.association = association + self.effective_security_rules = effective_security_rules + self.tag_map = tag_map diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_rule.py index 8982b9d66c6b..95751d076a07 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_rule.py @@ -82,20 +82,20 @@ class EffectiveNetworkSecurityRule(Model): 'direction': {'key': 'direction', 'type': 'str'}, } - def __init__(self, name=None, protocol=None, source_port_range=None, destination_port_range=None, source_port_ranges=None, destination_port_ranges=None, source_address_prefix=None, destination_address_prefix=None, source_address_prefixes=None, destination_address_prefixes=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority=None, direction=None): - super(EffectiveNetworkSecurityRule, self).__init__() - self.name = name - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_port_ranges = source_port_ranges - self.destination_port_ranges = destination_port_ranges - self.source_address_prefix = source_address_prefix - self.destination_address_prefix = destination_address_prefix - self.source_address_prefixes = source_address_prefixes - self.destination_address_prefixes = destination_address_prefixes - self.expanded_source_address_prefix = expanded_source_address_prefix - self.expanded_destination_address_prefix = expanded_destination_address_prefix - self.access = access - self.priority = priority - self.direction = direction + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.expanded_source_address_prefix = kwargs.get('expanded_source_address_prefix', None) + self.expanded_destination_address_prefix = kwargs.get('expanded_destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_rule_py3.py new file mode 100644 index 000000000000..a1b6efc8be7a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_network_security_rule_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityRule(Model): + """Effective network security rules. + + :param name: The name of the security rule specified by the user (if + created by the user). + :type name: str + :param protocol: The network protocol this rule applies to. Possible + values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', + 'Udp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_06_01.models.EffectiveSecurityRuleProtocol + :param source_port_range: The source port or range. + :type source_port_range: str + :param destination_port_range: The destination port or range. + :type destination_port_range: str + :param source_port_ranges: The source port ranges. Expected values include + a single integer between 0 and 65535, a range using '-' as seperator (e.g. + 100-400), or an asterix (*) + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. Expected + values include a single integer between 0 and 65535, a range using '-' as + seperator (e.g. 100-400), or an asterix (*) + :type destination_port_ranges: list[str] + :param source_address_prefix: The source address prefix. + :type source_address_prefix: str + :param destination_address_prefix: The destination address prefix. + :type destination_address_prefix: str + :param source_address_prefixes: The source address prefixes. Expected + values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type source_address_prefixes: list[str] + :param destination_address_prefixes: The destination address prefixes. + Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type destination_address_prefixes: list[str] + :param expanded_source_address_prefix: The expanded source address prefix. + :type expanded_source_address_prefix: list[str] + :param expanded_destination_address_prefix: Expanded destination address + prefix. + :type expanded_destination_address_prefix: list[str] + :param access: Whether network traffic is allowed or denied. Possible + values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or + ~azure.mgmt.network.v2017_06_01.models.SecurityRuleAccess + :param priority: The priority of the rule. + :type priority: int + :param direction: The direction of the rule. Possible values are: 'Inbound + and Outbound'. Possible values include: 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2017_06_01.models.SecurityRuleDirection + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'source_port_ranges': {'key': 'sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'destinationPortRanges', 'type': '[str]'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'sourceAddressPrefixes', 'type': '[str]'}, + 'destination_address_prefixes': {'key': 'destinationAddressPrefixes', 'type': '[str]'}, + 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, + 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, + 'access': {'key': 'access', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, protocol=None, source_port_range: str=None, destination_port_range: str=None, source_port_ranges=None, destination_port_ranges=None, source_address_prefix: str=None, destination_address_prefix: str=None, source_address_prefixes=None, destination_address_prefixes=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority: int=None, direction=None, **kwargs) -> None: + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = name + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.source_address_prefixes = source_address_prefixes + self.destination_address_prefixes = destination_address_prefixes + self.expanded_source_address_prefix = expanded_source_address_prefix + self.expanded_destination_address_prefix = expanded_destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route.py index 9662b5519d09..41d6f8674156 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route.py @@ -50,11 +50,11 @@ class EffectiveRoute(Model): 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, } - def __init__(self, name=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None): - super(EffectiveRoute, self).__init__() - self.name = name - self.source = source - self.state = state - self.address_prefix = address_prefix - self.next_hop_ip_address = next_hop_ip_address - self.next_hop_type = next_hop_type + def __init__(self, **kwargs): + super(EffectiveRoute, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.next_hop_type = kwargs.get('next_hop_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route_list_result.py index 80f3ac41f5f1..efe6a6d7349c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route_list_result.py @@ -33,7 +33,7 @@ class EffectiveRouteListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None): - super(EffectiveRouteListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route_list_result_py3.py new file mode 100644 index 000000000000..a73c39b20417 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route_list_result_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRouteListResult(Model): + """Response for list effective route API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective routes. + :type value: list[~azure.mgmt.network.v2017_06_01.models.EffectiveRoute] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route_py3.py new file mode 100644 index 000000000000..600cac7161d7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/effective_route_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRoute(Model): + """Effective Route. + + :param name: The name of the user defined route. This is optional. + :type name: str + :param source: Who created the route. Possible values are: 'Unknown', + 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: + 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' + :type source: str or + ~azure.mgmt.network.v2017_06_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values are: 'Active' + and 'Invalid'. Possible values include: 'Active', 'Invalid' + :type state: str or + ~azure.mgmt.network.v2017_06_01.models.EffectiveRouteState + :param address_prefix: The address prefixes of the effective routes in + CIDR notation. + :type address_prefix: list[str] + :param next_hop_ip_address: The IP address of the next hop of the + effective route. + :type next_hop_ip_address: list[str] + :param next_hop_type: The type of Azure hop the packet should be sent to. + Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_06_01.models.RouteNextHopType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None, **kwargs) -> None: + super(EffectiveRoute, self).__init__(**kwargs) + self.name = name + self.source = source + self.state = state + self.address_prefix = address_prefix + self.next_hop_ip_address = next_hop_ip_address + self.next_hop_type = next_hop_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/endpoint_service_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/endpoint_service_result.py index 9098a41ff164..9ca0e203a834 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/endpoint_service_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/endpoint_service_result.py @@ -37,7 +37,7 @@ class EndpointServiceResult(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None): - super(EndpointServiceResult, self).__init__(id=id) + def __init__(self, **kwargs): + super(EndpointServiceResult, self).__init__(**kwargs) self.name = None self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/endpoint_service_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/endpoint_service_result_py3.py new file mode 100644 index 000000000000..c45df94a6533 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/endpoint_service_result_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class EndpointServiceResult(SubResource): + """Endpoint service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Name of the endpoint service. + :vartype name: str + :ivar type: Type of the endpoint service. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(EndpointServiceResult, self).__init__(id=id, **kwargs) + self.name = None + self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error.py index c563e256c112..bc0cd1bf7693 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error.py @@ -35,10 +35,10 @@ class Error(Model): 'inner_error': {'key': 'innerError', 'type': 'str'}, } - def __init__(self, code=None, message=None, target=None, details=None, inner_error=None): - super(Error, self).__init__() - self.code = code - self.message = message - self.target = target - self.details = details - self.inner_error = inner_error + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error_details.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error_details.py index 40bea00aa2fb..a8c4da6ba955 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error_details.py @@ -29,8 +29,8 @@ class ErrorDetails(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ErrorDetails, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error_details_py3.py new file mode 100644 index 000000000000..d791f0895345 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error_details_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """ErrorDetails. + + :param code: + :type code: str + :param target: + :type target: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error_py3.py new file mode 100644 index 000000000000..1441b6820c4c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(Model): + """Error. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.network.v2017_06_01.models.ErrorDetails] + :param inner_error: + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, inner_error: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit.py index d9845da048d0..d2d6117c0538 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit.py @@ -91,17 +91,17 @@ class ExpressRouteCircuit(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, allow_classic_operations=None, circuit_provisioning_state=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key=None, service_provider_notes=None, service_provider_properties=None, provisioning_state=None, gateway_manager_etag=None): - super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.allow_classic_operations = allow_classic_operations - self.circuit_provisioning_state = circuit_provisioning_state - self.service_provider_provisioning_state = service_provider_provisioning_state - self.authorizations = authorizations - self.peerings = peerings - self.service_key = service_key - self.service_provider_notes = service_provider_notes - self.service_provider_properties = service_provider_properties - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag + def __init__(self, **kwargs): + super(ExpressRouteCircuit, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.allow_classic_operations = kwargs.get('allow_classic_operations', None) + self.circuit_provisioning_state = kwargs.get('circuit_provisioning_state', None) + self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) + self.authorizations = kwargs.get('authorizations', None) + self.peerings = kwargs.get('peerings', None) + self.service_key = kwargs.get('service_key', None) + self.service_provider_notes = kwargs.get('service_provider_notes', None) + self.service_provider_properties = kwargs.get('service_provider_properties', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_arp_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_arp_table.py index ace325747ee5..826796619769 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_arp_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_arp_table.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitArpTable(Model): 'mac_address': {'key': 'macAddress', 'type': 'str'}, } - def __init__(self, age=None, interface=None, ip_address=None, mac_address=None): - super(ExpressRouteCircuitArpTable, self).__init__() - self.age = age - self.interface = interface - self.ip_address = ip_address - self.mac_address = mac_address + def __init__(self, **kwargs): + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = kwargs.get('age', None) + self.interface = kwargs.get('interface', None) + self.ip_address = kwargs.get('ip_address', None) + self.mac_address = kwargs.get('mac_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_arp_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_arp_table_py3.py new file mode 100644 index 000000000000..4401108c6001 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_arp_table_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitArpTable(Model): + """The ARP table associated with the ExpressRouteCircuit. + + :param age: Age + :type age: int + :param interface: Interface + :type interface: str + :param ip_address: The IP address. + :type ip_address: str + :param mac_address: The MAC address. + :type mac_address: str + """ + + _attribute_map = { + 'age': {'key': 'age', 'type': 'int'}, + 'interface': {'key': 'interface', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, *, age: int=None, interface: str=None, ip_address: str=None, mac_address: str=None, **kwargs) -> None: + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = age + self.interface = interface + self.ip_address = ip_address + self.mac_address = mac_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_authorization.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_authorization.py index b73148807629..dfbeeefb0407 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_authorization.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_authorization.py @@ -51,10 +51,10 @@ class ExpressRouteCircuitAuthorization(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, authorization_key=None, authorization_use_status=None, provisioning_state=None, name=None): - super(ExpressRouteCircuitAuthorization, self).__init__(id=id) - self.authorization_key = authorization_key - self.authorization_use_status = authorization_use_status - self.provisioning_state = provisioning_state - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitAuthorization, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.authorization_use_status = kwargs.get('authorization_use_status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_authorization_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_authorization_py3.py new file mode 100644 index 000000000000..9398ada51a3e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_authorization_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param authorization_use_status: AuthorizationUseStatus. Possible values + are: 'Available' and 'InUse'. Possible values include: 'Available', + 'InUse' + :type authorization_use_status: str or + ~azure.mgmt.network.v2017_06_01.models.AuthorizationUseStatus + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, authorization_key: str=None, authorization_use_status=None, provisioning_state: str=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitAuthorization, self).__init__(id=id, **kwargs) + self.authorization_key = authorization_key + self.authorization_use_status = authorization_use_status + self.provisioning_state = provisioning_state + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering.py index 8b291f0ceda1..f161bdefa790 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering.py @@ -100,24 +100,24 @@ class ExpressRouteCircuitPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, peering_type=None, state=None, azure_asn=None, peer_asn=None, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, primary_azure_port=None, secondary_azure_port=None, shared_key=None, vlan_id=None, microsoft_peering_config=None, stats=None, provisioning_state=None, gateway_manager_etag=None, last_modified_by=None, route_filter=None, ipv6_peering_config=None, name=None): - super(ExpressRouteCircuitPeering, self).__init__(id=id) - self.peering_type = peering_type - self.state = state - self.azure_asn = azure_asn - self.peer_asn = peer_asn - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.primary_azure_port = primary_azure_port - self.secondary_azure_port = secondary_azure_port - self.shared_key = shared_key - self.vlan_id = vlan_id - self.microsoft_peering_config = microsoft_peering_config - self.stats = stats - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag - self.last_modified_by = last_modified_by - self.route_filter = route_filter - self.ipv6_peering_config = ipv6_peering_config - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeering, self).__init__(**kwargs) + self.peering_type = kwargs.get('peering_type', None) + self.state = kwargs.get('state', None) + self.azure_asn = kwargs.get('azure_asn', None) + self.peer_asn = kwargs.get('peer_asn', None) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.primary_azure_port = kwargs.get('primary_azure_port', None) + self.secondary_azure_port = kwargs.get('secondary_azure_port', None) + self.shared_key = kwargs.get('shared_key', None) + self.vlan_id = kwargs.get('vlan_id', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.stats = kwargs.get('stats', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.route_filter = kwargs.get('route_filter', None) + self.ipv6_peering_config = kwargs.get('ipv6_peering_config', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering_config.py index ca797c1c8b5a..27afb5ce6d1e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering_config.py @@ -45,11 +45,11 @@ class ExpressRouteCircuitPeeringConfig(Model): 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, } - def __init__(self, advertised_public_prefixes=None, advertised_communities=None, advertised_public_prefixes_state=None, legacy_mode=None, customer_asn=None, routing_registry_name=None): - super(ExpressRouteCircuitPeeringConfig, self).__init__() - self.advertised_public_prefixes = advertised_public_prefixes - self.advertised_communities = advertised_communities - self.advertised_public_prefixes_state = advertised_public_prefixes_state - self.legacy_mode = legacy_mode - self.customer_asn = customer_asn - self.routing_registry_name = routing_registry_name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = kwargs.get('advertised_public_prefixes', None) + self.advertised_communities = kwargs.get('advertised_communities', None) + self.advertised_public_prefixes_state = kwargs.get('advertised_public_prefixes_state', None) + self.legacy_mode = kwargs.get('legacy_mode', None) + self.customer_asn = kwargs.get('customer_asn', None) + self.routing_registry_name = kwargs.get('routing_registry_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..b1ffd9ef70aa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering_config_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitPeeringConfig(Model): + """Specifies the peering configuration. + + :param advertised_public_prefixes: The reference of + AdvertisedPublicPrefixes. + :type advertised_public_prefixes: list[str] + :param advertised_communities: The communities of bgp peering. Spepcified + for microsoft peering + :type advertised_communities: list[str] + :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of + the Peering resource. Possible values are 'NotConfigured', 'Configuring', + 'Configured', and 'ValidationNeeded'. Possible values include: + 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' + :type advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :param legacy_mode: The legacy mode of the peering. + :type legacy_mode: int + :param customer_asn: The CustomerASN of the peering. + :type customer_asn: int + :param routing_registry_name: The RoutingRegistryName of the + configuration. + :type routing_registry_name: str + """ + + _attribute_map = { + 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, + 'advertised_communities': {'key': 'advertisedCommunities', 'type': '[str]'}, + 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, + 'legacy_mode': {'key': 'legacyMode', 'type': 'int'}, + 'customer_asn': {'key': 'customerASN', 'type': 'int'}, + 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, + } + + def __init__(self, *, advertised_public_prefixes=None, advertised_communities=None, advertised_public_prefixes_state=None, legacy_mode: int=None, customer_asn: int=None, routing_registry_name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = advertised_public_prefixes + self.advertised_communities = advertised_communities + self.advertised_public_prefixes_state = advertised_public_prefixes_state + self.legacy_mode = legacy_mode + self.customer_asn = customer_asn + self.routing_registry_name = routing_registry_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering_py3.py new file mode 100644 index 000000000000..886889976c97 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_peering_py3.py @@ -0,0 +1,123 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitPeering(SubResource): + """Peering in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param peering_type: The PeeringType. Possible values are: + 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. + Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + 'MicrosoftPeering' + :type peering_type: str or + ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeeringType + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeeringState + :param azure_asn: The Azure ASN. + :type azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: int + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param primary_azure_port: The primary port. + :type primary_azure_port: str + :param secondary_azure_port: The secondary port. + :type secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeeringConfig + :param stats: Gets peering stats. + :type stats: + ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitStats + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :param last_modified_by: Gets whether the provider or the customer last + modified the peering. + :type last_modified_by: str + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2017_06_01.models.RouteFilter + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2017_06_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'int'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'route_filter': {'key': 'properties.routeFilter', 'type': 'RouteFilter'}, + 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, peering_type=None, state=None, azure_asn: int=None, peer_asn: int=None, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, primary_azure_port: str=None, secondary_azure_port: str=None, shared_key: str=None, vlan_id: int=None, microsoft_peering_config=None, stats=None, provisioning_state: str=None, gateway_manager_etag: str=None, last_modified_by: str=None, route_filter=None, ipv6_peering_config=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeering, self).__init__(id=id, **kwargs) + self.peering_type = peering_type + self.state = state + self.azure_asn = azure_asn + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = primary_azure_port + self.secondary_azure_port = secondary_azure_port + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.stats = stats + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.last_modified_by = last_modified_by + self.route_filter = route_filter + self.ipv6_peering_config = ipv6_peering_config + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_py3.py new file mode 100644 index 000000000000..cc8a0cea9a27 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteCircuit(Resource): + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The SKU. + :type sku: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitSku + :param allow_classic_operations: Allow classic operations + :type allow_classic_operations: bool + :param circuit_provisioning_state: The CircuitProvisioningState state of + the resource. + :type circuit_provisioning_state: str + :param service_provider_provisioning_state: The + ServiceProviderProvisioningState state of the resource. Possible values + are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + 'Deprovisioning' + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2017_06_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: + list[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeering] + :param service_key: The ServiceKey. + :type service_key: str + :param service_provider_notes: The ServiceProviderNotes. + :type service_provider_notes: str + :param service_provider_properties: The ServiceProviderProperties. + :type service_provider_properties: + ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitServiceProviderProperties + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, + 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, + 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, allow_classic_operations: bool=None, circuit_provisioning_state: str=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key: str=None, service_provider_notes: str=None, service_provider_properties=None, provisioning_state: str=None, gateway_manager_etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.allow_classic_operations = allow_classic_operations + self.circuit_provisioning_state = circuit_provisioning_state + self.service_provider_provisioning_state = service_provider_provisioning_state + self.authorizations = authorizations + self.peerings = peerings + self.service_key = service_key + self.service_provider_notes = service_provider_notes + self.service_provider_properties = service_provider_properties + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table.py index 804d29a2f9bb..7517e9867cfb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table.py @@ -35,10 +35,10 @@ class ExpressRouteCircuitRoutesTable(Model): 'path': {'key': 'path', 'type': 'str'}, } - def __init__(self, network=None, next_hop=None, loc_prf=None, weight=None, path=None): - super(ExpressRouteCircuitRoutesTable, self).__init__() - self.network = network - self.next_hop = next_hop - self.loc_prf = loc_prf - self.weight = weight - self.path = path + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = kwargs.get('network', None) + self.next_hop = kwargs.get('next_hop', None) + self.loc_prf = kwargs.get('loc_prf', None) + self.weight = kwargs.get('weight', None) + self.path = kwargs.get('path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table_py3.py new file mode 100644 index 000000000000..38ea85cf642d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTable(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param network: network + :type network: str + :param next_hop: nextHop + :type next_hop: str + :param loc_prf: locPrf + :type loc_prf: str + :param weight: weight. + :type weight: int + :param path: path + :type path: str + """ + + _attribute_map = { + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'loc_prf': {'key': 'locPrf', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, *, network: str=None, next_hop: str=None, loc_prf: str=None, weight: int=None, path: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = network + self.next_hop = next_hop + self.loc_prf = loc_prf + self.weight = weight + self.path = path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table_summary.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table_summary.py index 6f5f89764dd4..577c3c2edd45 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table_summary.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table_summary.py @@ -37,10 +37,10 @@ class ExpressRouteCircuitRoutesTableSummary(Model): 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, } - def __init__(self, neighbor=None, v=None, as_property=None, up_down=None, state_pfx_rcd=None): - super(ExpressRouteCircuitRoutesTableSummary, self).__init__() - self.neighbor = neighbor - self.v = v - self.as_property = as_property - self.up_down = up_down - self.state_pfx_rcd = state_pfx_rcd + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = kwargs.get('neighbor', None) + self.v = kwargs.get('v', None) + self.as_property = kwargs.get('as_property', None) + self.up_down = kwargs.get('up_down', None) + self.state_pfx_rcd = kwargs.get('state_pfx_rcd', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table_summary_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table_summary_py3.py new file mode 100644 index 000000000000..e18d0051d218 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_routes_table_summary_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTableSummary(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: Neighbor + :type neighbor: str + :param v: BGP version number spoken to the neighbor. + :type v: int + :param as_property: Autonomous system number. + :type as_property: int + :param up_down: The length of time that the BGP session has been in the + Established state, or the current status if not in the Established state. + :type up_down: str + :param state_pfx_rcd: Current state of the BGP session, and the number of + prefixes that have been received from a neighbor or peer group. + :type state_pfx_rcd: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'v': {'key': 'v', 'type': 'int'}, + 'as_property': {'key': 'as', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, + } + + def __init__(self, *, neighbor: str=None, v: int=None, as_property: int=None, up_down: str=None, state_pfx_rcd: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = neighbor + self.v = v + self.as_property = as_property + self.up_down = up_down + self.state_pfx_rcd = state_pfx_rcd diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_service_provider_properties.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_service_provider_properties.py index 7a6b4ba96061..c51e6d8d653b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_service_provider_properties.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_service_provider_properties.py @@ -29,8 +29,8 @@ class ExpressRouteCircuitServiceProviderProperties(Model): 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, } - def __init__(self, service_provider_name=None, peering_location=None, bandwidth_in_mbps=None): - super(ExpressRouteCircuitServiceProviderProperties, self).__init__() - self.service_provider_name = service_provider_name - self.peering_location = peering_location - self.bandwidth_in_mbps = bandwidth_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = kwargs.get('service_provider_name', None) + self.peering_location = kwargs.get('peering_location', None) + self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_service_provider_properties_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_service_provider_properties_py3.py new file mode 100644 index 000000000000..ea701a54c3fe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_service_provider_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitServiceProviderProperties(Model): + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :param service_provider_name: The serviceProviderName. + :type service_provider_name: str + :param peering_location: The peering location. + :type peering_location: str + :param bandwidth_in_mbps: The BandwidthInMbps. + :type bandwidth_in_mbps: int + """ + + _attribute_map = { + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + } + + def __init__(self, *, service_provider_name: str=None, peering_location: str=None, bandwidth_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = service_provider_name + self.peering_location = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_sku.py index 2ce54f762a35..49ef94f327a0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_sku.py @@ -33,8 +33,8 @@ class ExpressRouteCircuitSku(Model): 'family': {'key': 'family', 'type': 'str'}, } - def __init__(self, name=None, tier=None, family=None): - super(ExpressRouteCircuitSku, self).__init__() - self.name = name - self.tier = tier - self.family = family + def __init__(self, **kwargs): + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.family = kwargs.get('family', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_sku_py3.py new file mode 100644 index 000000000000..b6787dd1ca17 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_sku_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitSku(Model): + """Contains SKU in an ExpressRouteCircuit. + + :param name: The name of the SKU. + :type name: str + :param tier: The tier of the SKU. Possible values are 'Standard' and + 'Premium'. Possible values include: 'Standard', 'Premium', 'Transport' + :type tier: str or + ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values are: 'UnlimitedData' + and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' + :type family: str or + ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, tier=None, family=None, **kwargs) -> None: + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.family = family diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_stats.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_stats.py index e26f6f7d2f74..41c45ae2b19a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_stats.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_stats.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitStats(Model): 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, } - def __init__(self, primarybytes_in=None, primarybytes_out=None, secondarybytes_in=None, secondarybytes_out=None): - super(ExpressRouteCircuitStats, self).__init__() - self.primarybytes_in = primarybytes_in - self.primarybytes_out = primarybytes_out - self.secondarybytes_in = secondarybytes_in - self.secondarybytes_out = secondarybytes_out + def __init__(self, **kwargs): + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = kwargs.get('primarybytes_in', None) + self.primarybytes_out = kwargs.get('primarybytes_out', None) + self.secondarybytes_in = kwargs.get('secondarybytes_in', None) + self.secondarybytes_out = kwargs.get('secondarybytes_out', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_stats_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_stats_py3.py new file mode 100644 index 000000000000..f78335343544 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuit_stats_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitStats(Model): + """Contains stats associated with the peering. + + :param primarybytes_in: Gets BytesIn of the peering. + :type primarybytes_in: long + :param primarybytes_out: Gets BytesOut of the peering. + :type primarybytes_out: long + :param secondarybytes_in: Gets BytesIn of the peering. + :type secondarybytes_in: long + :param secondarybytes_out: Gets BytesOut of the peering. + :type secondarybytes_out: long + """ + + _attribute_map = { + 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, + 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, + 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, + 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, + } + + def __init__(self, *, primarybytes_in: int=None, primarybytes_out: int=None, secondarybytes_in: int=None, secondarybytes_out: int=None, **kwargs) -> None: + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = primarybytes_in + self.primarybytes_out = primarybytes_out + self.secondarybytes_in = secondarybytes_in + self.secondarybytes_out = secondarybytes_out diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_arp_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_arp_table_list_result.py index b071f1eadb5e..2ed81cf1cfe2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_arp_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_arp_table_list_result.py @@ -27,7 +27,7 @@ class ExpressRouteCircuitsArpTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsArpTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_arp_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_arp_table_list_result_py3.py new file mode 100644 index 000000000000..c169e20b44ca --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_arp_table_list_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsArpTableListResult(Model): + """Response for ListArpTable associated with the Express Route Circuits API. + + :param value: Gets list of the ARP table. + :type value: + list[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitArpTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_list_result.py index 008a841c6a24..97809d5c33b8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_list_result_py3.py new file mode 100644 index 000000000000..e84752209208 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: The list of routes table. + :type value: + list[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitRoutesTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_summary_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_summary_list_result.py index c28535c7332e..2f4afaddf03b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_summary_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_summary_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_summary_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_summary_list_result_py3.py new file mode 100644 index 000000000000..373dfe8842ea --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_circuits_routes_table_summary_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: A list of the routes table. + :type value: + list[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitRoutesTableSummary] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider.py index 8fa491136eb1..898094aa8c58 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider.py @@ -53,8 +53,8 @@ class ExpressRouteServiceProvider(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state=None): - super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags) - self.peering_locations = peering_locations - self.bandwidths_offered = bandwidths_offered - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ExpressRouteServiceProvider, self).__init__(**kwargs) + self.peering_locations = kwargs.get('peering_locations', None) + self.bandwidths_offered = kwargs.get('bandwidths_offered', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider_bandwidths_offered.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider_bandwidths_offered.py index 9cbba2fcfe97..b27622af42d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider_bandwidths_offered.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider_bandwidths_offered.py @@ -26,7 +26,7 @@ class ExpressRouteServiceProviderBandwidthsOffered(Model): 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, } - def __init__(self, offer_name=None, value_in_mbps=None): - super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__() - self.offer_name = offer_name - self.value_in_mbps = value_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = kwargs.get('offer_name', None) + self.value_in_mbps = kwargs.get('value_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider_bandwidths_offered_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider_bandwidths_offered_py3.py new file mode 100644 index 000000000000..88516a0dfcf8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider_bandwidths_offered_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteServiceProviderBandwidthsOffered(Model): + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :param offer_name: The OfferName. + :type offer_name: str + :param value_in_mbps: The ValueInMbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__(self, *, offer_name: str=None, value_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = offer_name + self.value_in_mbps = value_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider_py3.py new file mode 100644 index 000000000000..a9539554ab47 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/express_route_service_provider_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param peering_locations: Get a list of peering locations. + :type peering_locations: list[str] + :param bandwidths_offered: Gets bandwidths offered. + :type bandwidths_offered: + list[~azure.mgmt.network.v2017_06_01.models.ExpressRouteServiceProviderBandwidthsOffered] + :param provisioning_state: Gets the provisioning state of the resource. + :type provisioning_state: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, + 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state: str=None, **kwargs) -> None: + super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.peering_locations = peering_locations + self.bandwidths_offered = bandwidths_offered + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_information.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_information.py index 8add31610fea..21b8166ca7c8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_information.py @@ -15,13 +15,15 @@ class FlowLogInformation(Model): """Information on the configuration of flow log. - :param target_resource_id: The ID of the resource to configure for flow - logging. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. :type target_resource_id: str - :param storage_id: ID of the storage account which is used to store the - flow log. + :param storage_id: Required. ID of the storage account which is used to + store the flow log. :type storage_id: str - :param enabled: Flag to enable/disable flow logging. + :param enabled: Required. Flag to enable/disable flow logging. :type enabled: bool :param retention_policy: :type retention_policy: @@ -41,9 +43,9 @@ class FlowLogInformation(Model): 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, } - def __init__(self, target_resource_id, storage_id, enabled, retention_policy=None): - super(FlowLogInformation, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.enabled = enabled - self.retention_policy = retention_policy + def __init__(self, **kwargs): + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.enabled = kwargs.get('enabled', None) + self.retention_policy = kwargs.get('retention_policy', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_information_py3.py new file mode 100644 index 000000000000..0e390d79b31d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_information_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogInformation(Model): + """Information on the configuration of flow log. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. + :type target_resource_id: str + :param storage_id: Required. ID of the storage account which is used to + store the flow log. + :type storage_id: str + :param enabled: Required. Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: + :type retention_policy: + ~azure.mgmt.network.v2017_06_01.models.RetentionPolicyParameters + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, enabled: bool, retention_policy=None, **kwargs) -> None: + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.enabled = enabled + self.retention_policy = retention_policy diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_status_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_status_parameters.py index 4cd22222bb45..5a48e938f2d6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_status_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_status_parameters.py @@ -15,8 +15,10 @@ class FlowLogStatusParameters(Model): """Parameters that define a resource to query flow log status. - :param target_resource_id: The target resource where getting the flow - logging status. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class FlowLogStatusParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(FlowLogStatusParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_status_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_status_parameters_py3.py new file mode 100644 index 000000000000..0768d2495150 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/flow_log_status_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogStatusParameters(Model): + """Parameters that define a resource to query flow log status. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/frontend_ip_configuration.py index abb0fd3869db..ebfb2122a74f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/frontend_ip_configuration.py @@ -85,17 +85,17 @@ class FrontendIPConfiguration(SubResource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None, zones=None): - super(FrontendIPConfiguration, self).__init__(id=id) + def __init__(self, **kwargs): + super(FrontendIPConfiguration, self).__init__(**kwargs) self.inbound_nat_rules = None self.inbound_nat_pools = None self.outbound_nat_rules = None self.load_balancing_rules = None - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.zones = zones + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..15c5146b7a3f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/frontend_ip_configuration_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class FrontendIPConfiguration(SubResource): + """Frontend IP address of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar inbound_nat_rules: Read only. Inbound rules URIs that use this + frontend IP. + :vartype inbound_nat_rules: + list[~azure.mgmt.network.v2017_06_01.models.SubResource] + :ivar inbound_nat_pools: Read only. Inbound pools URIs that use this + frontend IP. + :vartype inbound_nat_pools: + list[~azure.mgmt.network.v2017_06_01.models.SubResource] + :ivar outbound_nat_rules: Read only. Outbound rules URIs that use this + frontend IP. + :vartype outbound_nat_rules: + list[~azure.mgmt.network.v2017_06_01.models.SubResource] + :ivar load_balancing_rules: Gets load balancing rules URIs that use this + frontend IP. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_06_01.models.SubResource] + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The Private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_06_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_06_01.models.Subnet + :param public_ip_address: The reference of the Public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_06_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'inbound_nat_rules': {'readonly': True}, + 'inbound_nat_pools': {'readonly': True}, + 'outbound_nat_rules': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[SubResource]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, zones=None, **kwargs) -> None: + super(FrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.inbound_nat_rules = None + self.inbound_nat_pools = None + self.outbound_nat_rules = None + self.load_balancing_rules = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.zones = zones diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route.py index 64a53f146c0b..0b96cb661e70 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route.py @@ -54,8 +54,8 @@ class GatewayRoute(Model): 'weight': {'key': 'weight', 'type': 'int'}, } - def __init__(self): - super(GatewayRoute, self).__init__() + def __init__(self, **kwargs): + super(GatewayRoute, self).__init__(**kwargs) self.local_address = None self.network = None self.next_hop = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route_list_result.py index da2446f3c251..04d4d9177e50 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route_list_result.py @@ -23,6 +23,6 @@ class GatewayRouteListResult(Model): 'value': {'key': 'value', 'type': '[GatewayRoute]'}, } - def __init__(self, value=None): - super(GatewayRouteListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route_list_result_py3.py new file mode 100644 index 000000000000..09b201bd21ac --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRouteListResult(Model): + """List of virtual network gateway routes. + + :param value: List of gateway routes + :type value: list[~azure.mgmt.network.v2017_06_01.models.GatewayRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayRoute]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route_py3.py new file mode 100644 index 000000000000..1aa3ba60605f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/gateway_route_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRoute(Model): + """Gateway routing details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The gateway's local address + :vartype local_address: str + :ivar network: The route's network prefix + :vartype network: str + :ivar next_hop: The route's next hop + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from + :vartype source_peer: str + :ivar origin: The source this route was learned from + :vartype origin: str + :ivar as_path: The route's AS path sequence + :vartype as_path: str + :ivar weight: The route's weight + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(GatewayRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_pool.py index 726547cf0dae..e86aa6aa94e8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_pool.py @@ -15,25 +15,29 @@ class InboundNatPool(SubResource): """Inbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. :type frontend_ip_configuration: ~azure.mgmt.network.v2017_06_01.models.SubResource - :param protocol: The transport protocol for the endpoint. Possible values - are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :param protocol: Required. The transport protocol for the endpoint. + Possible values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2017_06_01.models.TransportProtocol - :param frontend_port_range_start: The first port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65534. + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. :type frontend_port_range_start: int - :param frontend_port_range_end: The last port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65535. + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. :type frontend_port_range_end: int - :param backend_port: The port used for internal connections on the - endpoint. Acceptable values are between 1 and 65535. + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. :type backend_port: int :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. @@ -65,13 +69,13 @@ class InboundNatPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port_range_start, frontend_port_range_end, backend_port, id=None, frontend_ip_configuration=None, provisioning_state=None, name=None, etag=None): - super(InboundNatPool, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.protocol = protocol - self.frontend_port_range_start = frontend_port_range_start - self.frontend_port_range_end = frontend_port_range_end - self.backend_port = backend_port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(InboundNatPool, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.protocol = kwargs.get('protocol', None) + self.frontend_port_range_start = kwargs.get('frontend_port_range_start', None) + self.frontend_port_range_end = kwargs.get('frontend_port_range_end', None) + self.backend_port = kwargs.get('backend_port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_pool_py3.py new file mode 100644 index 000000000000..cdee43f3320c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_pool_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatPool(SubResource): + """Inbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param protocol: Required. The transport protocol for the endpoint. + Possible values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_06_01.models.TransportProtocol + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. + :type frontend_port_range_start: int + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. + :type frontend_port_range_end: int + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port_range_start': {'required': True}, + 'frontend_port_range_end': {'required': True}, + 'backend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, + 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port_range_start: int, frontend_port_range_end: int, backend_port: int, id: str=None, frontend_ip_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatPool, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.protocol = protocol + self.frontend_port_range_start = frontend_port_range_start + self.frontend_port_range_end = frontend_port_range_end + self.backend_port = backend_port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_rule.py index 29ef55d6af72..425ffce4a117 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_rule.py @@ -78,15 +78,15 @@ class InboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, protocol=None, frontend_port=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(InboundNatRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration + def __init__(self, **kwargs): + super(InboundNatRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) self.backend_ip_configuration = None - self.protocol = protocol - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_rule_py3.py new file mode 100644 index 000000000000..9451365c8181 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/inbound_nat_rule_py3.py @@ -0,0 +1,92 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatRule(SubResource): + """Inbound NAT rule of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :ivar backend_ip_configuration: A reference to a private IP address + defined on a network interface of a VM. Traffic sent to the frontend port + of each of the frontend IP configurations is forwarded to the backend IP. + :vartype backend_ip_configuration: + ~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceIPConfiguration + :param protocol: The transport protocol for the endpoint. Possible values + are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_06_01.models.TransportProtocol + :param frontend_port: The port for the external endpoint. Port numbers for + each rule must be unique within the Load Balancer. Acceptable values range + from 1 to 65534. + :type frontend_port: int + :param backend_port: The port used for the internal endpoint. Acceptable + values range from 1 to 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, protocol=None, frontend_port: int=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_ip_configuration = None + self.protocol = protocol + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_address_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_address_availability_result.py index f2cb36a550ec..6bcf52275711 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_address_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_address_availability_result.py @@ -27,7 +27,7 @@ class IPAddressAvailabilityResult(Model): 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, } - def __init__(self, available=None, available_ip_addresses=None): - super(IPAddressAvailabilityResult, self).__init__() - self.available = available - self.available_ip_addresses = available_ip_addresses + def __init__(self, **kwargs): + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) + self.available_ip_addresses = kwargs.get('available_ip_addresses', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_address_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_address_availability_result_py3.py new file mode 100644 index 000000000000..e5fc4340d370 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_address_availability_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPAddressAvailabilityResult(Model): + """Response for CheckIPAddressAvailability API service call. + + :param available: Private IP address availability. + :type available: bool + :param available_ip_addresses: Contains other available private IP + addresses if the asked for address is taken. + :type available_ip_addresses: list[str] + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, + } + + def __init__(self, *, available: bool=None, available_ip_addresses=None, **kwargs) -> None: + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = available + self.available_ip_addresses = available_ip_addresses diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_configuration.py index ca2f08ee68c3..d65e7eecad98 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_configuration.py @@ -51,12 +51,12 @@ class IPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(IPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(IPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_configuration_py3.py new file mode 100644 index 000000000000..3814703da624 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ip_configuration_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class IPConfiguration(SubResource): + """IP configuration. + + :param id: Resource ID. + :type id: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_06_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_06_01.models.Subnet + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_06_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(IPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipsec_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipsec_policy.py index a842af40b4c3..4106ab87e629 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipsec_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipsec_policy.py @@ -15,39 +15,41 @@ class IpsecPolicy(Model): """An IPSec Policy configuration for a virtual network gateway connection. - :param sa_life_time_seconds: The IPSec Security Association (also called - Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN - tunnel. + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. :type sa_life_time_seconds: int - :param sa_data_size_kilobytes: The IPSec Security Association (also called - Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN - tunnel. + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. :type sa_data_size_kilobytes: int - :param ipsec_encryption: The IPSec encryption algorithm (IKE phase 1). - Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', - 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' :type ipsec_encryption: str or ~azure.mgmt.network.v2017_06_01.models.IpsecEncryption - :param ipsec_integrity: The IPSec integrity algorithm (IKE phase 1). - Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256' :type ipsec_integrity: str or ~azure.mgmt.network.v2017_06_01.models.IpsecIntegrity - :param ike_encryption: The IKE encryption algorithm (IKE phase 2). - Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' :type ike_encryption: str or ~azure.mgmt.network.v2017_06_01.models.IkeEncryption - :param ike_integrity: The IKE integrity algorithm (IKE phase 2). Possible - values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' :type ike_integrity: str or ~azure.mgmt.network.v2017_06_01.models.IkeIntegrity - :param dh_group: The DH Groups used in IKE Phase 1 for initial SA. - Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' :type dh_group: str or ~azure.mgmt.network.v2017_06_01.models.DhGroup - :param pfs_group: The DH Groups used in IKE Phase 2 for new child SA. - Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', - 'ECP384', 'PFS24' + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' :type pfs_group: str or ~azure.mgmt.network.v2017_06_01.models.PfsGroup """ @@ -73,13 +75,13 @@ class IpsecPolicy(Model): 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, } - def __init__(self, sa_life_time_seconds, sa_data_size_kilobytes, ipsec_encryption, ipsec_integrity, ike_encryption, ike_integrity, dh_group, pfs_group): - super(IpsecPolicy, self).__init__() - self.sa_life_time_seconds = sa_life_time_seconds - self.sa_data_size_kilobytes = sa_data_size_kilobytes - self.ipsec_encryption = ipsec_encryption - self.ipsec_integrity = ipsec_integrity - self.ike_encryption = ike_encryption - self.ike_integrity = ike_integrity - self.dh_group = dh_group - self.pfs_group = pfs_group + def __init__(self, **kwargs): + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = kwargs.get('sa_life_time_seconds', None) + self.sa_data_size_kilobytes = kwargs.get('sa_data_size_kilobytes', None) + self.ipsec_encryption = kwargs.get('ipsec_encryption', None) + self.ipsec_integrity = kwargs.get('ipsec_integrity', None) + self.ike_encryption = kwargs.get('ike_encryption', None) + self.ike_integrity = kwargs.get('ike_integrity', None) + self.dh_group = kwargs.get('dh_group', None) + self.pfs_group = kwargs.get('pfs_group', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipsec_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipsec_policy_py3.py new file mode 100644 index 000000000000..efe19bc1c40c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipsec_policy_py3.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IpsecPolicy(Model): + """An IPSec Policy configuration for a virtual network gateway connection. + + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. + :type sa_life_time_seconds: int + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. + :type sa_data_size_kilobytes: int + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :type ipsec_encryption: str or + ~azure.mgmt.network.v2017_06_01.models.IpsecEncryption + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + 'GCMAES192', 'GCMAES256' + :type ipsec_integrity: str or + ~azure.mgmt.network.v2017_06_01.models.IpsecIntegrity + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :type ike_encryption: str or + ~azure.mgmt.network.v2017_06_01.models.IkeEncryption + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :type ike_integrity: str or + ~azure.mgmt.network.v2017_06_01.models.IkeIntegrity + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + :type dh_group: str or ~azure.mgmt.network.v2017_06_01.models.DhGroup + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' + :type pfs_group: str or ~azure.mgmt.network.v2017_06_01.models.PfsGroup + """ + + _validation = { + 'sa_life_time_seconds': {'required': True}, + 'sa_data_size_kilobytes': {'required': True}, + 'ipsec_encryption': {'required': True}, + 'ipsec_integrity': {'required': True}, + 'ike_encryption': {'required': True}, + 'ike_integrity': {'required': True}, + 'dh_group': {'required': True}, + 'pfs_group': {'required': True}, + } + + _attribute_map = { + 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, + 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, + 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, + 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, + 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, + 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, + 'dh_group': {'key': 'dhGroup', 'type': 'str'}, + 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, + } + + def __init__(self, *, sa_life_time_seconds: int, sa_data_size_kilobytes: int, ipsec_encryption, ipsec_integrity, ike_encryption, ike_integrity, dh_group, pfs_group, **kwargs) -> None: + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = sa_life_time_seconds + self.sa_data_size_kilobytes = sa_data_size_kilobytes + self.ipsec_encryption = ipsec_encryption + self.ipsec_integrity = ipsec_integrity + self.ike_encryption = ike_encryption + self.ike_integrity = ike_integrity + self.dh_group = dh_group + self.pfs_group = pfs_group diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipv6_express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipv6_express_route_circuit_peering_config.py index da2ab4cb1659..574e0fb4d865 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipv6_express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipv6_express_route_circuit_peering_config.py @@ -38,10 +38,10 @@ class Ipv6ExpressRouteCircuitPeeringConfig(Model): 'state': {'key': 'state', 'type': 'str'}, } - def __init__(self, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, microsoft_peering_config=None, route_filter=None, state=None): - super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__() - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.microsoft_peering_config = microsoft_peering_config - self.route_filter = route_filter - self.state = state + def __init__(self, **kwargs): + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.route_filter = kwargs.get('route_filter', None) + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipv6_express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipv6_express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..d09b7a1e281e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/ipv6_express_route_circuit_peering_config_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv6ExpressRouteCircuitPeeringConfig(Model): + """Contains IPv6 peering config. + + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2017_06_01.models.RouteFilter + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeeringState + """ + + _attribute_map = { + 'primary_peer_address_prefix': {'key': 'primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'secondaryPeerAddressPrefix', 'type': 'str'}, + 'microsoft_peering_config': {'key': 'microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'route_filter': {'key': 'routeFilter', 'type': 'RouteFilter'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, microsoft_peering_config=None, route_filter=None, state=None, **kwargs) -> None: + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.microsoft_peering_config = microsoft_peering_config + self.route_filter = route_filter + self.state = state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancer.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancer.py index 309582e61863..d11c4f79af57 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancer.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancer.py @@ -97,15 +97,15 @@ class LoadBalancer(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(LoadBalancer, self).__init__(id=id, location=location, tags=tags) - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pools = backend_address_pools - self.load_balancing_rules = load_balancing_rules - self.probes = probes - self.inbound_nat_rules = inbound_nat_rules - self.inbound_nat_pools = inbound_nat_pools - self.outbound_nat_rules = outbound_nat_rules - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancer, self).__init__(**kwargs) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.load_balancing_rules = kwargs.get('load_balancing_rules', None) + self.probes = kwargs.get('probes', None) + self.inbound_nat_rules = kwargs.get('inbound_nat_rules', None) + self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) + self.outbound_nat_rules = kwargs.get('outbound_nat_rules', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancer_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancer_py3.py new file mode 100644 index 000000000000..b9500652ac47 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancer_py3.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LoadBalancer(Resource): + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param frontend_ip_configurations: Object representing the frontend IPs to + be used for the load balancer + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_06_01.models.FrontendIPConfiguration] + :param backend_address_pools: Collection of backend address pools used by + a load balancer + :type backend_address_pools: + list[~azure.mgmt.network.v2017_06_01.models.BackendAddressPool] + :param load_balancing_rules: Object collection representing the load + balancing rules Gets the provisioning + :type load_balancing_rules: + list[~azure.mgmt.network.v2017_06_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer + :type probes: list[~azure.mgmt.network.v2017_06_01.models.Probe] + :param inbound_nat_rules: Collection of inbound NAT Rules used by a load + balancer. Defining inbound NAT rules on your load balancer is mutually + exclusive with defining an inbound NAT pool. Inbound NAT pools are + referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an Inbound NAT pool. They + have to reference individual inbound NAT rules. + :type inbound_nat_rules: + list[~azure.mgmt.network.v2017_06_01.models.InboundNatRule] + :param inbound_nat_pools: Defines an external port range for inbound NAT + to a single backend port on NICs associated with a load balancer. Inbound + NAT rules are created automatically for each NIC associated with the Load + Balancer using an external port from this range. Defining an Inbound NAT + pool on your Load Balancer is mutually exclusive with defining inbound Nat + rules. Inbound NAT pools are referenced from virtual machine scale sets. + NICs that are associated with individual virtual machines cannot reference + an inbound NAT pool. They have to reference individual inbound NAT rules. + :type inbound_nat_pools: + list[~azure.mgmt.network.v2017_06_01.models.InboundNatPool] + :param outbound_nat_rules: The outbound NAT rules. + :type outbound_nat_rules: + list[~azure.mgmt.network.v2017_06_01.models.OutboundNatRule] + :param resource_guid: The resource GUID property of the load balancer + resource. + :type resource_guid: str + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, + 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[OutboundNatRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancer, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pools = backend_address_pools + self.load_balancing_rules = load_balancing_rules + self.probes = probes + self.inbound_nat_rules = inbound_nat_rules + self.inbound_nat_pools = inbound_nat_pools + self.outbound_nat_rules = outbound_nat_rules + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancing_rule.py index e08397c543f3..8ead88d618f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancing_rule.py @@ -15,6 +15,8 @@ class LoadBalancingRule(SubResource): """A load balancing rule for a load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. @@ -27,8 +29,9 @@ class LoadBalancingRule(SubResource): :param probe: The reference of the load balancer probe used by the load balancing rule. :type probe: ~azure.mgmt.network.v2017_06_01.models.SubResource - :param protocol: The transport protocol for the external endpoint. - Possible values are 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :param protocol: Required. The transport protocol for the external + endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: + 'Udp', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2017_06_01.models.TransportProtocol :param load_distribution: The load distribution policy for this rule. @@ -36,9 +39,9 @@ class LoadBalancingRule(SubResource): Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' :type load_distribution: str or ~azure.mgmt.network.v2017_06_01.models.LoadDistribution - :param frontend_port: The port for the external endpoint. Port numbers for - each rule must be unique within the Load Balancer. Acceptable values are - between 1 and 65534. + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 1 and 65534. :type frontend_port: int :param backend_port: The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. @@ -85,17 +88,17 @@ class LoadBalancingRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port, id=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(LoadBalancingRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.backend_address_pool = backend_address_pool - self.probe = probe - self.protocol = protocol - self.load_distribution = load_distribution - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancingRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.probe = kwargs.get('probe', None) + self.protocol = kwargs.get('protocol', None) + self.load_distribution = kwargs.get('load_distribution', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancing_rule_py3.py new file mode 100644 index 000000000000..6df4e44a6f80 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/load_balancing_rule_py3.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class LoadBalancingRule(SubResource): + """A load balancing rule for a load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param backend_address_pool: A reference to a pool of DIPs. Inbound + traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param probe: The reference of the load balancer probe used by the load + balancing rule. + :type probe: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param protocol: Required. The transport protocol for the external + endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: + 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_06_01.models.TransportProtocol + :param load_distribution: The load distribution policy for this rule. + Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + :type load_distribution: str or + ~azure.mgmt.network.v2017_06_01.models.LoadDistribution + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 1 and 65534. + :type frontend_port: int + :param backend_port: The port used for internal connections on the + endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port: int, id: str=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancingRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_address_pool = backend_address_pool + self.probe = probe + self.protocol = protocol + self.load_distribution = load_distribution + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/local_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/local_network_gateway.py index dc62439754d4..5ae34861bf4f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/local_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/local_network_gateway.py @@ -67,11 +67,11 @@ class LocalNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, local_network_address_space=None, gateway_ip_address=None, bgp_settings=None, resource_guid=None, etag=None): - super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.local_network_address_space = local_network_address_space - self.gateway_ip_address = gateway_ip_address - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(LocalNetworkGateway, self).__init__(**kwargs) + self.local_network_address_space = kwargs.get('local_network_address_space', None) + self.gateway_ip_address = kwargs.get('gateway_ip_address', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/local_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/local_network_gateway_py3.py new file mode 100644 index 000000000000..7f71142c32c1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/local_network_gateway_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LocalNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param local_network_address_space: Local network site address space. + :type local_network_address_space: + ~azure.mgmt.network.v2017_06_01.models.AddressSpace + :param gateway_ip_address: IP address of local network gateway. + :type gateway_ip_address: str + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2017_06_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + LocalNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', + and 'Failed'. + :vartype provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, + 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, local_network_address_space=None, gateway_ip_address: str=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.local_network_address_space = local_network_address_space + self.gateway_ip_address = gateway_ip_address + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface.py index fe8baaac3ef3..f9274cfdfb79 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface.py @@ -87,16 +87,16 @@ class NetworkInterface(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address=None, primary=None, enable_accelerated_networking=None, enable_ip_forwarding=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkInterface, self).__init__(id=id, location=location, tags=tags) - self.virtual_machine = virtual_machine - self.network_security_group = network_security_group - self.ip_configurations = ip_configurations - self.dns_settings = dns_settings - self.mac_address = mac_address - self.primary = primary - self.enable_accelerated_networking = enable_accelerated_networking - self.enable_ip_forwarding = enable_ip_forwarding - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.virtual_machine = kwargs.get('virtual_machine', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.mac_address = kwargs.get('mac_address', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_association.py index 28a998ae366a..f489d039338d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_association.py @@ -34,7 +34,7 @@ class NetworkInterfaceAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(NetworkInterfaceAssociation, self).__init__() + def __init__(self, **kwargs): + super(NetworkInterfaceAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_association_py3.py new file mode 100644 index 000000000000..72c82c89002d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Network interface ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2017_06_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(NetworkInterfaceAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_dns_settings.py index 675a4a1eb08a..b6ee0ff40d51 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_dns_settings.py @@ -46,10 +46,10 @@ class NetworkInterfaceDnsSettings(Model): 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, } - def __init__(self, dns_servers=None, applied_dns_servers=None, internal_dns_name_label=None, internal_fqdn=None, internal_domain_name_suffix=None): - super(NetworkInterfaceDnsSettings, self).__init__() - self.dns_servers = dns_servers - self.applied_dns_servers = applied_dns_servers - self.internal_dns_name_label = internal_dns_name_label - self.internal_fqdn = internal_fqdn - self.internal_domain_name_suffix = internal_domain_name_suffix + def __init__(self, **kwargs): + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + self.applied_dns_servers = kwargs.get('applied_dns_servers', None) + self.internal_dns_name_label = kwargs.get('internal_dns_name_label', None) + self.internal_fqdn = kwargs.get('internal_fqdn', None) + self.internal_domain_name_suffix = kwargs.get('internal_domain_name_suffix', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_dns_settings_py3.py new file mode 100644 index 000000000000..ccdcc937def8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_dns_settings_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceDnsSettings(Model): + """DNS settings of a network interface. + + :param dns_servers: List of DNS servers IP addresses. Use + 'AzureProvidedDNS' to switch to azure provided DNS resolution. + 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + only value in dnsServers collection. + :type dns_servers: list[str] + :param applied_dns_servers: If the VM that uses this NIC is part of an + Availability Set, then this list will have the union of all DNS servers + from all NICs that are part of the Availability Set. This property is what + is configured on each of those VMs. + :type applied_dns_servers: list[str] + :param internal_dns_name_label: Relative DNS name for this NIC used for + internal communications between VMs in the same virtual network. + :type internal_dns_name_label: str + :param internal_fqdn: Fully qualified DNS name supporting internal + communications between VMs in the same virtual network. + :type internal_fqdn: str + :param internal_domain_name_suffix: Even if internalDnsNameLabel is not + specified, a DNS entry is created for the primary NIC of the VM. This DNS + name can be constructed by concatenating the VM name with the value of + internalDomainNameSuffix. + :type internal_domain_name_suffix: str + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, + 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, + } + + def __init__(self, *, dns_servers=None, applied_dns_servers=None, internal_dns_name_label: str=None, internal_fqdn: str=None, internal_domain_name_suffix: str=None, **kwargs) -> None: + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers + self.applied_dns_servers = applied_dns_servers + self.internal_dns_name_label = internal_dns_name_label + self.internal_fqdn = internal_fqdn + self.internal_domain_name_suffix = internal_domain_name_suffix diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_ip_configuration.py index 67fa8e596818..a1c5508ff900 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_ip_configuration.py @@ -78,17 +78,17 @@ class NetworkInterfaceIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(NetworkInterfaceIPConfiguration, self).__init__(id=id) - self.application_gateway_backend_address_pools = application_gateway_backend_address_pools - self.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.private_ip_address_version = private_ip_address_version - self.subnet = subnet - self.primary = primary - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterfaceIPConfiguration, self).__init__(**kwargs) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_rules = kwargs.get('load_balancer_inbound_nat_rules', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_ip_configuration_py3.py new file mode 100644 index 000000000000..eb5055a7f95c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_ip_configuration_py3.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class NetworkInterfaceIPConfiguration(SubResource): + """IPConfiguration in a network interface. + + :param id: Resource ID. + :type id: str + :param application_gateway_backend_address_pools: The reference of + ApplicationGatewayBackendAddressPool resource. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendAddressPool] + :param load_balancer_backend_address_pools: The reference of + LoadBalancerBackendAddressPool resource. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2017_06_01.models.BackendAddressPool] + :param load_balancer_inbound_nat_rules: A list of references of + LoadBalancerInboundNatRules. + :type load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2017_06_01.models.InboundNatRule] + :param private_ip_address: Private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: Defines how a private IP address is + assigned. Possible values are: 'Static' and 'Dynamic'. Possible values + include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_06_01.models.IPAllocationMethod + :param private_ip_address_version: Available from Api-Version 2016-03-30 + onwards, it represents whether the specific ipconfiguration is IPv4 or + IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.network.v2017_06_01.models.IPVersion + :param subnet: Subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.network.v2017_06_01.models.Subnet + :param primary: Gets whether this is a primary customer address on the + network interface. + :type primary: bool + :param public_ip_address: Public IP address bound to the IP configuration. + :type public_ip_address: + ~azure.mgmt.network.v2017_06_01.models.PublicIPAddress + :param provisioning_state: The provisioning state of the network interface + IP configuration. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address: str=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary: bool=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterfaceIPConfiguration, self).__init__(id=id, **kwargs) + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.private_ip_address_version = private_ip_address_version + self.subnet = subnet + self.primary = primary + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_py3.py new file mode 100644 index 000000000000..22b3518c5296 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_interface_py3.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkInterface(Resource): + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param virtual_machine: The reference of a virtual machine. + :type virtual_machine: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2017_06_01.models.NetworkSecurityGroup + :param ip_configurations: A list of IPConfigurations of the network + interface. + :type ip_configurations: + list[~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceIPConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: + ~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceDnsSettings + :param mac_address: The MAC address of the network interface. + :type mac_address: str + :param primary: Gets whether this is a primary network interface on a + virtual machine. + :type primary: bool + :param enable_accelerated_networking: If the network interface is + accelerated networking enabled. + :type enable_accelerated_networking: bool + :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on + this network interface. + :type enable_ip_forwarding: bool + :param resource_guid: The resource GUID property of the network interface + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, + 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address: str=None, primary: bool=None, enable_accelerated_networking: bool=None, enable_ip_forwarding: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterface, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.virtual_machine = virtual_machine + self.network_security_group = network_security_group + self.ip_configurations = ip_configurations + self.dns_settings = dns_settings + self.mac_address = mac_address + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.enable_ip_forwarding = enable_ip_forwarding + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_management_client_enums.py index 6fc8f995adf7..154e788f47d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_management_client_enums.py @@ -12,44 +12,44 @@ from enum import Enum -class TransportProtocol(Enum): +class TransportProtocol(str, Enum): udp = "Udp" tcp = "Tcp" -class IPAllocationMethod(Enum): +class IPAllocationMethod(str, Enum): static = "Static" dynamic = "Dynamic" -class IPVersion(Enum): +class IPVersion(str, Enum): ipv4 = "IPv4" ipv6 = "IPv6" -class SecurityRuleProtocol(Enum): +class SecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" asterisk = "*" -class SecurityRuleAccess(Enum): +class SecurityRuleAccess(str, Enum): allow = "Allow" deny = "Deny" -class SecurityRuleDirection(Enum): +class SecurityRuleDirection(str, Enum): inbound = "Inbound" outbound = "Outbound" -class RouteNextHopType(Enum): +class RouteNextHopType(str, Enum): virtual_network_gateway = "VirtualNetworkGateway" vnet_local = "VnetLocal" @@ -58,19 +58,19 @@ class RouteNextHopType(Enum): none = "None" -class ApplicationGatewayProtocol(Enum): +class ApplicationGatewayProtocol(str, Enum): http = "Http" https = "Https" -class ApplicationGatewayCookieBasedAffinity(Enum): +class ApplicationGatewayCookieBasedAffinity(str, Enum): enabled = "Enabled" disabled = "Disabled" -class ApplicationGatewayBackendHealthServerHealth(Enum): +class ApplicationGatewayBackendHealthServerHealth(str, Enum): unknown = "Unknown" up = "Up" @@ -79,7 +79,7 @@ class ApplicationGatewayBackendHealthServerHealth(Enum): draining = "Draining" -class ApplicationGatewaySkuName(Enum): +class ApplicationGatewaySkuName(str, Enum): standard_small = "Standard_Small" standard_medium = "Standard_Medium" @@ -88,33 +88,33 @@ class ApplicationGatewaySkuName(Enum): waf_large = "WAF_Large" -class ApplicationGatewayTier(Enum): +class ApplicationGatewayTier(str, Enum): standard = "Standard" waf = "WAF" -class ApplicationGatewaySslProtocol(Enum): +class ApplicationGatewaySslProtocol(str, Enum): tl_sv1_0 = "TLSv1_0" tl_sv1_1 = "TLSv1_1" tl_sv1_2 = "TLSv1_2" -class ApplicationGatewaySslPolicyType(Enum): +class ApplicationGatewaySslPolicyType(str, Enum): predefined = "Predefined" custom = "Custom" -class ApplicationGatewaySslPolicyName(Enum): +class ApplicationGatewaySslPolicyName(str, Enum): app_gw_ssl_policy20150501 = "AppGwSslPolicy20150501" app_gw_ssl_policy20170401 = "AppGwSslPolicy20170401" app_gw_ssl_policy20170401_s = "AppGwSslPolicy20170401S" -class ApplicationGatewaySslCipherSuite(Enum): +class ApplicationGatewaySslCipherSuite(str, Enum): tls_ecdhe_rsa_with_aes_256_cbc_sha384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" tls_ecdhe_rsa_with_aes_128_cbc_sha256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" @@ -143,13 +143,13 @@ class ApplicationGatewaySslCipherSuite(Enum): tls_rsa_with_3_des_ede_cbc_sha = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" -class ApplicationGatewayRequestRoutingRuleType(Enum): +class ApplicationGatewayRequestRoutingRuleType(str, Enum): basic = "Basic" path_based_routing = "PathBasedRouting" -class ApplicationGatewayRedirectType(Enum): +class ApplicationGatewayRedirectType(str, Enum): permanent = "Permanent" found = "Found" @@ -157,7 +157,7 @@ class ApplicationGatewayRedirectType(Enum): temporary = "Temporary" -class ApplicationGatewayOperationalState(Enum): +class ApplicationGatewayOperationalState(str, Enum): stopped = "Stopped" starting = "Starting" @@ -165,19 +165,19 @@ class ApplicationGatewayOperationalState(Enum): stopping = "Stopping" -class ApplicationGatewayFirewallMode(Enum): +class ApplicationGatewayFirewallMode(str, Enum): detection = "Detection" prevention = "Prevention" -class AuthorizationUseStatus(Enum): +class AuthorizationUseStatus(str, Enum): available = "Available" in_use = "InUse" -class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(str, Enum): not_configured = "NotConfigured" configuring = "Configuring" @@ -185,39 +185,39 @@ class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): validation_needed = "ValidationNeeded" -class Access(Enum): +class Access(str, Enum): allow = "Allow" deny = "Deny" -class ExpressRouteCircuitPeeringType(Enum): +class ExpressRouteCircuitPeeringType(str, Enum): azure_public_peering = "AzurePublicPeering" azure_private_peering = "AzurePrivatePeering" microsoft_peering = "MicrosoftPeering" -class ExpressRouteCircuitPeeringState(Enum): +class ExpressRouteCircuitPeeringState(str, Enum): disabled = "Disabled" enabled = "Enabled" -class ExpressRouteCircuitSkuTier(Enum): +class ExpressRouteCircuitSkuTier(str, Enum): standard = "Standard" premium = "Premium" transport = "Transport" -class ExpressRouteCircuitSkuFamily(Enum): +class ExpressRouteCircuitSkuFamily(str, Enum): unlimited_data = "UnlimitedData" metered_data = "MeteredData" -class ServiceProviderProvisioningState(Enum): +class ServiceProviderProvisioningState(str, Enum): not_provisioned = "NotProvisioned" provisioning = "Provisioning" @@ -225,34 +225,34 @@ class ServiceProviderProvisioningState(Enum): deprovisioning = "Deprovisioning" -class LoadDistribution(Enum): +class LoadDistribution(str, Enum): default = "Default" source_ip = "SourceIP" source_ip_protocol = "SourceIPProtocol" -class ProbeProtocol(Enum): +class ProbeProtocol(str, Enum): http = "Http" tcp = "Tcp" -class NetworkOperationStatus(Enum): +class NetworkOperationStatus(str, Enum): in_progress = "InProgress" succeeded = "Succeeded" failed = "Failed" -class EffectiveSecurityRuleProtocol(Enum): +class EffectiveSecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" all = "All" -class EffectiveRouteSource(Enum): +class EffectiveRouteSource(str, Enum): unknown = "Unknown" user = "User" @@ -260,13 +260,13 @@ class EffectiveRouteSource(Enum): default = "Default" -class EffectiveRouteState(Enum): +class EffectiveRouteState(str, Enum): active = "Active" invalid = "Invalid" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): succeeded = "Succeeded" updating = "Updating" @@ -274,25 +274,25 @@ class ProvisioningState(Enum): failed = "Failed" -class AssociationType(Enum): +class AssociationType(str, Enum): associated = "Associated" contains = "Contains" -class Direction(Enum): +class Direction(str, Enum): inbound = "Inbound" outbound = "Outbound" -class Protocol(Enum): +class Protocol(str, Enum): tcp = "TCP" udp = "UDP" -class NextHopType(Enum): +class NextHopType(str, Enum): internet = "Internet" virtual_appliance = "VirtualAppliance" @@ -302,14 +302,14 @@ class NextHopType(Enum): none = "None" -class PcProtocol(Enum): +class PcProtocol(str, Enum): tcp = "TCP" udp = "UDP" any = "Any" -class PcStatus(Enum): +class PcStatus(str, Enum): not_started = "NotStarted" running = "Running" @@ -318,7 +318,7 @@ class PcStatus(Enum): unknown = "Unknown" -class PcError(Enum): +class PcError(str, Enum): internal_error = "InternalError" agent_stopped = "AgentStopped" @@ -327,20 +327,20 @@ class PcError(Enum): storage_failed = "StorageFailed" -class Origin(Enum): +class Origin(str, Enum): local = "Local" inbound = "Inbound" outbound = "Outbound" -class Severity(Enum): +class Severity(str, Enum): error = "Error" warning = "Warning" -class IssueType(Enum): +class IssueType(str, Enum): unknown = "Unknown" agent_stopped = "AgentStopped" @@ -353,7 +353,7 @@ class IssueType(Enum): platform = "Platform" -class ConnectionStatus(Enum): +class ConnectionStatus(str, Enum): unknown = "Unknown" connected = "Connected" @@ -361,26 +361,26 @@ class ConnectionStatus(Enum): degraded = "Degraded" -class VirtualNetworkPeeringState(Enum): +class VirtualNetworkPeeringState(str, Enum): initiated = "Initiated" connected = "Connected" disconnected = "Disconnected" -class VirtualNetworkGatewayType(Enum): +class VirtualNetworkGatewayType(str, Enum): vpn = "Vpn" express_route = "ExpressRoute" -class VpnType(Enum): +class VpnType(str, Enum): policy_based = "PolicyBased" route_based = "RouteBased" -class VirtualNetworkGatewaySkuName(Enum): +class VirtualNetworkGatewaySkuName(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -391,7 +391,7 @@ class VirtualNetworkGatewaySkuName(Enum): vpn_gw3 = "VpnGw3" -class VirtualNetworkGatewaySkuTier(Enum): +class VirtualNetworkGatewaySkuTier(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -402,13 +402,13 @@ class VirtualNetworkGatewaySkuTier(Enum): vpn_gw3 = "VpnGw3" -class VpnClientProtocol(Enum): +class VpnClientProtocol(str, Enum): ike_v2 = "IkeV2" sstp = "SSTP" -class BgpPeerState(Enum): +class BgpPeerState(str, Enum): unknown = "Unknown" stopped = "Stopped" @@ -417,19 +417,19 @@ class BgpPeerState(Enum): connected = "Connected" -class ProcessorArchitecture(Enum): +class ProcessorArchitecture(str, Enum): amd64 = "Amd64" x86 = "X86" -class AuthenticationMethod(Enum): +class AuthenticationMethod(str, Enum): eaptls = "EAPTLS" eapmscha_pv2 = "EAPMSCHAPv2" -class VirtualNetworkGatewayConnectionStatus(Enum): +class VirtualNetworkGatewayConnectionStatus(str, Enum): unknown = "Unknown" connecting = "Connecting" @@ -437,7 +437,7 @@ class VirtualNetworkGatewayConnectionStatus(Enum): not_connected = "NotConnected" -class VirtualNetworkGatewayConnectionType(Enum): +class VirtualNetworkGatewayConnectionType(str, Enum): ipsec = "IPsec" vnet2_vnet = "Vnet2Vnet" @@ -445,7 +445,7 @@ class VirtualNetworkGatewayConnectionType(Enum): vpn_client = "VPNClient" -class IpsecEncryption(Enum): +class IpsecEncryption(str, Enum): none = "None" des = "DES" @@ -458,7 +458,7 @@ class IpsecEncryption(Enum): gcmaes256 = "GCMAES256" -class IpsecIntegrity(Enum): +class IpsecIntegrity(str, Enum): md5 = "MD5" sha1 = "SHA1" @@ -468,7 +468,7 @@ class IpsecIntegrity(Enum): gcmaes256 = "GCMAES256" -class IkeEncryption(Enum): +class IkeEncryption(str, Enum): des = "DES" des3 = "DES3" @@ -477,7 +477,7 @@ class IkeEncryption(Enum): aes256 = "AES256" -class IkeIntegrity(Enum): +class IkeIntegrity(str, Enum): md5 = "MD5" sha1 = "SHA1" @@ -485,7 +485,7 @@ class IkeIntegrity(Enum): sha384 = "SHA384" -class DhGroup(Enum): +class DhGroup(str, Enum): none = "None" dh_group1 = "DHGroup1" @@ -497,7 +497,7 @@ class DhGroup(Enum): dh_group24 = "DHGroup24" -class PfsGroup(Enum): +class PfsGroup(str, Enum): none = "None" pfs1 = "PFS1" diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_security_group.py index 3f38a2e55cbd..cabe46462427 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_security_group.py @@ -75,12 +75,12 @@ class NetworkSecurityGroup(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, security_rules=None, default_security_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags) - self.security_rules = security_rules - self.default_security_rules = default_security_rules + def __init__(self, **kwargs): + super(NetworkSecurityGroup, self).__init__(**kwargs) + self.security_rules = kwargs.get('security_rules', None) + self.default_security_rules = kwargs.get('default_security_rules', None) self.network_interfaces = None self.subnets = None - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_security_group_py3.py new file mode 100644 index 000000000000..be353a3f7746 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_security_group_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkSecurityGroup(Resource): + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param security_rules: A collection of security rules of the network + security group. + :type security_rules: + list[~azure.mgmt.network.v2017_06_01.models.SecurityRule] + :param default_security_rules: The default security rules of network + security group. + :type default_security_rules: + list[~azure.mgmt.network.v2017_06_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network + interfaces. + :vartype network_interfaces: + list[~azure.mgmt.network.v2017_06_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2017_06_01.models.Subnet] + :param resource_guid: The resource GUID property of the network security + group resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, + 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, security_rules=None, default_security_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.security_rules = security_rules + self.default_security_rules = default_security_rules + self.network_interfaces = None + self.subnets = None + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_watcher.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_watcher.py index 3fa287a0cbe0..117479c79c63 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_watcher.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_watcher.py @@ -53,7 +53,7 @@ class NetworkWatcher(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, etag=None): - super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags) - self.etag = etag + def __init__(self, **kwargs): + super(NetworkWatcher, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_watcher_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_watcher_py3.py new file mode 100644 index 000000000000..e185c391d075 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_watcher_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkWatcher(Resource): + """Network watcher in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.network.v2017_06_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, etag: str=None, **kwargs) -> None: + super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = etag + self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_parameters.py index 3e1478409a0a..54d8674c8884 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_parameters.py @@ -15,12 +15,14 @@ class NextHopParameters(Model): """Parameters that define the source and destination endpoint. - :param target_resource_id: The resource identifier of the target resource - against which the action is to be performed. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. :type target_resource_id: str - :param source_ip_address: The source IP address. + :param source_ip_address: Required. The source IP address. :type source_ip_address: str - :param destination_ip_address: The destination IP address. + :param destination_ip_address: Required. The destination IP address. :type destination_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be @@ -41,9 +43,9 @@ class NextHopParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, source_ip_address, destination_ip_address, target_nic_resource_id=None): - super(NextHopParameters, self).__init__() - self.target_resource_id = target_resource_id - self.source_ip_address = source_ip_address - self.destination_ip_address = destination_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.source_ip_address = kwargs.get('source_ip_address', None) + self.destination_ip_address = kwargs.get('destination_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_parameters_py3.py new file mode 100644 index 000000000000..50ee3d334e91 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_parameters_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopParameters(Model): + """Parameters that define the source and destination endpoint. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. + :type target_resource_id: str + :param source_ip_address: Required. The source IP address. + :type source_ip_address: str + :param destination_ip_address: Required. The destination IP address. + :type destination_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of the nics, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'source_ip_address': {'required': True}, + 'destination_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, + 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, source_ip_address: str, destination_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.source_ip_address = source_ip_address + self.destination_ip_address = destination_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_result.py index e2efff85a945..ee98af89afb2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_result.py @@ -35,8 +35,8 @@ class NextHopResult(Model): 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, } - def __init__(self, next_hop_type=None, next_hop_ip_address=None, route_table_id=None): - super(NextHopResult, self).__init__() - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.route_table_id = route_table_id + def __init__(self, **kwargs): + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.route_table_id = kwargs.get('route_table_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_result_py3.py new file mode 100644 index 000000000000..bc359a5c2a5b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/next_hop_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopResult(Model): + """The information about next hop from the specified VM. + + :param next_hop_type: Next hop type. Possible values include: 'Internet', + 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', + 'HyperNetGateway', 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_06_01.models.NextHopType + :param next_hop_ip_address: Next hop IP Address + :type next_hop_ip_address: str + :param route_table_id: The resource identifier for the route table + associated with the route being returned. If the route being returned does + not correspond to any user created routes then this field will be the + string 'System Route'. + :type route_table_id: str + """ + + _attribute_map = { + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type=None, next_hop_ip_address: str=None, route_table_id: str=None, **kwargs) -> None: + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.route_table_id = route_table_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/outbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/outbound_nat_rule.py index 7619c87b0956..e3302b84e3a0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/outbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/outbound_nat_rule.py @@ -15,6 +15,8 @@ class OutboundNatRule(SubResource): """Outbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param allocated_outbound_ports: The number of outbound ports to be used @@ -24,8 +26,8 @@ class OutboundNatRule(SubResource): balancer. :type frontend_ip_configurations: list[~azure.mgmt.network.v2017_06_01.models.SubResource] - :param backend_address_pool: A reference to a pool of DIPs. Outbound - traffic is randomly load balanced across IPs in the backend IPs. + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. :type backend_address_pool: ~azure.mgmt.network.v2017_06_01.models.SubResource :param provisioning_state: Gets the provisioning state of the PublicIP @@ -53,11 +55,11 @@ class OutboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, backend_address_pool, id=None, allocated_outbound_ports=None, frontend_ip_configurations=None, provisioning_state=None, name=None, etag=None): - super(OutboundNatRule, self).__init__(id=id) - self.allocated_outbound_ports = allocated_outbound_ports - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pool = backend_address_pool - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(OutboundNatRule, self).__init__(**kwargs) + self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/outbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/outbound_nat_rule_py3.py new file mode 100644 index 000000000000..11020b1632aa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/outbound_nat_rule_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class OutboundNatRule(SubResource): + """Outbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param allocated_outbound_ports: The number of outbound ports to be used + for NAT. + :type allocated_outbound_ports: int + :param frontend_ip_configurations: The Frontend IP addresses of the load + balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_06_01.models.SubResource] + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_address_pool': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, backend_address_pool, id: str=None, allocated_outbound_ports: int=None, frontend_ip_configurations=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(OutboundNatRule, self).__init__(id=id, **kwargs) + self.allocated_outbound_ports = allocated_outbound_ports + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pool = backend_address_pool + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture.py index cd1dfc5d392f..acf3446dbbeb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture.py @@ -15,8 +15,10 @@ class PacketCapture(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCapture(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_06_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCapture(Model): 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCapture, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCapture, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_filter.py index d66a139abe79..a38ac98b9873 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_filter.py @@ -51,10 +51,10 @@ class PacketCaptureFilter(Model): 'remote_port': {'key': 'remotePort', 'type': 'str'}, } - def __init__(self, protocol="Any", local_ip_address=None, remote_ip_address=None, local_port=None, remote_port=None): - super(PacketCaptureFilter, self).__init__() - self.protocol = protocol - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.local_port = local_port - self.remote_port = remote_port + def __init__(self, **kwargs): + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', "Any") + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_filter_py3.py new file mode 100644 index 000000000000..171d1133b7ea --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_filter_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureFilter(Model): + """Filter that is applied to packet capture request. Multiple filters can be + applied. + + :param protocol: Protocol to be filtered on. Possible values include: + 'TCP', 'UDP', 'Any'. Default value: "Any" . + :type protocol: str or ~azure.mgmt.network.v2017_06_01.models.PcProtocol + :param local_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type local_ip_address: str + :param remote_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type remote_ip_address: str + :param local_port: Local port to be filtered on. Notation: "80" for single + port entry."80-85" for range. "80;443;" for multiple entries. Multiple + ranges not currently supported. Mixing ranges with multiple entries not + currently supported. Default = null. + :type local_port: str + :param remote_port: Remote port to be filtered on. Notation: "80" for + single port entry."80-85" for range. "80;443;" for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple + entries not currently supported. Default = null. + :type remote_port: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + } + + def __init__(self, *, protocol="Any", local_ip_address: str=None, remote_ip_address: str=None, local_port: str=None, remote_port: str=None, **kwargs) -> None: + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = protocol + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.local_port = local_port + self.remote_port = remote_port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_parameters.py index 2e94f0848506..2e15c69c334c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_parameters.py @@ -15,8 +15,10 @@ class PacketCaptureParameters(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCaptureParameters(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_06_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCaptureParameters(Model): 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCaptureParameters, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_parameters_py3.py new file mode 100644 index 000000000000..62e58a1fee5a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_parameters_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureParameters(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_06_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_06_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_py3.py new file mode 100644 index 000000000000..1266a54d9684 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCapture(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_06_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_06_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCapture, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_query_status_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_query_status_result.py index 12ee5efaf002..2fc082985e42 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_query_status_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_query_status_result.py @@ -43,11 +43,11 @@ class PacketCaptureQueryStatusResult(Model): 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, } - def __init__(self, name=None, id=None, capture_start_time=None, packet_capture_status=None, stop_reason=None, packet_capture_error=None): - super(PacketCaptureQueryStatusResult, self).__init__() - self.name = name - self.id = id - self.capture_start_time = capture_start_time - self.packet_capture_status = packet_capture_status - self.stop_reason = stop_reason - self.packet_capture_error = packet_capture_error + def __init__(self, **kwargs): + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.capture_start_time = kwargs.get('capture_start_time', None) + self.packet_capture_status = kwargs.get('packet_capture_status', None) + self.stop_reason = kwargs.get('stop_reason', None) + self.packet_capture_error = kwargs.get('packet_capture_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_query_status_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_query_status_result_py3.py new file mode 100644 index 000000000000..2f75af35c6db --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_query_status_result_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureQueryStatusResult(Model): + """Status of packet capture session. + + :param name: The name of the packet capture resource. + :type name: str + :param id: The ID of the packet capture resource. + :type id: str + :param capture_start_time: The start time of the packet capture session. + :type capture_start_time: datetime + :param packet_capture_status: The status of the packet capture session. + Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', + 'Unknown' + :type packet_capture_status: str or + ~azure.mgmt.network.v2017_06_01.models.PcStatus + :param stop_reason: The reason the current packet capture session was + stopped. + :type stop_reason: str + :param packet_capture_error: List of errors of packet capture session. + :type packet_capture_error: list[str or + ~azure.mgmt.network.v2017_06_01.models.PcError] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, + 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, + 'stop_reason': {'key': 'stopReason', 'type': 'str'}, + 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, id: str=None, capture_start_time=None, packet_capture_status=None, stop_reason: str=None, packet_capture_error=None, **kwargs) -> None: + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = name + self.id = id + self.capture_start_time = capture_start_time + self.packet_capture_status = packet_capture_status + self.stop_reason = stop_reason + self.packet_capture_error = packet_capture_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_result.py index 1930afcdf9da..aba58acf7d38 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_result.py @@ -18,6 +18,8 @@ class PacketCaptureResult(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar name: Name of the packet capture session. :vartype name: str :ivar id: ID of the packet capture operation. @@ -25,8 +27,8 @@ class PacketCaptureResult(Model): :param etag: Default value: "A unique read-only string that changes whenever the resource is updated." . :type etag: str - :param target: The ID of the targeted resource, only VM is currently - supported. + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -37,7 +39,7 @@ class PacketCaptureResult(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_06_01.models.PacketCaptureStorageLocation :param filters: @@ -70,15 +72,15 @@ class PacketCaptureResult(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, target, storage_location, etag="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None, provisioning_state=None): - super(PacketCaptureResult, self).__init__() + def __init__(self, **kwargs): + super(PacketCaptureResult, self).__init__(**kwargs) self.name = None self.id = None - self.etag = etag - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters - self.provisioning_state = provisioning_state + self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_result_py3.py new file mode 100644 index 000000000000..0019ba8d5351 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_result_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureResult(Model): + """Information about packet capture session. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the packet capture session. + :vartype name: str + :ivar id: ID of the packet capture operation. + :vartype id: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_06_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_06_01.models.PacketCaptureFilter] + :param provisioning_state: The provisioning state of the packet capture + session. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2017_06_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, target: str, storage_location, etag: str="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, provisioning_state=None, **kwargs) -> None: + super(PacketCaptureResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = etag + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_storage_location.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_storage_location.py index 773b04d22501..62ed83d592b3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_storage_location.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_storage_location.py @@ -35,8 +35,8 @@ class PacketCaptureStorageLocation(Model): 'file_path': {'key': 'filePath', 'type': 'str'}, } - def __init__(self, storage_id=None, storage_path=None, file_path=None): - super(PacketCaptureStorageLocation, self).__init__() - self.storage_id = storage_id - self.storage_path = storage_path - self.file_path = file_path + def __init__(self, **kwargs): + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) + self.file_path = kwargs.get('file_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_storage_location_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_storage_location_py3.py new file mode 100644 index 000000000000..6925dd4f9bdf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/packet_capture_storage_location_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureStorageLocation(Model): + """Describes the storage location for a packet capture session. + + :param storage_id: The ID of the storage account to save the packet + capture session. Required if no local file path is provided. + :type storage_id: str + :param storage_path: The URI of the storage path to save the packet + capture. Must be a well-formed URI describing the location to save the + packet capture. + :type storage_path: str + :param file_path: A valid local path on the targeting VM. Must include the + name of the capture file (*.cap). For linux virtual machine it must start + with /var/captures. Required if no storage ID is provided, otherwise + optional. + :type file_path: str + """ + + _attribute_map = { + 'storage_id': {'key': 'storageId', 'type': 'str'}, + 'storage_path': {'key': 'storagePath', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + } + + def __init__(self, *, storage_id: str=None, storage_path: str=None, file_path: str=None, **kwargs) -> None: + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = storage_id + self.storage_path = storage_path + self.file_path = file_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter.py index 8520337459b0..a1c6a025de49 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter.py @@ -60,12 +60,12 @@ class PatchRouteFilter(SubResource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, rules=None, peerings=None, tags=None): - super(PatchRouteFilter, self).__init__(id=id) - self.rules = rules - self.peerings = peerings + def __init__(self, **kwargs): + super(PatchRouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.peerings = kwargs.get('peerings', None) self.provisioning_state = None self.name = None self.etag = None self.type = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter_py3.py new file mode 100644 index 000000000000..4b46111615ee --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilter(SubResource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2017_06_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, rules=None, peerings=None, tags=None, **kwargs) -> None: + super(PatchRouteFilter, self).__init__(id=id, **kwargs) + self.rules = rules + self.peerings = peerings + self.provisioning_state = None + self.name = None + self.etag = None + self.type = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter_rule.py index 753d4c5db755..244927b956e9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter_rule.py @@ -18,16 +18,18 @@ class PatchRouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2017_06_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -64,11 +66,11 @@ class PatchRouteFilterRule(SubResource): route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, tags=None): - super(PatchRouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(PatchRouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None self.name = None self.etag = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter_rule_py3.py new file mode 100644 index 000000000000..3f9ae01d10d5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/patch_route_filter_rule_py3.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_06_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, tags=None, **kwargs) -> None: + super(PatchRouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = None + self.etag = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/probe.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/probe.py index 3c055cf80577..f0a255ec5ea4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/probe.py @@ -18,20 +18,22 @@ class Probe(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar load_balancing_rules: The load balancer rules that use this probe. :vartype load_balancing_rules: list[~azure.mgmt.network.v2017_06_01.models.SubResource] - :param protocol: The protocol of the end point. Possible values are: - 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the - probe to be successful. If 'Http' is specified, a 200 OK response from the - specifies URI is required for the probe to be successful. Possible values - include: 'Http', 'Tcp' + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2017_06_01.models.ProbeProtocol - :param port: The port for communicating the probe. Possible values range - from 1 to 65535, inclusive. + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. :type port: int :param interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is @@ -78,14 +80,14 @@ class Probe(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, port, id=None, interval_in_seconds=None, number_of_probes=None, request_path=None, provisioning_state=None, name=None, etag=None): - super(Probe, self).__init__(id=id) + def __init__(self, **kwargs): + super(Probe, self).__init__(**kwargs) self.load_balancing_rules = None - self.protocol = protocol - self.port = port - self.interval_in_seconds = interval_in_seconds - self.number_of_probes = number_of_probes - self.request_path = request_path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.port = kwargs.get('port', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.number_of_probes = kwargs.get('number_of_probes', None) + self.request_path = kwargs.get('request_path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/probe_py3.py new file mode 100644 index 000000000000..35f3918398fc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Probe(SubResource): + """A load balancer probe. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar load_balancing_rules: The load balancer rules that use this probe. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_06_01.models.SubResource] + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_06_01.models.ProbeProtocol + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. + :type port: int + :param interval_in_seconds: The interval, in seconds, for how frequently + to probe the endpoint for health status. Typically, the interval is + slightly less than half the allocated timeout period (in seconds) which + allows two full probes before taking the instance out of rotation. The + default value is 15, the minimum value is 5. + :type interval_in_seconds: int + :param number_of_probes: The number of probes where if no response, will + result in stopping further traffic from being delivered to the endpoint. + This values allows endpoints to be taken out of rotation faster or slower + than the typical times used in Azure. + :type number_of_probes: int + :param request_path: The URI used for requesting health status from the + VM. Path is required if a protocol is set to http. Otherwise, it is not + allowed. There is no default value. + :type request_path: str + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'load_balancing_rules': {'readonly': True}, + 'protocol': {'required': True}, + 'port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, + 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, port: int, id: str=None, interval_in_seconds: int=None, number_of_probes: int=None, request_path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Probe, self).__init__(id=id, **kwargs) + self.load_balancing_rules = None + self.protocol = protocol + self.port = port + self.interval_in_seconds = interval_in_seconds + self.number_of_probes = number_of_probes + self.request_path = request_path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address.py index 48257f481cee..136b42ddce12 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address.py @@ -88,15 +88,15 @@ class PublicIPAddress(Resource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, id=None, location=None, tags=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address=None, idle_timeout_in_minutes=None, resource_guid=None, provisioning_state=None, etag=None, zones=None): - super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags) - self.public_ip_allocation_method = public_ip_allocation_method - self.public_ip_address_version = public_ip_address_version + def __init__(self, **kwargs): + super(PublicIPAddress, self).__init__(**kwargs) + self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) + self.public_ip_address_version = kwargs.get('public_ip_address_version', None) self.ip_configuration = None - self.dns_settings = dns_settings - self.ip_address = ip_address - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag - self.zones = zones + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_address = kwargs.get('ip_address', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address_dns_settings.py index a248461f05d7..07dfe30433a6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address_dns_settings.py @@ -38,8 +38,8 @@ class PublicIPAddressDnsSettings(Model): 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, } - def __init__(self, domain_name_label=None, fqdn=None, reverse_fqdn=None): - super(PublicIPAddressDnsSettings, self).__init__() - self.domain_name_label = domain_name_label - self.fqdn = fqdn - self.reverse_fqdn = reverse_fqdn + def __init__(self, **kwargs): + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) + self.fqdn = kwargs.get('fqdn', None) + self.reverse_fqdn = kwargs.get('reverse_fqdn', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address_dns_settings_py3.py new file mode 100644 index 000000000000..e84aa9c10bf5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address_dns_settings_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressDnsSettings(Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :param domain_name_label: Gets or sets the Domain name label.The + concatenation of the domain name label and the regionalized DNS zone make + up the fully qualified domain name associated with the public IP address. + If a domain name label is specified, an A DNS record is created for the + public IP in the Microsoft Azure DNS system. + :type domain_name_label: str + :param fqdn: Gets the FQDN, Fully qualified domain name of the A DNS + record associated with the public IP. This is the concatenation of the + domainNameLabel and the regionalized DNS zone. + :type fqdn: str + :param reverse_fqdn: Gets or Sets the Reverse FQDN. A user-visible, fully + qualified domain name that resolves to this public IP address. If the + reverseFqdn is specified, then a PTR DNS record is created pointing from + the IP address in the in-addr.arpa domain to the reverse FQDN. + :type reverse_fqdn: str + """ + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, + } + + def __init__(self, *, domain_name_label: str=None, fqdn: str=None, reverse_fqdn: str=None, **kwargs) -> None: + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label + self.fqdn = fqdn + self.reverse_fqdn = reverse_fqdn diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address_py3.py new file mode 100644 index 000000000000..2dc0b3e390c3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/public_ip_address_py3.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PublicIPAddress(Resource): + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param public_ip_allocation_method: The public IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type public_ip_allocation_method: str or + ~azure.mgmt.network.v2017_06_01.models.IPAllocationMethod + :param public_ip_address_version: The public IP address version. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + :type public_ip_address_version: str or + ~azure.mgmt.network.v2017_06_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP + address. + :vartype ip_configuration: + ~azure.mgmt.network.v2017_06_01.models.IPConfiguration + :param dns_settings: The FQDN of the DNS record associated with the public + IP address. + :type dns_settings: + ~azure.mgmt.network.v2017_06_01.models.PublicIPAddressDnsSettings + :param ip_address: The IP address associated with the public IP address + resource. + :type ip_address: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param resource_guid: The resource GUID property of the public IP + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address: str=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, zones=None, **kwargs) -> None: + super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.public_ip_allocation_method = public_ip_allocation_method + self.public_ip_address_version = public_ip_address_version + self.ip_configuration = None + self.dns_settings = dns_settings + self.ip_address = ip_address + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag + self.zones = zones diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/query_troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/query_troubleshooting_parameters.py index 9b6801eb7b63..6ae1924916c6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/query_troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/query_troubleshooting_parameters.py @@ -15,7 +15,9 @@ class QueryTroubleshootingParameters(Model): """Parameters that define the resource to query the troubleshooting result. - :param target_resource_id: The target resource ID to query the + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the troubleshooting result. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class QueryTroubleshootingParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(QueryTroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/query_troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/query_troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..b5fccb87857c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/query_troubleshooting_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryTroubleshootingParameters(Model): + """Parameters that define the resource to query the troubleshooting result. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the + troubleshooting result. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource.py index ff5f1f40e14e..7dabab29ac9d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource.py @@ -43,10 +43,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, location=None, tags=None): - super(Resource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource_navigation_link.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource_navigation_link.py index 9b4484be654a..705698f513f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource_navigation_link.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource_navigation_link.py @@ -49,10 +49,10 @@ class ResourceNavigationLink(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, linked_resource_type=None, link=None, name=None): - super(ResourceNavigationLink, self).__init__(id=id) - self.linked_resource_type = linked_resource_type - self.link = link + def __init__(self, **kwargs): + super(ResourceNavigationLink, self).__init__(**kwargs) + self.linked_resource_type = kwargs.get('linked_resource_type', None) + self.link = kwargs.get('link', None) self.provisioning_state = None - self.name = name + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource_navigation_link_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource_navigation_link_py3.py new file mode 100644 index 000000000000..5cb22d347836 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource_navigation_link_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ResourceNavigationLink(SubResource): + """ResourceNavigationLink resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource + :type link: str + :ivar provisioning_state: Provisioning state of the ResourceNavigationLink + resource. + :vartype provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, linked_resource_type: str=None, link: str=None, name: str=None, **kwargs) -> None: + super(ResourceNavigationLink, self).__init__(id=id, **kwargs) + self.linked_resource_type = linked_resource_type + self.link = link + self.provisioning_state = None + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource_py3.py new file mode 100644 index 000000000000..ae95b78b4f23 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/resource_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Common resource representation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/retention_policy_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/retention_policy_parameters.py index 102f4c5c3b4c..28cb43056d47 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/retention_policy_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/retention_policy_parameters.py @@ -26,7 +26,7 @@ class RetentionPolicyParameters(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, days=0, enabled=False): - super(RetentionPolicyParameters, self).__init__() - self.days = days - self.enabled = enabled + def __init__(self, **kwargs): + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = kwargs.get('days', 0) + self.enabled = kwargs.get('enabled', False) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/retention_policy_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/retention_policy_parameters_py3.py new file mode 100644 index 000000000000..3b2ffc5e741e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/retention_policy_parameters_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RetentionPolicyParameters(Model): + """Parameters that define the retention policy for flow log. + + :param days: Number of days to retain flow log records. Default value: 0 . + :type days: int + :param enabled: Flag to enable/disable retention. Default value: False . + :type enabled: bool + """ + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, days: int=0, enabled: bool=False, **kwargs) -> None: + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = days + self.enabled = enabled diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route.py index 9299011de3b7..920b48820277 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route.py @@ -15,13 +15,15 @@ class Route(SubResource): """Route resource. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param address_prefix: The destination CIDR to which the route applies. :type address_prefix: str - :param next_hop_type: The type of Azure hop the packet should be sent to. - Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - 'VirtualAppliance', and 'None'. Possible values include: + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' :type next_hop_type: str or @@ -55,11 +57,11 @@ class Route(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, next_hop_type, id=None, address_prefix=None, next_hop_ip_address=None, provisioning_state=None, name=None, etag=None): - super(Route, self).__init__(id=id) - self.address_prefix = address_prefix - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(Route, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter.py index f9081ef1290c..2625a9bf288d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter.py @@ -62,9 +62,9 @@ class RouteFilter(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, rules=None, peerings=None): - super(RouteFilter, self).__init__(id=id, location=location, tags=tags) - self.rules = rules - self.peerings = peerings + def __init__(self, **kwargs): + super(RouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.peerings = kwargs.get('peerings', None) self.provisioning_state = None self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter_py3.py new file mode 100644 index 000000000000..72adbe875b4c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteFilter(Resource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2017_06_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, rules=None, peerings=None, **kwargs) -> None: + super(RouteFilter, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.rules = rules + self.peerings = peerings + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter_rule.py index 3e1b5b2f7914..141a2080a5c5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter_rule.py @@ -18,16 +18,18 @@ class RouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2017_06_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -66,12 +68,12 @@ class RouteFilterRule(SubResource): route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, name=None, location=None, tags=None): - super(RouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(RouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None - self.name = name - self.location = location + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) self.etag = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter_rule_py3.py new file mode 100644 index 000000000000..e587fb936f1d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_filter_rule_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class RouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_06_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param location: Resource location. + :type location: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(RouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = name + self.location = location + self.etag = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_py3.py new file mode 100644 index 000000000000..45edf398ee7c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Route(SubResource): + """Route resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param address_prefix: The destination CIDR to which the route applies. + :type address_prefix: str + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_06_01.models.RouteNextHopType + :param next_hop_ip_address: The IP address packets should be forwarded to. + Next hop values are only allowed in routes where the next hop type is + VirtualAppliance. + :type next_hop_ip_address: str + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'next_hop_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type, id: str=None, address_prefix: str=None, next_hop_ip_address: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Route, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_table.py index 9d382e24385c..416c30900355 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_table.py @@ -58,9 +58,9 @@ class RouteTable(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, routes=None, provisioning_state=None, etag=None): - super(RouteTable, self).__init__(id=id, location=location, tags=tags) - self.routes = routes + def __init__(self, **kwargs): + super(RouteTable, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) self.subnets = None - self.provisioning_state = provisioning_state - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_table_py3.py new file mode 100644 index 000000000000..1a60fa6485a6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/route_table_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteTable(Resource): + """Route table resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param routes: Collection of routes contained within a route table. + :type routes: list[~azure.mgmt.network.v2017_06_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2017_06_01.models.Subnet] + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'routes': {'key': 'properties.routes', 'type': '[Route]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, routes=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(RouteTable, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.routes = routes + self.subnets = None + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_network_interface.py index 6af1b2da6936..d8e6ac408a14 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_network_interface.py @@ -27,7 +27,7 @@ class SecurityGroupNetworkInterface(Model): 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, } - def __init__(self, id=None, security_rule_associations=None): - super(SecurityGroupNetworkInterface, self).__init__() - self.id = id - self.security_rule_associations = security_rule_associations + def __init__(self, **kwargs): + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.security_rule_associations = kwargs.get('security_rule_associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_network_interface_py3.py new file mode 100644 index 000000000000..7838fe68bb58 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_network_interface_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupNetworkInterface(Model): + """Network interface and all its associated security rules. + + :param id: ID of the network interface. + :type id: str + :param security_rule_associations: + :type security_rule_associations: + ~azure.mgmt.network.v2017_06_01.models.SecurityRuleAssociations + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, + } + + def __init__(self, *, id: str=None, security_rule_associations=None, **kwargs) -> None: + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = id + self.security_rule_associations = security_rule_associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_parameters.py index 5c0972e5d55e..1d547b0b0e2b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_parameters.py @@ -15,7 +15,9 @@ class SecurityGroupViewParameters(Model): """Parameters that define the VM to check security groups for. - :param target_resource_id: ID of the target VM. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. :type target_resource_id: str """ @@ -27,6 +29,6 @@ class SecurityGroupViewParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(SecurityGroupViewParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_parameters_py3.py new file mode 100644 index 000000000000..7ccc48017444 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_parameters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewParameters(Model): + """Parameters that define the VM to check security groups for. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_result.py index 1e32d3fa2acf..718696d7bdba 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_result.py @@ -24,6 +24,6 @@ class SecurityGroupViewResult(Model): 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, } - def __init__(self, network_interfaces=None): - super(SecurityGroupViewResult, self).__init__() - self.network_interfaces = network_interfaces + def __init__(self, **kwargs): + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_result_py3.py new file mode 100644 index 000000000000..370be0897ed1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_group_view_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewResult(Model): + """The information about security rules applied to the specified VM. + + :param network_interfaces: List of network interfaces on the specified VM. + :type network_interfaces: + list[~azure.mgmt.network.v2017_06_01.models.SecurityGroupNetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule.py index e47dba350098..8f5d75d84cd0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule.py @@ -15,12 +15,15 @@ class SecurityRule(SubResource): """Network security rule. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param description: A description for this rule. Restricted to 140 chars. :type description: str - :param protocol: Network protocol this rule applies to. Possible values - are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*' + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' :type protocol: str or ~azure.mgmt.network.v2017_06_01.models.SecurityRuleProtocol :param source_port_range: The source port or range. Integer or range @@ -49,8 +52,9 @@ class SecurityRule(SubResource): :type source_port_ranges: list[str] :param destination_port_ranges: The destination port ranges. :type destination_port_ranges: list[str] - :param access: The network traffic is allowed or denied. Possible values - are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' :type access: str or ~azure.mgmt.network.v2017_06_01.models.SecurityRuleAccess :param priority: The priority of the rule. The value can be between 100 @@ -58,10 +62,10 @@ class SecurityRule(SubResource): collection. The lower the priority number, the higher the priority of the rule. :type priority: int - :param direction: The direction of the rule. The direction specifies if - rule will be evaluated on incoming or outcoming traffic. Possible values - are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', - 'Outbound' + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2017_06_01.models.SecurityRuleDirection :param provisioning_state: The provisioning state of the public IP @@ -101,21 +105,21 @@ class SecurityRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, source_address_prefix=None, destination_address_prefix=None, access=None, direction=None, id=None, description=None, source_port_range=None, destination_port_range=None, source_address_prefixes=None, destination_address_prefixes=None, source_port_ranges=None, destination_port_ranges=None, priority=None, provisioning_state=None, name=None, etag=None): - super(SecurityRule, self).__init__(id=id) - self.description = description - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_address_prefix = source_address_prefix - self.source_address_prefixes = source_address_prefixes - self.destination_address_prefix = destination_address_prefix - self.destination_address_prefixes = destination_address_prefixes - self.source_port_ranges = source_port_ranges - self.destination_port_ranges = destination_port_ranges - self.access = access - self.priority = priority - self.direction = direction - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(SecurityRule, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule_associations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule_associations.py index 4caad0293abe..4aec85465f7b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule_associations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule_associations.py @@ -37,9 +37,9 @@ class SecurityRuleAssociations(Model): 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, } - def __init__(self, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None): - super(SecurityRuleAssociations, self).__init__() - self.network_interface_association = network_interface_association - self.subnet_association = subnet_association - self.default_security_rules = default_security_rules - self.effective_security_rules = effective_security_rules + def __init__(self, **kwargs): + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = kwargs.get('network_interface_association', None) + self.subnet_association = kwargs.get('subnet_association', None) + self.default_security_rules = kwargs.get('default_security_rules', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule_associations_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule_associations_py3.py new file mode 100644 index 000000000000..76af430aec7a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule_associations_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityRuleAssociations(Model): + """All security rules associated with the network interface. + + :param network_interface_association: + :type network_interface_association: + ~azure.mgmt.network.v2017_06_01.models.NetworkInterfaceAssociation + :param subnet_association: + :type subnet_association: + ~azure.mgmt.network.v2017_06_01.models.SubnetAssociation + :param default_security_rules: Collection of default security rules of the + network security group. + :type default_security_rules: + list[~azure.mgmt.network.v2017_06_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2017_06_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, + 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, + 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__(self, *, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None, **kwargs) -> None: + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = network_interface_association + self.subnet_association = subnet_association + self.default_security_rules = default_security_rules + self.effective_security_rules = effective_security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule_py3.py new file mode 100644 index 000000000000..1aa90dc2baa8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/security_rule_py3.py @@ -0,0 +1,125 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class SecurityRule(SubResource): + """Network security rule. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2017_06_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. Integer or range + between 0 and 65535. Asterix '*' can also be used to match all ports. + :type source_port_range: str + :param destination_port_range: The destination port or range. Integer or + range between 0 and 65535. Asterix '*' can also be used to match all + ports. + :type destination_port_range: str + :param source_address_prefix: The CIDR or source IP range. Asterix '*' can + also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + this is an ingress rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param source_address_prefixes: The CIDR or source IP ranges. + :type source_address_prefixes: list[str] + :param destination_address_prefix: The destination address prefix. CIDR or + destination IP range. Asterix '*' can also be used to match all source + IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. + :type destination_address_prefix: str + :param destination_address_prefixes: The destination address prefixes. + CIDR or destination IP ranges. + :type destination_address_prefixes: list[str] + :param source_port_ranges: The source port ranges. + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. + :type destination_port_ranges: list[str] + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' + :type access: str or + ~azure.mgmt.network.v2017_06_01.models.SecurityRuleAccess + :param priority: The priority of the rule. The value can be between 100 + and 4096. The priority number must be unique for each rule in the + collection. The lower the priority number, the higher the priority of the + rule. + :type priority: int + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2017_06_01.models.SecurityRuleDirection + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'access': {'required': True}, + 'direction': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'properties.sourceAddressPrefixes', 'type': '[str]'}, + 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, + 'destination_address_prefixes': {'key': 'properties.destinationAddressPrefixes', 'type': '[str]'}, + 'source_port_ranges': {'key': 'properties.sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'properties.destinationPortRanges', 'type': '[str]'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, access, direction, id: str=None, description: str=None, source_port_range: str=None, destination_port_range: str=None, source_address_prefix: str=None, source_address_prefixes=None, destination_address_prefix: str=None, destination_address_prefixes=None, source_port_ranges=None, destination_port_ranges=None, priority: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(SecurityRule, self).__init__(id=id, **kwargs) + self.description = description + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.source_address_prefixes = source_address_prefixes + self.destination_address_prefix = destination_address_prefix + self.destination_address_prefixes = destination_address_prefixes + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/service_endpoint_properties_format.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/service_endpoint_properties_format.py index 847cb9ac8b3b..87ca01e64540 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/service_endpoint_properties_format.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/service_endpoint_properties_format.py @@ -29,8 +29,8 @@ class ServiceEndpointPropertiesFormat(Model): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } - def __init__(self, service=None, locations=None, provisioning_state=None): - super(ServiceEndpointPropertiesFormat, self).__init__() - self.service = service - self.locations = locations - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = kwargs.get('service', None) + self.locations = kwargs.get('locations', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/service_endpoint_properties_format_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/service_endpoint_properties_format_py3.py new file mode 100644 index 000000000000..8d3d2e5e8347 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/service_endpoint_properties_format_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceEndpointPropertiesFormat(Model): + """The service endpoint properties. + + :param service: The type of the endpoint service. + :type service: str + :param locations: A list of locations. + :type locations: list[str] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + """ + + _attribute_map = { + 'service': {'key': 'service', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, service: str=None, locations=None, provisioning_state: str=None, **kwargs) -> None: + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = service + self.locations = locations + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/sub_resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/sub_resource.py index 491f1d1caf83..6ab81f55f21b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/sub_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/sub_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/sub_resource_py3.py new file mode 100644 index 000000000000..8f4c4c816061 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """Reference to another subresource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet.py index ba4f8f4691de..88d370718184 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet.py @@ -66,14 +66,14 @@ class Subnet(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, address_prefix=None, network_security_group=None, route_table=None, service_endpoints=None, resource_navigation_links=None, provisioning_state=None, name=None, etag=None): - super(Subnet, self).__init__(id=id) - self.address_prefix = address_prefix - self.network_security_group = network_security_group - self.route_table = route_table - self.service_endpoints = service_endpoints + def __init__(self, **kwargs): + super(Subnet, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.route_table = kwargs.get('route_table', None) + self.service_endpoints = kwargs.get('service_endpoints', None) self.ip_configurations = None - self.resource_navigation_links = resource_navigation_links - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.resource_navigation_links = kwargs.get('resource_navigation_links', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet_association.py index f1180c50800e..7cfd57a198d6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet_association.py @@ -34,7 +34,7 @@ class SubnetAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(SubnetAssociation, self).__init__() + def __init__(self, **kwargs): + super(SubnetAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet_association_py3.py new file mode 100644 index 000000000000..46d1606e71b4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Subnet ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2017_06_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(SubnetAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet_py3.py new file mode 100644 index 000000000000..2b1b68b44faa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/subnet_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Subnet(SubResource): + """Subnet in a virtual network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param address_prefix: The address prefix for the subnet. + :type address_prefix: str + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2017_06_01.models.NetworkSecurityGroup + :param route_table: The reference of the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2017_06_01.models.RouteTable + :param service_endpoints: An array of service endpoints. + :type service_endpoints: + list[~azure.mgmt.network.v2017_06_01.models.ServiceEndpointPropertiesFormat] + :ivar ip_configurations: Gets an array of references to the network + interface IP configurations using subnet. + :vartype ip_configurations: + list[~azure.mgmt.network.v2017_06_01.models.IPConfiguration] + :param resource_navigation_links: Gets an array of references to the + external resources using subnet. + :type resource_navigation_links: + list[~azure.mgmt.network.v2017_06_01.models.ResourceNavigationLink] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'ip_configurations': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, + 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, address_prefix: str=None, network_security_group=None, route_table=None, service_endpoints=None, resource_navigation_links=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Subnet, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.network_security_group = network_security_group + self.route_table = route_table + self.service_endpoints = service_endpoints + self.ip_configurations = None + self.resource_navigation_links = resource_navigation_links + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology.py index 8aa831c6dffc..b6f97f1f6ab2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology.py @@ -43,9 +43,9 @@ class Topology(Model): 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, } - def __init__(self, resources=None): - super(Topology, self).__init__() + def __init__(self, **kwargs): + super(Topology, self).__init__(**kwargs) self.id = None self.created_date_time = None self.last_modified = None - self.resources = resources + self.resources = kwargs.get('resources', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_association.py index 7e4c2d71194f..074940c90aee 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_association.py @@ -33,8 +33,8 @@ class TopologyAssociation(Model): 'association_type': {'key': 'associationType', 'type': 'str'}, } - def __init__(self, name=None, resource_id=None, association_type=None): - super(TopologyAssociation, self).__init__() - self.name = name - self.resource_id = resource_id - self.association_type = association_type + def __init__(self, **kwargs): + super(TopologyAssociation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.resource_id = kwargs.get('resource_id', None) + self.association_type = kwargs.get('association_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_association_py3.py new file mode 100644 index 000000000000..55bfb4462896 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyAssociation(Model): + """Resources that have an association with the parent resource. + + :param name: The name of the resource that is associated with the parent + resource. + :type name: str + :param resource_id: The ID of the resource that is associated with the + parent resource. + :type resource_id: str + :param association_type: The association type of the child resource to the + parent resource. Possible values include: 'Associated', 'Contains' + :type association_type: str or + ~azure.mgmt.network.v2017_06_01.models.AssociationType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'association_type': {'key': 'associationType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, resource_id: str=None, association_type=None, **kwargs) -> None: + super(TopologyAssociation, self).__init__(**kwargs) + self.name = name + self.resource_id = resource_id + self.association_type = association_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_parameters.py index 04920dc9665d..c7065ef57c09 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_parameters.py @@ -15,8 +15,10 @@ class TopologyParameters(Model): """Parameters that define the representation of topology. - :param target_resource_group_name: The name of the target resource group - to perform topology on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_group_name: Required. The name of the target + resource group to perform topology on. :type target_resource_group_name: str """ @@ -28,6 +30,6 @@ class TopologyParameters(Model): 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, } - def __init__(self, target_resource_group_name): - super(TopologyParameters, self).__init__() - self.target_resource_group_name = target_resource_group_name + def __init__(self, **kwargs): + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = kwargs.get('target_resource_group_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_parameters_py3.py new file mode 100644 index 000000000000..90c2365d8dba --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyParameters(Model): + """Parameters that define the representation of topology. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group_name: Required. The name of the target + resource group to perform topology on. + :type target_resource_group_name: str + """ + + _validation = { + 'target_resource_group_name': {'required': True}, + } + + _attribute_map = { + 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, + } + + def __init__(self, *, target_resource_group_name: str, **kwargs) -> None: + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = target_resource_group_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_py3.py new file mode 100644 index 000000000000..8dfc6ee0567d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Topology(Model): + """Topology of the specified resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: GUID representing the operation id. + :vartype id: str + :ivar created_date_time: The datetime when the topology was initially + created for the resource group. + :vartype created_date_time: datetime + :ivar last_modified: The datetime when the topology was last modified. + :vartype last_modified: datetime + :param resources: + :type resources: + list[~azure.mgmt.network.v2017_06_01.models.TopologyResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, + } + + def __init__(self, *, resources=None, **kwargs) -> None: + super(Topology, self).__init__(**kwargs) + self.id = None + self.created_date_time = None + self.last_modified = None + self.resources = resources diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_resource.py index bf8b863a622c..a35025d3fc1b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_resource.py @@ -34,9 +34,9 @@ class TopologyResource(Model): 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, } - def __init__(self, name=None, id=None, location=None, associations=None): - super(TopologyResource, self).__init__() - self.name = name - self.id = id - self.location = location - self.associations = associations + def __init__(self, **kwargs): + super(TopologyResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.associations = kwargs.get('associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_resource_py3.py new file mode 100644 index 000000000000..1920f223acbc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/topology_resource_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyResource(Model): + """The network resource topology information for the given resource group. + + :param name: Name of the resource. + :type name: str + :param id: ID of the resource. + :type id: str + :param location: Resource location. + :type location: str + :param associations: Holds the associations the resource has with other + resources in the resource group. + :type associations: + list[~azure.mgmt.network.v2017_06_01.models.TopologyAssociation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, + } + + def __init__(self, *, name: str=None, id: str=None, location: str=None, associations=None, **kwargs) -> None: + super(TopologyResource, self).__init__(**kwargs) + self.name = name + self.id = id + self.location = location + self.associations = associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_details.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_details.py index eaacbd32f814..6275054e469b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_details.py @@ -36,10 +36,10 @@ class TroubleshootingDetails(Model): 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, } - def __init__(self, id=None, reason_type=None, summary=None, detail=None, recommended_actions=None): - super(TroubleshootingDetails, self).__init__() - self.id = id - self.reason_type = reason_type - self.summary = summary - self.detail = detail - self.recommended_actions = recommended_actions + def __init__(self, **kwargs): + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.reason_type = kwargs.get('reason_type', None) + self.summary = kwargs.get('summary', None) + self.detail = kwargs.get('detail', None) + self.recommended_actions = kwargs.get('recommended_actions', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_details_py3.py new file mode 100644 index 000000000000..e5e7042e575c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_details_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingDetails(Model): + """Information gained from troubleshooting of specified resource. + + :param id: The id of the get troubleshoot operation. + :type id: str + :param reason_type: Reason type of failure. + :type reason_type: str + :param summary: A summary of troubleshooting. + :type summary: str + :param detail: Details on troubleshooting results. + :type detail: str + :param recommended_actions: List of recommended actions. + :type recommended_actions: + list[~azure.mgmt.network.v2017_06_01.models.TroubleshootingRecommendedActions] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'reason_type': {'key': 'reasonType', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'detail': {'key': 'detail', 'type': 'str'}, + 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, + } + + def __init__(self, *, id: str=None, reason_type: str=None, summary: str=None, detail: str=None, recommended_actions=None, **kwargs) -> None: + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = id + self.reason_type = reason_type + self.summary = summary + self.detail = detail + self.recommended_actions = recommended_actions diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_parameters.py index c4833fb8eeb3..6b11d3eb5ffc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_parameters.py @@ -15,13 +15,15 @@ class TroubleshootingParameters(Model): """Parameters that define the resource to troubleshoot. - :param target_resource_id: The target resource to troubleshoot. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. :type target_resource_id: str - :param storage_id: The ID for the storage account to save the troubleshoot - result. + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. :type storage_id: str - :param storage_path: The path to the blob to save the troubleshoot result - in. + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. :type storage_path: str """ @@ -37,8 +39,8 @@ class TroubleshootingParameters(Model): 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, } - def __init__(self, target_resource_id, storage_id, storage_path): - super(TroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.storage_path = storage_path + def __init__(self, **kwargs): + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..e010b7bdc9de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_parameters_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingParameters(Model): + """Parameters that define the resource to troubleshoot. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. + :type target_resource_id: str + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. + :type storage_id: str + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. + :type storage_path: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'storage_path': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, storage_path: str, **kwargs) -> None: + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.storage_path = storage_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_recommended_actions.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_recommended_actions.py index cbc5e31177c7..be395be4ad54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_recommended_actions.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_recommended_actions.py @@ -34,9 +34,9 @@ class TroubleshootingRecommendedActions(Model): 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, } - def __init__(self, action_id=None, action_text=None, action_uri=None, action_uri_text=None): - super(TroubleshootingRecommendedActions, self).__init__() - self.action_id = action_id - self.action_text = action_text - self.action_uri = action_uri - self.action_uri_text = action_uri_text + def __init__(self, **kwargs): + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = kwargs.get('action_id', None) + self.action_text = kwargs.get('action_text', None) + self.action_uri = kwargs.get('action_uri', None) + self.action_uri_text = kwargs.get('action_uri_text', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_recommended_actions_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_recommended_actions_py3.py new file mode 100644 index 000000000000..05c3f654353b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_recommended_actions_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingRecommendedActions(Model): + """Recommended actions based on discovered issues. + + :param action_id: ID of the recommended action. + :type action_id: str + :param action_text: Description of recommended actions. + :type action_text: str + :param action_uri: The uri linking to a documentation for the recommended + troubleshooting actions. + :type action_uri: str + :param action_uri_text: The information from the URI for the recommended + troubleshooting actions. + :type action_uri_text: str + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'action_text': {'key': 'actionText', 'type': 'str'}, + 'action_uri': {'key': 'actionUri', 'type': 'str'}, + 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, + } + + def __init__(self, *, action_id: str=None, action_text: str=None, action_uri: str=None, action_uri_text: str=None, **kwargs) -> None: + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = action_id + self.action_text = action_text + self.action_uri = action_uri + self.action_uri_text = action_uri_text diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_result.py index 828d6bc4bace..76296cba6295 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_result.py @@ -33,9 +33,9 @@ class TroubleshootingResult(Model): 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, } - def __init__(self, start_time=None, end_time=None, code=None, results=None): - super(TroubleshootingResult, self).__init__() - self.start_time = start_time - self.end_time = end_time - self.code = code - self.results = results + def __init__(self, **kwargs): + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.code = kwargs.get('code', None) + self.results = kwargs.get('results', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_result_py3.py new file mode 100644 index 000000000000..ade46872c271 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/troubleshooting_result_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingResult(Model): + """Troubleshooting information gained from specified resource. + + :param start_time: The start time of the troubleshooting. + :type start_time: datetime + :param end_time: The end time of the troubleshooting. + :type end_time: datetime + :param code: The result code of the troubleshooting. + :type code: str + :param results: Information from troubleshooting. + :type results: + list[~azure.mgmt.network.v2017_06_01.models.TroubleshootingDetails] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, + } + + def __init__(self, *, start_time=None, end_time=None, code: str=None, results=None, **kwargs) -> None: + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.code = code + self.results = results diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/tunnel_connection_health.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/tunnel_connection_health.py index eee04fd93565..030fe5cb3a66 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/tunnel_connection_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/tunnel_connection_health.py @@ -52,8 +52,8 @@ class TunnelConnectionHealth(Model): 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, } - def __init__(self): - super(TunnelConnectionHealth, self).__init__() + def __init__(self, **kwargs): + super(TunnelConnectionHealth, self).__init__(**kwargs) self.tunnel = None self.connection_status = None self.ingress_bytes_transferred = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/tunnel_connection_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/tunnel_connection_health_py3.py new file mode 100644 index 000000000000..d757727b91ae --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/tunnel_connection_health_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TunnelConnectionHealth(Model): + """VirtualNetworkGatewayConnection properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tunnel: Tunnel name. + :vartype tunnel: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values include: 'Unknown', 'Connecting', 'Connected', + 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnectionStatus + :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this + connection + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: The Egress Bytes Transferred in this + connection + :vartype egress_bytes_transferred: long + :ivar last_connection_established_utc_time: The time at which connection + was established in Utc format. + :vartype last_connection_established_utc_time: str + """ + + _validation = { + 'tunnel': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'last_connection_established_utc_time': {'readonly': True}, + } + + _attribute_map = { + 'tunnel': {'key': 'tunnel', 'type': 'str'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TunnelConnectionHealth, self).__init__(**kwargs) + self.tunnel = None + self.connection_status = None + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.last_connection_established_utc_time = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage.py index 66dd45e002c0..c0264bd36a8e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage.py @@ -18,14 +18,16 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar unit: An enum describing the unit of measurement. Default value: - "Count" . + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . :vartype unit: str - :param current_value: The current value of the usage. + :param current_value: Required. The current value of the usage. :type current_value: long - :param limit: The limit of usage. + :param limit: Required. The limit of usage. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.network.v2017_06_01.models.UsageName """ @@ -45,8 +47,8 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() - self.current_value = current_value - self.limit = limit - self.name = name + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage_name.py index df7f344bfb9b..bd1813944fdc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage_name_py3.py new file mode 100644 index 000000000000..4e5e3e10de15 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage_py3.py new file mode 100644 index 000000000000..4011c9404379 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/usage_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes network resource usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . + :vartype unit: str + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.network.v2017_06_01.models.UsageName + """ + + _validation = { + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_parameters.py index 64701eea9146..2af27d95ec62 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_parameters.py @@ -15,28 +15,30 @@ class VerificationIPFlowParameters(Model): """Parameters that define the IP flow to be verified. - :param target_resource_id: The ID of the target resource to perform - next-hop on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. :type target_resource_id: str - :param direction: The direction of the packet represented as a 5-tuple. - Possible values include: 'Inbound', 'Outbound' + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2017_06_01.models.Direction - :param protocol: Protocol to be verified on. Possible values include: - 'TCP', 'UDP' + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' :type protocol: str or ~azure.mgmt.network.v2017_06_01.models.Protocol - :param local_port: The local port. Acceptable values are a single integer - in the range (0-65535). Support for * for the source port, which depends - on the direction. + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type local_port: str - :param remote_port: The remote port. Acceptable values are a single - integer in the range (0-65535). Support for * for the source port, which - depends on the direction. + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type remote_port: str - :param local_ip_address: The local IP address. Acceptable values are valid - IPv4 addresses. + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. :type local_ip_address: str - :param remote_ip_address: The remote IP address. Acceptable values are - valid IPv4 addresses. + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. :type remote_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be @@ -65,13 +67,13 @@ class VerificationIPFlowParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, direction, protocol, local_port, remote_port, local_ip_address, remote_ip_address, target_nic_resource_id=None): - super(VerificationIPFlowParameters, self).__init__() - self.target_resource_id = target_resource_id - self.direction = direction - self.protocol = protocol - self.local_port = local_port - self.remote_port = remote_port - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.direction = kwargs.get('direction', None) + self.protocol = kwargs.get('protocol', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_parameters_py3.py new file mode 100644 index 000000000000..24f1ea4540e3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_parameters_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowParameters(Model): + """Parameters that define the IP flow to be verified. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. + :type target_resource_id: str + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' + :type direction: str or ~azure.mgmt.network.v2017_06_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' + :type protocol: str or ~azure.mgmt.network.v2017_06_01.models.Protocol + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type local_port: str + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type remote_port: str + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. + :type local_ip_address: str + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. + :type remote_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of them, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'local_port': {'required': True}, + 'remote_port': {'required': True}, + 'local_ip_address': {'required': True}, + 'remote_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, direction, protocol, local_port: str, remote_port: str, local_ip_address: str, remote_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.direction = direction + self.protocol = protocol + self.local_port = local_port + self.remote_port = remote_port + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_result.py index 55a7a12608f8..f66fb9b496ce 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_result.py @@ -28,7 +28,7 @@ class VerificationIPFlowResult(Model): 'rule_name': {'key': 'ruleName', 'type': 'str'}, } - def __init__(self, access=None, rule_name=None): - super(VerificationIPFlowResult, self).__init__() - self.access = access - self.rule_name = rule_name + def __init__(self, **kwargs): + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.rule_name = kwargs.get('rule_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_result_py3.py new file mode 100644 index 000000000000..285abf7970ef --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/verification_ip_flow_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowResult(Model): + """Results of IP flow verification on the target resource. + + :param access: Indicates whether the traffic is allowed or denied. + Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_06_01.models.Access + :param rule_name: Name of the rule. If input is not matched against any + security rule, it is not displayed. + :type rule_name: str + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + } + + def __init__(self, *, access=None, rule_name: str=None, **kwargs) -> None: + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = access + self.rule_name = rule_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network.py index f48b3ef3585a..4fac79775d2e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network.py @@ -70,12 +70,12 @@ class VirtualNetwork(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid=None, provisioning_state=None, etag=None): - super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags) - self.address_space = address_space - self.dhcp_options = dhcp_options - self.subnets = subnets - self.virtual_network_peerings = virtual_network_peerings - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetwork, self).__init__(**kwargs) + self.address_space = kwargs.get('address_space', None) + self.dhcp_options = kwargs.get('dhcp_options', None) + self.subnets = kwargs.get('subnets', None) + self.virtual_network_peerings = kwargs.get('virtual_network_peerings', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_connection_gateway_reference.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_connection_gateway_reference.py index eb18a3c124ff..aa10101778f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_connection_gateway_reference.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_connection_gateway_reference.py @@ -15,8 +15,10 @@ class VirtualNetworkConnectionGatewayReference(Model): """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. - :param id: The ID of VirtualNetworkGateway or LocalNetworkGateway - resource. + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or + LocalNetworkGateway resource. :type id: str """ @@ -28,6 +30,6 @@ class VirtualNetworkConnectionGatewayReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id): - super(VirtualNetworkConnectionGatewayReference, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_connection_gateway_reference_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_connection_gateway_reference_py3.py new file mode 100644 index 000000000000..b2d9734baf3c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_connection_gateway_reference_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkConnectionGatewayReference(Model): + """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or + LocalNetworkGateway resource. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway.py index 8828dba1c2be..d73fc4f37c18 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway.py @@ -98,17 +98,17 @@ class VirtualNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp=None, active_active=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid=None, etag=None): - super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.ip_configurations = ip_configurations - self.gateway_type = gateway_type - self.vpn_type = vpn_type - self.enable_bgp = enable_bgp - self.active_active = active_active - self.gateway_default_site = gateway_default_site - self.sku = sku - self.vpn_client_configuration = vpn_client_configuration - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(VirtualNetworkGateway, self).__init__(**kwargs) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.gateway_type = kwargs.get('gateway_type', None) + self.vpn_type = kwargs.get('vpn_type', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.active_active = kwargs.get('active_active', None) + self.gateway_default_site = kwargs.get('gateway_default_site', None) + self.sku = kwargs.get('sku', None) + self.vpn_client_configuration = kwargs.get('vpn_client_configuration', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection.py index 93d0315441ab..f4b31d9c096c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayConnection(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -30,8 +32,8 @@ class VirtualNetworkGatewayConnection(Resource): :type tags: dict[str, str] :param authorization_key: The authorizationKey. :type authorization_key: str - :param virtual_network_gateway1: The reference to virtual network gateway - resource. + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. :type virtual_network_gateway1: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway :param virtual_network_gateway2: The reference to virtual network gateway @@ -42,8 +44,8 @@ class VirtualNetworkGatewayConnection(Resource): resource. :type local_network_gateway2: ~azure.mgmt.network.v2017_06_01.models.LocalNetworkGateway - :param connection_type: Gateway connection type. Possible values are: - 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' :type connection_type: str or ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnectionType @@ -128,23 +130,23 @@ class VirtualNetworkGatewayConnection(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, virtual_network_gateway1, connection_type, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight=None, shared_key=None, peer=None, enable_bgp=None, use_policy_based_traffic_selectors=None, ipsec_policies=None, resource_guid=None, etag=None): - super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnection, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) self.connection_status = None self.tunnel_connection_status = None self.egress_bytes_transferred = None self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors - self.ipsec_policies = ipsec_policies - self.resource_guid = resource_guid + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection_list_entity.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection_list_entity.py index e5dc7d0ed268..4caa91d0de79 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection_list_entity.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection_list_entity.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -30,8 +32,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): :type tags: dict[str, str] :param authorization_key: The authorizationKey. :type authorization_key: str - :param virtual_network_gateway1: The reference to virtual network gateway - resource. + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. :type virtual_network_gateway1: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkConnectionGatewayReference :param virtual_network_gateway2: The reference to virtual network gateway @@ -42,8 +44,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): resource. :type local_network_gateway2: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkConnectionGatewayReference - :param connection_type: Gateway connection type. Possible values are: - 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' :type connection_type: str or ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnectionType @@ -128,23 +130,23 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, virtual_network_gateway1, connection_type, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight=None, shared_key=None, peer=None, enable_bgp=None, use_policy_based_traffic_selectors=None, ipsec_policies=None, resource_guid=None, etag=None): - super(VirtualNetworkGatewayConnectionListEntity, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) self.connection_status = None self.tunnel_connection_status = None self.egress_bytes_transferred = None self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors - self.ipsec_policies = ipsec_policies - self.resource_guid = resource_guid + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection_list_entity_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection_list_entity_py3.py new file mode 100644 index 000000000000..9e56e5860ab2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection_list_entity_py3.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnectionListEntity(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkConnectionGatewayReference + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkConnectionGatewayReference + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkConnectionGatewayReference + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2017_06_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2017_06_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, use_policy_based_traffic_selectors: bool=None, ipsec_policies=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection_py3.py new file mode 100644 index 000000000000..691105aa8845 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_connection_py3.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnection(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2017_06_01.models.LocalNetworkGateway + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2017_06_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2017_06_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, use_policy_based_traffic_selectors: bool=None, ipsec_policies=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_ip_configuration.py index 2e1c534a1617..96fdc0bec279 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_ip_configuration.py @@ -55,11 +55,11 @@ class VirtualNetworkGatewayIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name=None, etag=None): - super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id) - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address + def __init__(self, **kwargs): + super(VirtualNetworkGatewayIPConfiguration, self).__init__(**kwargs) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..7baa515070de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_ip_configuration_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_06_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_06_01.models.SubResource + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :ivar provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_py3.py new file mode 100644 index 000000000000..4a6837b98462 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_py3.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param ip_configurations: IP configurations for virtual network gateway. + :type ip_configurations: + list[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible + values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', + 'ExpressRoute' + :type gateway_type: str or + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayType + :param vpn_type: The type of this virtual network gateway. Possible values + are: 'PolicyBased' and 'RouteBased'. Possible values include: + 'PolicyBased', 'RouteBased' + :type vpn_type: str or ~azure.mgmt.network.v2017_06_01.models.VpnType + :param enable_bgp: Whether BGP is enabled for this virtual network gateway + or not. + :type enable_bgp: bool + :param active_active: ActiveActive flag + :type active_active: bool + :param gateway_default_site: The reference of the LocalNetworkGateway + resource which represents local network site having default routes. Assign + Null value in case of removing existing default site setting. + :type gateway_default_site: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param sku: The reference of the VirtualNetworkGatewaySku resource which + represents the SKU selected for Virtual network gateway. + :type sku: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewaySku + :param vpn_client_configuration: The reference of the + VpnClientConfiguration resource which represents the P2S VpnClient + configurations. + :type vpn_client_configuration: + ~azure.mgmt.network.v2017_06_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2017_06_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + VirtualNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGateway resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, + 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, + 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'active_active': {'key': 'properties.activeActive', 'type': 'bool'}, + 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, + 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, + 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp: bool=None, active_active: bool=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.ip_configurations = ip_configurations + self.gateway_type = gateway_type + self.vpn_type = vpn_type + self.enable_bgp = enable_bgp + self.active_active = active_active + self.gateway_default_site = gateway_default_site + self.sku = sku + self.vpn_client_configuration = vpn_client_configuration + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_sku.py index 1499a91c9c49..197f6f3fae55 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_sku.py @@ -35,8 +35,8 @@ class VirtualNetworkGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(VirtualNetworkGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_sku_py3.py new file mode 100644 index 000000000000..5725d2b04299 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_gateway_sku_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkGatewaySku(Model): + """VirtualNetworkGatewaySku details. + + :param name: Gateway SKU name. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type name: str or + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewaySkuName + :param tier: Gateway SKU tier. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type tier: str or + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewaySkuTier + :param capacity: The capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_peering.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_peering.py index 760f0855d590..6a3b4b971911 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_peering.py @@ -65,14 +65,14 @@ class VirtualNetworkPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, allow_virtual_network_access=None, allow_forwarded_traffic=None, allow_gateway_transit=None, use_remote_gateways=None, remote_virtual_network=None, peering_state=None, provisioning_state=None, name=None, etag=None): - super(VirtualNetworkPeering, self).__init__(id=id) - self.allow_virtual_network_access = allow_virtual_network_access - self.allow_forwarded_traffic = allow_forwarded_traffic - self.allow_gateway_transit = allow_gateway_transit - self.use_remote_gateways = use_remote_gateways - self.remote_virtual_network = remote_virtual_network - self.peering_state = peering_state - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetworkPeering, self).__init__(**kwargs) + self.allow_virtual_network_access = kwargs.get('allow_virtual_network_access', None) + self.allow_forwarded_traffic = kwargs.get('allow_forwarded_traffic', None) + self.allow_gateway_transit = kwargs.get('allow_gateway_transit', None) + self.use_remote_gateways = kwargs.get('use_remote_gateways', None) + self.remote_virtual_network = kwargs.get('remote_virtual_network', None) + self.peering_state = kwargs.get('peering_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_peering_py3.py new file mode 100644 index 000000000000..7dc2ae603e40 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_peering_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkPeering(SubResource): + """Peerings in a virtual network resource. + + :param id: Resource ID. + :type id: str + :param allow_virtual_network_access: Whether the VMs in the linked virtual + network space would be able to access all the VMs in local Virtual network + space. + :type allow_virtual_network_access: bool + :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs + in the remote virtual network will be allowed/disallowed. + :type allow_forwarded_traffic: bool + :param allow_gateway_transit: If gateway links can be used in remote + virtual networking to link to this virtual network. + :type allow_gateway_transit: bool + :param use_remote_gateways: If remote gateways can be used on this virtual + network. If the flag is set to true, and allowGatewayTransit on remote + peering is also true, virtual network will use gateways of remote virtual + network for transit. Only one peering can have this flag set to true. This + flag cannot be set if virtual network already has a gateway. + :type use_remote_gateways: bool + :param remote_virtual_network: The reference of the remote virtual + network. + :type remote_virtual_network: + ~azure.mgmt.network.v2017_06_01.models.SubResource + :param peering_state: The status of the virtual network peering. Possible + values are 'Initiated', 'Connected', and 'Disconnected'. Possible values + include: 'Initiated', 'Connected', 'Disconnected' + :type peering_state: str or + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkPeeringState + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, + 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, + 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, + 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, allow_virtual_network_access: bool=None, allow_forwarded_traffic: bool=None, allow_gateway_transit: bool=None, use_remote_gateways: bool=None, remote_virtual_network=None, peering_state=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkPeering, self).__init__(id=id, **kwargs) + self.allow_virtual_network_access = allow_virtual_network_access + self.allow_forwarded_traffic = allow_forwarded_traffic + self.allow_gateway_transit = allow_gateway_transit + self.use_remote_gateways = use_remote_gateways + self.remote_virtual_network = remote_virtual_network + self.peering_state = peering_state + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_py3.py new file mode 100644 index 000000000000..bd2b6f87f8bc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetwork(Resource): + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param address_space: The AddressSpace that contains an array of IP + address ranges that can be used by subnets. + :type address_space: ~azure.mgmt.network.v2017_06_01.models.AddressSpace + :param dhcp_options: The dhcpOptions that contains an array of DNS servers + available to VMs deployed in the virtual network. + :type dhcp_options: ~azure.mgmt.network.v2017_06_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2017_06_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkPeering] + :param resource_guid: The resourceGuid property of the Virtual Network + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.address_space = address_space + self.dhcp_options = dhcp_options + self.subnets = subnets + self.virtual_network_peerings = virtual_network_peerings + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage.py index 27c5bd4dc8b7..3c01c2f85249 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage.py @@ -47,8 +47,8 @@ class VirtualNetworkUsage(Model): 'unit': {'key': 'unit', 'type': 'str'}, } - def __init__(self): - super(VirtualNetworkUsage, self).__init__() + def __init__(self, **kwargs): + super(VirtualNetworkUsage, self).__init__(**kwargs) self.current_value = None self.id = None self.limit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage_name.py index 01fcbf0875eb..607ccec3b964 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage_name.py @@ -34,7 +34,7 @@ class VirtualNetworkUsageName(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self): - super(VirtualNetworkUsageName, self).__init__() + def __init__(self, **kwargs): + super(VirtualNetworkUsageName, self).__init__(**kwargs) self.localized_value = None self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage_name_py3.py new file mode 100644 index 000000000000..1651ebda7e77 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage_name_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsageName(Model): + """Usage strings container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar localized_value: Localized subnet size and usage string. + :vartype localized_value: str + :ivar value: Subnet size and usage string. + :vartype value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsageName, self).__init__(**kwargs) + self.localized_value = None + self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage_py3.py new file mode 100644 index 000000000000..65f9da73779c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/virtual_network_usage_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsage(Model): + """Usage details for subnet. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar current_value: Indicates number of IPs used from the Subnet. + :vartype current_value: float + :ivar id: Subnet identifier. + :vartype id: str + :ivar limit: Indicates the size of the subnet. + :vartype limit: float + :ivar name: The name containing common and localized value for usage. + :vartype name: + ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkUsageName + :ivar unit: Usage units. Returns 'Count' + :vartype unit: str + """ + + _validation = { + 'current_value': {'readonly': True}, + 'id': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'name': {'key': 'name', 'type': 'VirtualNetworkUsageName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsage, self).__init__(**kwargs) + self.current_value = None + self.id = None + self.limit = None + self.name = None + self.unit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_configuration.py index d901a9fd0733..b562036c231b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_configuration.py @@ -48,11 +48,11 @@ class VpnClientConfiguration(Model): 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, } - def __init__(self, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, vpn_client_protocols=None, radius_server_address=None, radius_server_secret=None): - super(VpnClientConfiguration, self).__init__() - self.vpn_client_address_pool = vpn_client_address_pool - self.vpn_client_root_certificates = vpn_client_root_certificates - self.vpn_client_revoked_certificates = vpn_client_revoked_certificates - self.vpn_client_protocols = vpn_client_protocols - self.radius_server_address = radius_server_address - self.radius_server_secret = radius_server_secret + def __init__(self, **kwargs): + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = kwargs.get('vpn_client_address_pool', None) + self.vpn_client_root_certificates = kwargs.get('vpn_client_root_certificates', None) + self.vpn_client_revoked_certificates = kwargs.get('vpn_client_revoked_certificates', None) + self.vpn_client_protocols = kwargs.get('vpn_client_protocols', None) + self.radius_server_address = kwargs.get('radius_server_address', None) + self.radius_server_secret = kwargs.get('radius_server_secret', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_configuration_py3.py new file mode 100644 index 000000000000..0db069c2dbd5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_configuration_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientConfiguration(Model): + """VpnClientConfiguration for P2S client. + + :param vpn_client_address_pool: The reference of the address space + resource which represents Address space for P2S VpnClient. + :type vpn_client_address_pool: + ~azure.mgmt.network.v2017_06_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual + network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2017_06_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for + Virtual network gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2017_06_01.models.VpnClientRevokedCertificate] + :param vpn_client_protocols: VpnClientProtocols for Virtual network + gateway. + :type vpn_client_protocols: list[str or + ~azure.mgmt.network.v2017_06_01.models.VpnClientProtocol] + :param radius_server_address: The radius server address property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_address: str + :param radius_server_secret: The radius secret property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_secret: str + """ + + _attribute_map = { + 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, + 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, + 'vpn_client_protocols': {'key': 'vpnClientProtocols', 'type': '[str]'}, + 'radius_server_address': {'key': 'radiusServerAddress', 'type': 'str'}, + 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, + } + + def __init__(self, *, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, vpn_client_protocols=None, radius_server_address: str=None, radius_server_secret: str=None, **kwargs) -> None: + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = vpn_client_address_pool + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + self.vpn_client_protocols = vpn_client_protocols + self.radius_server_address = radius_server_address + self.radius_server_secret = radius_server_secret diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_parameters.py index 49b0047a0425..0cc8b155a6d7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_parameters.py @@ -42,9 +42,9 @@ class VpnClientParameters(Model): 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, } - def __init__(self, processor_architecture=None, authentication_method=None, radius_server_auth_certificate=None, client_root_certificates=None): - super(VpnClientParameters, self).__init__() - self.processor_architecture = processor_architecture - self.authentication_method = authentication_method - self.radius_server_auth_certificate = radius_server_auth_certificate - self.client_root_certificates = client_root_certificates + def __init__(self, **kwargs): + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = kwargs.get('processor_architecture', None) + self.authentication_method = kwargs.get('authentication_method', None) + self.radius_server_auth_certificate = kwargs.get('radius_server_auth_certificate', None) + self.client_root_certificates = kwargs.get('client_root_certificates', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_parameters_py3.py new file mode 100644 index 000000000000..bff205ba614a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_parameters_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientParameters(Model): + """Vpn Client Parameters for package generation. + + :param processor_architecture: VPN client Processor Architecture. Possible + values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' + :type processor_architecture: str or + ~azure.mgmt.network.v2017_06_01.models.ProcessorArchitecture + :param authentication_method: VPN client Authentication Method. Possible + values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', + 'EAPMSCHAPv2' + :type authentication_method: str or + ~azure.mgmt.network.v2017_06_01.models.AuthenticationMethod + :param radius_server_auth_certificate: The public certificate data for the + radius server authentication certificate as a Base-64 encoded string. + Required only if external radius authentication has been configured with + EAPTLS authentication. + :type radius_server_auth_certificate: str + :param client_root_certificates: A list of client root certificates public + certificate data encoded as Base-64 strings. Optional parameter for + external radius based authentication with EAPTLS. + :type client_root_certificates: list[str] + """ + + _attribute_map = { + 'processor_architecture': {'key': 'processorArchitecture', 'type': 'str'}, + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + 'radius_server_auth_certificate': {'key': 'radiusServerAuthCertificate', 'type': 'str'}, + 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, + } + + def __init__(self, *, processor_architecture=None, authentication_method=None, radius_server_auth_certificate: str=None, client_root_certificates=None, **kwargs) -> None: + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = processor_architecture + self.authentication_method = authentication_method + self.radius_server_auth_certificate = radius_server_auth_certificate + self.client_root_certificates = client_root_certificates diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_revoked_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_revoked_certificate.py index ebd6a4bbba2f..1fa6f6a1ef23 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_revoked_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_revoked_certificate.py @@ -46,9 +46,9 @@ class VpnClientRevokedCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, thumbprint=None, name=None, etag=None): - super(VpnClientRevokedCertificate, self).__init__(id=id) - self.thumbprint = thumbprint + def __init__(self, **kwargs): + super(VpnClientRevokedCertificate, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_revoked_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_revoked_certificate_py3.py new file mode 100644 index 000000000000..7c1e05f283a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_revoked_certificate_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + :ivar provisioning_state: The provisioning state of the VPN client revoked + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, thumbprint: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRevokedCertificate, self).__init__(id=id, **kwargs) + self.thumbprint = thumbprint + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_root_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_root_certificate.py index 6d820d3a8c11..48c7033d42ec 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_root_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_root_certificate.py @@ -18,9 +18,11 @@ class VpnClientRootCertificate(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param public_cert_data: The certificate public data. + :param public_cert_data: Required. The certificate public data. :type public_cert_data: str :ivar provisioning_state: The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and @@ -47,9 +49,9 @@ class VpnClientRootCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, public_cert_data, id=None, name=None, etag=None): - super(VpnClientRootCertificate, self).__init__(id=id) - self.public_cert_data = public_cert_data + def __init__(self, **kwargs): + super(VpnClientRootCertificate, self).__init__(**kwargs) + self.public_cert_data = kwargs.get('public_cert_data', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_root_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_root_certificate_py3.py new file mode 100644 index 000000000000..db8a1e547705 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/vpn_client_root_certificate_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param public_cert_data: Required. The certificate public data. + :type public_cert_data: str + :ivar provisioning_state: The provisioning state of the VPN client root + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'public_cert_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, public_cert_data: str, id: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRootCertificate, self).__init__(id=id, **kwargs) + self.public_cert_data = public_cert_data + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/network_management_client.py index bbf4f178bfd2..e22c7eac3c70 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/network_management_client.py @@ -15,7 +15,8 @@ from .version import VERSION from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.application_gateways_operations import ApplicationGatewaysOperations from .operations.available_endpoint_services_operations import AvailableEndpointServicesOperations @@ -277,7 +278,7 @@ def check_dns_name_availability( api_version = "2017-06-01" # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability' + url = self.check_dns_name_availability.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -319,3 +320,4 @@ def check_dns_name_availability( return client_raw_response return deserialized + check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/application_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/application_gateways_operations.py index 5c9d70a7a404..5aac6e35e411 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/application_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/application_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ApplicationGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def get( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def _create_or_update_initial( self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_06_01.models.ApplicationGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.ApplicationGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.ApplicationGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ApplicationGateway', response) if raw: @@ -312,12 +276,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -339,7 +305,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -385,6 +351,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -404,7 +371,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -449,12 +416,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} def _start_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -490,7 +458,7 @@ def _start_initial( return client_raw_response def start( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -498,12 +466,14 @@ def start( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -513,46 +483,26 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} def _stop_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -588,7 +538,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -596,12 +546,14 @@ def stop( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -611,46 +563,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} def _backend_health_initial( self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth' + url = self.backend_health.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -695,7 +627,7 @@ def _backend_health_initial( return deserialized def backend_health( - self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the backend health of the specified application gateway in a resource group. @@ -707,13 +639,17 @@ def backend_health( referenced in backend health. :type expand: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGatewayBackendHealth or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApplicationGatewayBackendHealth or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendHealth] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.ApplicationGatewayBackendHealth]] :raises: :class:`CloudError` """ raw_result = self._backend_health_initial( @@ -724,30 +660,8 @@ def backend_health( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ApplicationGatewayBackendHealth', response) if raw: @@ -756,12 +670,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} def list_available_waf_rule_sets( self, custom_headers=None, raw=False, **operation_config): @@ -780,7 +696,7 @@ def list_available_waf_rule_sets( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets' + url = self.list_available_waf_rule_sets.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -819,6 +735,7 @@ def list_available_waf_rule_sets( return client_raw_response return deserialized + list_available_waf_rule_sets.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'} def list_available_ssl_options( self, custom_headers=None, raw=False, **operation_config): @@ -837,7 +754,7 @@ def list_available_ssl_options( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default' + url = self.list_available_ssl_options.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -876,6 +793,7 @@ def list_available_ssl_options( return client_raw_response return deserialized + list_available_ssl_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default'} def list_available_ssl_predefined_policies( self, custom_headers=None, raw=False, **operation_config): @@ -896,7 +814,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies' + url = self.list_available_ssl_predefined_policies.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -941,6 +859,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_ssl_predefined_policies.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies'} def get_ssl_predefined_policy( self, predefined_policy_name, custom_headers=None, raw=False, **operation_config): @@ -961,7 +880,7 @@ def get_ssl_predefined_policy( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}' + url = self.get_ssl_predefined_policy.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'predefinedPolicyName': self._serialize.url("predefined_policy_name", predefined_policy_name, 'str') @@ -1001,3 +920,4 @@ def get_ssl_predefined_policy( return client_raw_response return deserialized + get_ssl_predefined_policy.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/available_endpoint_services_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/available_endpoint_services_operations.py index 15e2c8046d11..461564963b38 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/available_endpoint_services_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/available_endpoint_services_operations.py @@ -22,7 +22,7 @@ class AvailableEndpointServicesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/bgp_service_communities_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/bgp_service_communities_operations.py index a395eef8f3ff..f613bdaea40c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/bgp_service_communities_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/bgp_service_communities_operations.py @@ -22,7 +22,7 @@ class BgpServiceCommunitiesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/default_security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/default_security_rules_operations.py index 253de9d12119..f3b770314bfb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/default_security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/default_security_rules_operations.py @@ -22,7 +22,7 @@ class DefaultSecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -60,7 +60,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -107,6 +107,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules'} def get( self, resource_group_name, network_security_group_name, default_security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -131,7 +132,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -173,3 +174,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_circuit_authorizations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_circuit_authorizations_operations.py index aa650d3b3599..16002f32d795 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_circuit_authorizations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_circuit_authorizations_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified authorization from the specified express route circuit. @@ -91,12 +91,14 @@ def delete( :param authorization_name: The name of the authorization. :type authorization_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def get( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): @@ -166,7 +148,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an authorization in the specified express route circuit. @@ -278,13 +261,17 @@ def create_or_update( :type authorization_parameters: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitAuthorization :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitAuthorization or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitAuthorization or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitAuthorization] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitAuthorization]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -296,30 +283,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitAuthorization', response) if raw: @@ -328,12 +293,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +324,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -404,3 +371,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_circuit_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_circuit_peerings_operations.py index 7a11119c6026..ec4bd8d48289 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_circuit_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_circuit_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param peering_name: The name of the peering. :type peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def get( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -275,13 +258,17 @@ def create_or_update( :type peering_parameters: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitPeering or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitPeering', response) if raw: @@ -325,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -401,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_circuits_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_circuits_operations.py index db3263e81091..af3e10780a9e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_circuits_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_circuits_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param circuit_name: The name of the express route circuit. :type circuit_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def get( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuit :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuit or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuit] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuit]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuit', response) if raw: @@ -312,18 +276,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _list_arp_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}' + url = self.list_arp_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -368,7 +334,7 @@ def _list_arp_table_initial( return deserialized def list_arp_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -381,14 +347,17 @@ def list_arp_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsArpTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsArpTableListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitsArpTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitsArpTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_arp_table_initial( @@ -400,30 +369,8 @@ def list_arp_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', response) if raw: @@ -432,18 +379,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} def _list_routes_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}' + url = self.list_routes_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -488,7 +437,7 @@ def _list_routes_table_initial( return deserialized def list_routes_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -501,14 +450,18 @@ def list_routes_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitsRoutesTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitsRoutesTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_initial( @@ -520,30 +473,8 @@ def list_routes_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', response) if raw: @@ -552,18 +483,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} def _list_routes_table_summary_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}' + url = self.list_routes_table_summary.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -608,7 +541,7 @@ def _list_routes_table_summary_initial( return deserialized def list_routes_table_summary( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -621,14 +554,18 @@ def list_routes_table_summary( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableSummaryListResult or ClientRawResponse - if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableSummaryListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_summary_initial( @@ -640,30 +577,8 @@ def list_routes_table_summary( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', response) if raw: @@ -672,12 +587,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} def get_stats( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -699,7 +616,7 @@ def get_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats' + url = self.get_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -740,6 +657,7 @@ def get_stats( return client_raw_response return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} def get_peering_stats( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -763,7 +681,7 @@ def get_peering_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats' + url = self.get_peering_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -805,6 +723,7 @@ def get_peering_stats( return client_raw_response return deserialized + get_peering_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -826,7 +745,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -872,6 +791,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -891,7 +811,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -936,3 +856,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_service_providers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_service_providers_operations.py index ed0d62afbef3..e718030c1fc8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_service_providers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/express_route_service_providers_operations.py @@ -22,7 +22,7 @@ class ExpressRouteServiceProvidersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/inbound_nat_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/inbound_nat_rules_operations.py index 426b8f742cfd..2bd270c27a65 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/inbound_nat_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/inbound_nat_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class InboundNatRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -61,7 +61,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -108,12 +108,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules'} def _delete_initial( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -150,7 +151,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -160,12 +161,14 @@ def delete( :param inbound_nat_rule_name: The name of the inbound nat rule. :type inbound_nat_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -176,40 +179,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} def get( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -234,7 +217,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -278,12 +261,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -333,7 +317,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -347,13 +331,16 @@ def create_or_update( :type inbound_nat_rule_parameters: ~azure.mgmt.network.v2017_06_01.models.InboundNatRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - InboundNatRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns InboundNatRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.InboundNatRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.InboundNatRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -365,30 +352,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('InboundNatRule', response) if raw: @@ -397,9 +362,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_backend_address_pools_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_backend_address_pools_operations.py index cbbd0890a63e..106d7873d036 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_backend_address_pools_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_backend_address_pools_operations.py @@ -22,7 +22,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools'} def get( self, resource_group_name, load_balancer_name, backend_address_pool_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -171,3 +172,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_frontend_ip_configurations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_frontend_ip_configurations_operations.py index 06bec2406362..c82ee08681b3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_frontend_ip_configurations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_frontend_ip_configurations_operations.py @@ -22,7 +22,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations'} def get( self, resource_group_name, load_balancer_name, frontend_ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -171,3 +172,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_load_balancing_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_load_balancing_rules_operations.py index 4d1d0deeecc6..b3d58692a8d0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_load_balancing_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_load_balancing_rules_operations.py @@ -22,7 +22,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules'} def get( self, resource_group_name, load_balancer_name, load_balancing_rule_name, custom_headers=None, raw=False, **operation_config): @@ -128,7 +129,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -170,3 +171,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_network_interfaces_operations.py index df9e8fc517de..17c8656d981a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_network_interfaces_operations.py @@ -22,7 +22,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,3 +106,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_probes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_probes_operations.py index 3c90ae774107..e5a8e27d6980 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_probes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancer_probes_operations.py @@ -22,7 +22,7 @@ class LoadBalancerProbesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes'} def get( self, resource_group_name, load_balancer_name, probe_name, custom_headers=None, raw=False, **operation_config): @@ -128,7 +129,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -170,3 +171,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancers_operations.py index 8b1076a46f3b..8c8c82348329 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/load_balancers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param load_balancer_name: The name of the load balancer. :type load_balancer_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def get( self, resource_group_name, load_balancer_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( balancer operation. :type parameters: ~azure.mgmt.network.v2017_06_01.models.LoadBalancer :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns LoadBalancer - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.LoadBalancer] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.LoadBalancer]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LoadBalancer', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -340,7 +306,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -385,6 +351,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -406,7 +373,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -452,3 +419,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/local_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/local_network_gateways_operations.py index f528a1ba576e..be553d8d87bd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/local_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/local_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LocalNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a local network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_06_01.models.LocalNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - LocalNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.LocalNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.LocalNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LocalNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def get( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def _delete_initial( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type local_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +309,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -389,3 +355,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_interface_ip_configurations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_interface_ip_configurations_operations.py index 62cb46a659fe..b5db73db907f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_interface_ip_configurations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_interface_ip_configurations_operations.py @@ -22,7 +22,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations'} def get( self, resource_group_name, network_interface_name, ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -130,7 +131,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -172,3 +173,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_interface_load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_interface_load_balancers_operations.py index 328b941df755..7cb9b0b68347 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_interface_load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_interface_load_balancers_operations.py @@ -22,7 +22,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -106,3 +106,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_interfaces_operations.py index 4fe7d296de03..148d88181368 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_interfaces_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ models = models @@ -43,7 +43,7 @@ def _delete_initial( api_version = "2017-06-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def get( self, resource_group_name, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( api_version = "2017-06-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -203,6 +185,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def _create_or_update_initial( @@ -210,7 +193,7 @@ def _create_or_update_initial( api_version = "2017-06-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_06_01.models.NetworkInterface :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkInterface or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.NetworkInterface] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.NetworkInterface]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkInterface', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -347,7 +313,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -392,6 +358,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -415,7 +382,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -461,6 +428,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} def _get_effective_route_table_initial( @@ -468,7 +436,7 @@ def _get_effective_route_table_initial( api_version = "2017-06-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable' + url = self.get_effective_route_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -511,7 +479,7 @@ def _get_effective_route_table_initial( return deserialized def get_effective_route_table( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -519,13 +487,17 @@ def get_effective_route_table( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveRouteListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.EffectiveRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.EffectiveRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_effective_route_table_initial( @@ -535,30 +507,8 @@ def get_effective_route_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveRouteListResult', response) if raw: @@ -567,12 +517,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_effective_route_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} def _list_effective_network_security_groups_initial( @@ -580,7 +532,7 @@ def _list_effective_network_security_groups_initial( api_version = "2017-06-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups' + url = self.list_effective_network_security_groups.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -623,7 +575,7 @@ def _list_effective_network_security_groups_initial( return deserialized def list_effective_network_security_groups( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -631,14 +583,18 @@ def list_effective_network_security_groups( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveNetworkSecurityGroupListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveNetworkSecurityGroupListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.EffectiveNetworkSecurityGroupListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.EffectiveNetworkSecurityGroupListResult]] :raises: :class:`CloudError` """ raw_result = self._list_effective_network_security_groups_initial( @@ -648,30 +604,8 @@ def list_effective_network_security_groups( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', response) if raw: @@ -680,12 +614,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_effective_network_security_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} def list_virtual_machine_scale_set_vm_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, custom_headers=None, raw=False, **operation_config): @@ -715,7 +651,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces' + url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -763,6 +699,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} def list_virtual_machine_scale_set_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -789,7 +726,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces' + url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -836,6 +773,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} def get_virtual_machine_scale_set_network_interface( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -865,7 +803,7 @@ def get_virtual_machine_scale_set_network_interface( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}' + url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -910,3 +848,4 @@ def get_virtual_machine_scale_set_network_interface( return client_raw_response return deserialized + get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_security_groups_operations.py index 464fc8b9d8ba..5bd7aeb1df45 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_security_groups_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_security_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkSecurityGroupsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -88,12 +88,14 @@ def delete( group. :type network_security_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -103,40 +105,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def get( self, resource_group_name, network_security_group_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -203,12 +185,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -257,7 +240,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network security group in the specified resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_06_01.models.NetworkSecurityGroup :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.NetworkSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.NetworkSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkSecurityGroup', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -345,7 +311,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -390,6 +356,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -411,7 +378,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -457,3 +424,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_watchers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_watchers_operations.py index 25fca65cd4ca..99a71cba88bc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_watchers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/network_watchers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkWatchersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -62,7 +62,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -109,6 +109,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def get( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -170,12 +171,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def _delete_initial( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -211,7 +213,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -219,12 +221,14 @@ def delete( :param network_watcher_name: The name of the network watcher. :type network_watcher_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -234,40 +238,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -289,7 +273,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -335,6 +319,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -354,7 +339,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -399,6 +384,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'} def get_topology( self, resource_group_name, network_watcher_name, target_resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -424,7 +410,7 @@ def get_topology( parameters = models.TopologyParameters(target_resource_group_name=target_resource_group_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology' + url = self.get_topology.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -469,12 +455,13 @@ def get_topology( return client_raw_response return deserialized + get_topology.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'} def _verify_ip_flow_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify' + url = self.verify_ip_flow.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -523,7 +510,7 @@ def _verify_ip_flow_initial( return deserialized def verify_ip_flow( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Verify IP flow from the specified VM to a location given the currently configured NSG rules. @@ -535,13 +522,17 @@ def verify_ip_flow( :type parameters: ~azure.mgmt.network.v2017_06_01.models.VerificationIPFlowParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VerificationIPFlowResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VerificationIPFlowResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.VerificationIPFlowResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.VerificationIPFlowResult]] :raises: :class:`CloudError` """ raw_result = self._verify_ip_flow_initial( @@ -552,30 +543,8 @@ def verify_ip_flow( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VerificationIPFlowResult', response) if raw: @@ -584,18 +553,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + verify_ip_flow.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} def _get_next_hop_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop' + url = self.get_next_hop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -644,7 +615,7 @@ def _get_next_hop_initial( return deserialized def get_next_hop( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -656,13 +627,16 @@ def get_next_hop( :type parameters: ~azure.mgmt.network.v2017_06_01.models.NextHopParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NextHopResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NextHopResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.NextHopResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.NextHopResult]] :raises: :class:`CloudError` """ raw_result = self._get_next_hop_initial( @@ -673,30 +647,8 @@ def get_next_hop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NextHopResult', response) if raw: @@ -705,12 +657,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_next_hop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} def _get_vm_security_rules_initial( @@ -718,7 +672,7 @@ def _get_vm_security_rules_initial( parameters = models.SecurityGroupViewParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView' + url = self.get_vm_security_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -767,7 +721,7 @@ def _get_vm_security_rules_initial( return deserialized def get_vm_security_rules( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the configured and effective security group rules on the specified VM. @@ -778,13 +732,16 @@ def get_vm_security_rules( :param target_resource_id: ID of the target VM. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - SecurityGroupViewResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityGroupViewResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.SecurityGroupViewResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.SecurityGroupViewResult]] :raises: :class:`CloudError` """ raw_result = self._get_vm_security_rules_initial( @@ -795,30 +752,8 @@ def get_vm_security_rules( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('SecurityGroupViewResult', response) if raw: @@ -827,18 +762,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vm_security_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} def _get_troubleshooting_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot' + url = self.get_troubleshooting.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -887,7 +824,7 @@ def _get_troubleshooting_initial( return deserialized def get_troubleshooting( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -899,13 +836,16 @@ def get_troubleshooting( :type parameters: ~azure.mgmt.network.v2017_06_01.models.TroubleshootingParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_initial( @@ -916,30 +856,8 @@ def get_troubleshooting( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -948,12 +866,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} def _get_troubleshooting_result_initial( @@ -961,7 +881,7 @@ def _get_troubleshooting_result_initial( parameters = models.QueryTroubleshootingParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult' + url = self.get_troubleshooting_result.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1010,7 +930,7 @@ def _get_troubleshooting_result_initial( return deserialized def get_troubleshooting_result( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,13 +941,16 @@ def get_troubleshooting_result( troubleshooting result. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_result_initial( @@ -1038,30 +961,8 @@ def get_troubleshooting_result( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -1070,18 +971,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} def _set_flow_log_configuration_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog' + url = self.set_flow_log_configuration.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1130,7 +1033,7 @@ def _set_flow_log_configuration_initial( return deserialized def set_flow_log_configuration( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1143,13 +1046,16 @@ def set_flow_log_configuration( :type parameters: ~azure.mgmt.network.v2017_06_01.models.FlowLogInformation :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._set_flow_log_configuration_initial( @@ -1160,30 +1066,8 @@ def set_flow_log_configuration( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1192,12 +1076,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_flow_log_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} def _get_flow_log_status_initial( @@ -1205,7 +1091,7 @@ def _get_flow_log_status_initial( parameters = models.FlowLogStatusParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus' + url = self.get_flow_log_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1254,7 +1140,7 @@ def _get_flow_log_status_initial( return deserialized def get_flow_log_status( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1266,13 +1152,16 @@ def get_flow_log_status( logging status. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._get_flow_log_status_initial( @@ -1283,30 +1172,8 @@ def get_flow_log_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1315,12 +1182,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_flow_log_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} def _check_connectivity_initial( @@ -1328,7 +1197,7 @@ def _check_connectivity_initial( parameters = models.ConnectivityParameters(source=source, destination=destination) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck' + url = self.check_connectivity.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1377,7 +1246,7 @@ def _check_connectivity_initial( return deserialized def check_connectivity( - self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, polling=True, **operation_config): """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1394,13 +1263,16 @@ def check_connectivity( :type destination: ~azure.mgmt.network.v2017_06_01.models.ConnectivityDestination :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectivityInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectivityInformation + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.ConnectivityInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.ConnectivityInformation]] :raises: :class:`CloudError` """ raw_result = self._check_connectivity_initial( @@ -1412,30 +1284,8 @@ def check_connectivity( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectivityInformation', response) if raw: @@ -1444,9 +1294,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + check_connectivity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/packet_captures_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/packet_captures_operations.py index 9f5c976230df..7bb2d82756d8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/packet_captures_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/packet_captures_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PacketCapturesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -91,7 +91,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -104,13 +104,16 @@ def create( operation. :type parameters: ~azure.mgmt.network.v2017_06_01.models.PacketCapture :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PacketCaptureResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.PacketCaptureResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.PacketCaptureResult]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -122,30 +125,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureResult', response) if raw: @@ -154,12 +135,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def get( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -224,12 +207,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _delete_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -266,7 +250,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -276,12 +260,14 @@ def delete( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -292,46 +278,26 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _stop_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -368,7 +334,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -378,12 +344,14 @@ def stop( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -394,46 +362,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} def _get_status_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus' + url = self.get_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -479,7 +427,7 @@ def _get_status_initial( return deserialized def get_status( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -490,13 +438,17 @@ def get_status( session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureQueryStatusResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PacketCaptureQueryStatusResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.PacketCaptureQueryStatusResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.PacketCaptureQueryStatusResult]] :raises: :class:`CloudError` """ raw_result = self._get_status_initial( @@ -507,30 +459,8 @@ def get_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureQueryStatusResult', response) if raw: @@ -539,12 +469,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} def list( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -568,7 +500,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -615,3 +547,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/public_ip_addresses_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/public_ip_addresses_operations.py index 8c783f0aae1d..3d7e60475ee9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/public_ip_addresses_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/public_ip_addresses_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PublicIPAddressesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ models = models @@ -43,7 +43,7 @@ def _delete_initial( api_version = "2017-06-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param public_ip_address_name: The name of the subnet. :type public_ip_address_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def get( self, resource_group_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( api_version = "2017-06-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -203,6 +185,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def _create_or_update_initial( @@ -210,7 +193,7 @@ def _create_or_update_initial( api_version = "2017-06-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_06_01.models.PublicIPAddress :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PublicIPAddress or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.PublicIPAddress] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.PublicIPAddress]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('PublicIPAddress', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -347,7 +313,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -392,6 +358,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -415,7 +382,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -461,6 +428,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} def list_virtual_machine_scale_set_public_ip_addresses( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -488,7 +456,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses' + url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -535,6 +503,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses'} def list_virtual_machine_scale_set_vm_public_ip_addresses( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -568,7 +537,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses' + url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -618,6 +587,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses'} def get_virtual_machine_scale_set_public_ip_address( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -651,7 +621,7 @@ def get_virtual_machine_scale_set_public_ip_address( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}' + url = self.get_virtual_machine_scale_set_public_ip_address.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -698,3 +668,4 @@ def get_virtual_machine_scale_set_public_ip_address( return client_raw_response return deserialized + get_virtual_machine_scale_set_public_ip_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/route_filter_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/route_filter_rules_operations.py index e6b12336c365..14106c0c8b52 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/route_filter_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/route_filter_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFilterRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param rule_name: The name of the rule. :type rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def get( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -273,13 +256,16 @@ def create_or_update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_06_01.models.RouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -291,30 +277,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilterRule', response) if raw: @@ -323,18 +287,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -382,7 +348,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -396,13 +362,16 @@ def update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_06_01.models.PatchRouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -414,30 +383,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilterRule', response) if raw: @@ -446,12 +393,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def list_by_route_filter( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): @@ -475,7 +424,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules' + url = self.list_by_route_filter.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -522,3 +471,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_route_filter.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/route_filters_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/route_filters_operations.py index 47d39ecff623..49bdf3b23838 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/route_filters_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/route_filters_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFiltersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_filter_name: The name of the route filter. :type route_filter_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def get( self, resource_group_name, route_filter_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type route_filter_parameters: ~azure.mgmt.network.v2017_06_01.models.RouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilter', response) if raw: @@ -316,18 +280,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -374,7 +340,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -386,13 +352,16 @@ def update( :type route_filter_parameters: ~azure.mgmt.network.v2017_06_01.models.PatchRouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -403,30 +372,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilter', response) if raw: @@ -435,12 +382,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -462,7 +411,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -508,6 +457,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -527,7 +477,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -572,3 +522,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/route_tables_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/route_tables_operations.py index bc3ab3ac8a89..129eae8077e9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/route_tables_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/route_tables_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteTablesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_table_name: The name of the route table. :type route_table_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def get( self, resource_group_name, route_table_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( table operation. :type parameters: ~azure.mgmt.network.v2017_06_01.models.RouteTable :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteTable - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.RouteTable] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.RouteTable]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteTable', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -342,7 +308,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -388,6 +354,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -452,3 +419,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/routes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/routes_operations.py index 1125165d3e41..3284abd81238 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/routes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/routes_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RoutesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param route_name: The name of the route. :type route_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def get( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -272,13 +255,16 @@ def create_or_update( route operation. :type route_parameters: ~azure.mgmt.network.v2017_06_01.models.Route :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Route or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Route or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.Route] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.Route]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -290,30 +276,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Route', response) if raw: @@ -322,12 +286,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def list( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): @@ -351,7 +317,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -398,3 +364,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/security_rules_operations.py index 983a3a013bcb..80806bd8c287 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/security_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( :param security_rule_name: The name of the security rule. :type security_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def get( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a security rule in the specified network security group. @@ -277,13 +260,16 @@ def create_or_update( :type security_rule_parameters: ~azure.mgmt.network.v2017_06_01.models.SecurityRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns SecurityRule - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.SecurityRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.SecurityRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -295,30 +281,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('SecurityRule', response) if raw: @@ -327,12 +291,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def list( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +323,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -404,3 +370,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/subnets_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/subnets_operations.py index 609c8175c75a..1202b657d919 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/subnets_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/subnets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SubnetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param subnet_name: The name of the subnet. :type subnet_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def get( self, resource_group_name, virtual_network_name, subnet_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -276,13 +259,16 @@ def create_or_update( subnet operation. :type subnet_parameters: ~azure.mgmt.network.v2017_06_01.models.Subnet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Subnet or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Subnet or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.Subnet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.Subnet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -294,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Subnet', response) if raw: @@ -326,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -355,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -402,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/usages_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/usages_operations.py index 1e7607a6354a..6c6804b2d42b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/usages_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/usages_operations.py @@ -22,7 +22,7 @@ class UsagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_gateway_connections_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_gateway_connections_operations.py index 579db338e993..6e8537d0adc1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_gateway_connections_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_gateway_connections_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway connection in the specified resource group. @@ -106,13 +106,17 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnection :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGatewayConnection or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnection or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnection] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGatewayConnection]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +127,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGatewayConnection', response) if raw: @@ -155,12 +137,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def get( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -185,7 +169,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -226,12 +210,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -267,7 +252,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -276,12 +261,14 @@ def delete( virtual network gateway connection. :type virtual_network_gateway_connection_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -291,40 +278,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _set_shared_key_initial( @@ -332,7 +299,7 @@ def _set_shared_key_initial( parameters = models.ConnectionSharedKey(value=value) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.set_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -381,7 +348,7 @@ def _set_shared_key_initial( return deserialized def set_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, polling=True, **operation_config): """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -395,13 +362,16 @@ def set_shared_key( :param value: The virtual network connection shared key value. :type value: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectionSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.ConnectionSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.ConnectionSharedKey]] :raises: :class:`CloudError` """ raw_result = self._set_shared_key_initial( @@ -412,30 +382,8 @@ def set_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ConnectionSharedKey', response) if raw: @@ -444,12 +392,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def get_shared_key( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -473,7 +423,7 @@ def get_shared_key( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.get_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -514,6 +464,7 @@ def get_shared_key( return client_raw_response return deserialized + get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -536,7 +487,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -582,6 +533,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} def _reset_shared_key_initial( @@ -589,7 +541,7 @@ def _reset_shared_key_initial( parameters = models.ConnectionResetSharedKey(key_length=key_length) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset' + url = self.reset_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -636,7 +588,7 @@ def _reset_shared_key_initial( return deserialized def reset_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, polling=True, **operation_config): """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -651,13 +603,17 @@ def reset_shared_key( length, should between 1 and 128. :type key_length: int :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionResetSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConnectionResetSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.ConnectionResetSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.ConnectionResetSharedKey]] :raises: :class:`CloudError` """ raw_result = self._reset_shared_key_initial( @@ -668,30 +624,8 @@ def reset_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectionResetSharedKey', response) if raw: @@ -700,9 +634,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_gateways_operations.py index a9d09dbb7fd5..e012ee1a4128 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def get( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +309,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -389,6 +355,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} def list_connections( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -414,7 +381,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections' + url = self.list_connections.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -461,12 +428,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections'} def _reset_initial( self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset' + url = self.reset.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -511,7 +479,7 @@ def _reset_initial( return deserialized def reset( - self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, polling=True, **operation_config): """Resets the primary of the virtual network gateway in the specified resource group. @@ -524,13 +492,16 @@ def reset( the begin reset of the active-active feature enabled gateway. :type gateway_vip: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._reset_initial( @@ -541,30 +512,8 @@ def reset( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -573,18 +522,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} def _generatevpnclientpackage_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage' + url = self.generatevpnclientpackage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -631,7 +582,7 @@ def _generatevpnclientpackage_initial( return deserialized def generatevpnclientpackage( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -645,12 +596,14 @@ def generatevpnclientpackage( :type parameters: ~azure.mgmt.network.v2017_06_01.models.VpnClientParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._generatevpnclientpackage_initial( @@ -661,30 +614,8 @@ def generatevpnclientpackage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -693,18 +624,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} def _generate_vpn_profile_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile' + url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -751,7 +684,7 @@ def _generate_vpn_profile_initial( return deserialized def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. @@ -766,12 +699,14 @@ def generate_vpn_profile( :type parameters: ~azure.mgmt.network.v2017_06_01.models.VpnClientParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._generate_vpn_profile_initial( @@ -782,30 +717,8 @@ def generate_vpn_profile( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -814,18 +727,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} def _get_bgp_peer_status_initial( self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus' + url = self.get_bgp_peer_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -870,7 +785,7 @@ def _get_bgp_peer_status_initial( return deserialized def get_bgp_peer_status( - self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, polling=True, **operation_config): """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -881,13 +796,16 @@ def get_bgp_peer_status( :param peer: The IP address of the peer to retrieve the status of. :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - BgpPeerStatusListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BgpPeerStatusListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.BgpPeerStatusListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.BgpPeerStatusListResult]] :raises: :class:`CloudError` """ raw_result = self._get_bgp_peer_status_initial( @@ -898,30 +816,8 @@ def get_bgp_peer_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('BgpPeerStatusListResult', response) if raw: @@ -930,18 +826,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_bgp_peer_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} def _get_learned_routes_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes' + url = self.get_learned_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -984,7 +882,7 @@ def _get_learned_routes_initial( return deserialized def get_learned_routes( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -994,13 +892,16 @@ def get_learned_routes( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_learned_routes_initial( @@ -1010,30 +911,8 @@ def get_learned_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -1042,18 +921,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} def _get_advertised_routes_initial( self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes' + url = self.get_advertised_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1097,7 +978,7 @@ def _get_advertised_routes_initial( return deserialized def get_advertised_routes( - self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1109,13 +990,16 @@ def get_advertised_routes( :param peer: The IP address of the peer :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_advertised_routes_initial( @@ -1126,30 +1010,8 @@ def get_advertised_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -1158,9 +1020,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_peerings_operations.py index d030beda0e8d..835262120904 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_network_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( peering. :type virtual_network_peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def get( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -275,13 +258,16 @@ def create_or_update( :type virtual_network_peering_parameters: ~azure.mgmt.network.v2017_06_01.models.VirtualNetworkPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkPeering + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.VirtualNetworkPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +279,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkPeering', response) if raw: @@ -325,12 +289,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +320,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -401,3 +367,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_networks_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_networks_operations.py index 6b191d339864..4c6d2c18edb2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_networks_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/virtual_networks_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworksOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-06-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param virtual_network_name: The name of the virtual network. :type virtual_network_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def get( self, resource_group_name, virtual_network_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_06_01.models.VirtualNetwork :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetwork or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_06_01.models.VirtualNetwork] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_06_01.models.VirtualNetwork]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetwork', response) if raw: @@ -316,12 +280,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -341,7 +307,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -386,6 +352,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -453,6 +420,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks'} def check_ip_address_availability( self, resource_group_name, virtual_network_name, ip_address=None, custom_headers=None, raw=False, **operation_config): @@ -476,7 +444,7 @@ def check_ip_address_availability( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability' + url = self.check_ip_address_availability.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -519,6 +487,7 @@ def check_ip_address_availability( return client_raw_response return deserialized + check_ip_address_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'} def list_usage( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -542,7 +511,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages' + url = self.list_usage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -589,3 +558,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/__init__.py index 9a880678f3cb..f5f2de27762b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/__init__.py @@ -9,159 +9,314 @@ # regenerated. # -------------------------------------------------------------------------- -from .sub_resource import SubResource -from .backend_address_pool import BackendAddressPool -from .inbound_nat_rule import InboundNatRule -from .security_rule import SecurityRule -from .network_interface_dns_settings import NetworkInterfaceDnsSettings -from .network_interface import NetworkInterface -from .network_security_group import NetworkSecurityGroup -from .route import Route -from .route_table import RouteTable -from .service_endpoint_properties_format import ServiceEndpointPropertiesFormat -from .public_ip_address_sku import PublicIPAddressSku -from .public_ip_address_dns_settings import PublicIPAddressDnsSettings -from .public_ip_address import PublicIPAddress -from .ip_configuration import IPConfiguration -from .resource_navigation_link import ResourceNavigationLink -from .subnet import Subnet -from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration -from .application_gateway_backend_address import ApplicationGatewayBackendAddress -from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool -from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining -from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings -from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer -from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings -from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool -from .application_gateway_backend_health import ApplicationGatewayBackendHealth -from .application_gateway_sku import ApplicationGatewaySku -from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy -from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration -from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate -from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate -from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration -from .application_gateway_frontend_port import ApplicationGatewayFrontendPort -from .application_gateway_http_listener import ApplicationGatewayHttpListener -from .application_gateway_path_rule import ApplicationGatewayPathRule -from .application_gateway_probe_health_response_match import ApplicationGatewayProbeHealthResponseMatch -from .application_gateway_probe import ApplicationGatewayProbe -from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule -from .application_gateway_redirect_configuration import ApplicationGatewayRedirectConfiguration -from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap -from .application_gateway_firewall_disabled_rule_group import ApplicationGatewayFirewallDisabledRuleGroup -from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration -from .application_gateway import ApplicationGateway -from .application_gateway_firewall_rule import ApplicationGatewayFirewallRule -from .application_gateway_firewall_rule_group import ApplicationGatewayFirewallRuleGroup -from .application_gateway_firewall_rule_set import ApplicationGatewayFirewallRuleSet -from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult -from .application_gateway_available_ssl_options import ApplicationGatewayAvailableSslOptions -from .application_gateway_ssl_predefined_policy import ApplicationGatewaySslPredefinedPolicy -from .resource import Resource -from .dns_name_availability_result import DnsNameAvailabilityResult -from .endpoint_service_result import EndpointServiceResult -from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization -from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig -from .route_filter_rule import RouteFilterRule -from .express_route_circuit_stats import ExpressRouteCircuitStats -from .express_route_circuit_peering import ExpressRouteCircuitPeering -from .route_filter import RouteFilter -from .ipv6_express_route_circuit_peering_config import Ipv6ExpressRouteCircuitPeeringConfig -from .express_route_circuit_sku import ExpressRouteCircuitSku -from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties -from .express_route_circuit import ExpressRouteCircuit -from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable -from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult -from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable -from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult -from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary -from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult -from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered -from .express_route_service_provider import ExpressRouteServiceProvider -from .load_balancer_sku import LoadBalancerSku -from .frontend_ip_configuration import FrontendIPConfiguration -from .load_balancing_rule import LoadBalancingRule -from .probe import Probe -from .inbound_nat_pool import InboundNatPool -from .outbound_nat_rule import OutboundNatRule -from .load_balancer import LoadBalancer -from .error_details import ErrorDetails -from .error import Error -from .azure_async_operation_result import AzureAsyncOperationResult -from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation -from .effective_network_security_rule import EffectiveNetworkSecurityRule -from .effective_network_security_group import EffectiveNetworkSecurityGroup -from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult -from .effective_route import EffectiveRoute -from .effective_route_list_result import EffectiveRouteListResult -from .network_watcher import NetworkWatcher -from .topology_parameters import TopologyParameters -from .topology_association import TopologyAssociation -from .topology_resource import TopologyResource -from .topology import Topology -from .verification_ip_flow_parameters import VerificationIPFlowParameters -from .verification_ip_flow_result import VerificationIPFlowResult -from .next_hop_parameters import NextHopParameters -from .next_hop_result import NextHopResult -from .security_group_view_parameters import SecurityGroupViewParameters -from .network_interface_association import NetworkInterfaceAssociation -from .subnet_association import SubnetAssociation -from .security_rule_associations import SecurityRuleAssociations -from .security_group_network_interface import SecurityGroupNetworkInterface -from .security_group_view_result import SecurityGroupViewResult -from .packet_capture_storage_location import PacketCaptureStorageLocation -from .packet_capture_filter import PacketCaptureFilter -from .packet_capture_parameters import PacketCaptureParameters -from .packet_capture import PacketCapture -from .packet_capture_result import PacketCaptureResult -from .packet_capture_query_status_result import PacketCaptureQueryStatusResult -from .troubleshooting_parameters import TroubleshootingParameters -from .query_troubleshooting_parameters import QueryTroubleshootingParameters -from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions -from .troubleshooting_details import TroubleshootingDetails -from .troubleshooting_result import TroubleshootingResult -from .retention_policy_parameters import RetentionPolicyParameters -from .flow_log_status_parameters import FlowLogStatusParameters -from .flow_log_information import FlowLogInformation -from .connectivity_source import ConnectivitySource -from .connectivity_destination import ConnectivityDestination -from .connectivity_parameters import ConnectivityParameters -from .connectivity_issue import ConnectivityIssue -from .connectivity_hop import ConnectivityHop -from .connectivity_information import ConnectivityInformation -from .patch_route_filter_rule import PatchRouteFilterRule -from .patch_route_filter import PatchRouteFilter -from .bgp_community import BGPCommunity -from .bgp_service_community import BgpServiceCommunity -from .usage_name import UsageName -from .usage import Usage -from .virtual_network_peering import VirtualNetworkPeering -from .address_space import AddressSpace -from .dhcp_options import DhcpOptions -from .virtual_network import VirtualNetwork -from .ip_address_availability_result import IPAddressAvailabilityResult -from .virtual_network_usage_name import VirtualNetworkUsageName -from .virtual_network_usage import VirtualNetworkUsage -from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration -from .virtual_network_gateway_sku import VirtualNetworkGatewaySku -from .vpn_client_root_certificate import VpnClientRootCertificate -from .vpn_client_revoked_certificate import VpnClientRevokedCertificate -from .vpn_client_configuration import VpnClientConfiguration -from .bgp_settings import BgpSettings -from .bgp_peer_status import BgpPeerStatus -from .gateway_route import GatewayRoute -from .virtual_network_gateway import VirtualNetworkGateway -from .vpn_client_parameters import VpnClientParameters -from .bgp_peer_status_list_result import BgpPeerStatusListResult -from .gateway_route_list_result import GatewayRouteListResult -from .tunnel_connection_health import TunnelConnectionHealth -from .local_network_gateway import LocalNetworkGateway -from .ipsec_policy import IpsecPolicy -from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection -from .connection_reset_shared_key import ConnectionResetSharedKey -from .connection_shared_key import ConnectionSharedKey -from .virtual_network_connection_gateway_reference import VirtualNetworkConnectionGatewayReference -from .virtual_network_gateway_connection_list_entity import VirtualNetworkGatewayConnectionListEntity +try: + from .sub_resource_py3 import SubResource + from .backend_address_pool_py3 import BackendAddressPool + from .inbound_nat_rule_py3 import InboundNatRule + from .security_rule_py3 import SecurityRule + from .network_interface_dns_settings_py3 import NetworkInterfaceDnsSettings + from .network_interface_py3 import NetworkInterface + from .network_security_group_py3 import NetworkSecurityGroup + from .route_py3 import Route + from .route_table_py3 import RouteTable + from .service_endpoint_properties_format_py3 import ServiceEndpointPropertiesFormat + from .public_ip_address_sku_py3 import PublicIPAddressSku + from .public_ip_address_dns_settings_py3 import PublicIPAddressDnsSettings + from .public_ip_address_py3 import PublicIPAddress + from .ip_configuration_py3 import IPConfiguration + from .resource_navigation_link_py3 import ResourceNavigationLink + from .subnet_py3 import Subnet + from .network_interface_ip_configuration_py3 import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address_py3 import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool_py3 import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining_py3 import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings_py3 import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server_py3 import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings_py3 import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool_py3 import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health_py3 import ApplicationGatewayBackendHealth + from .application_gateway_sku_py3 import ApplicationGatewaySku + from .application_gateway_ssl_policy_py3 import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration_py3 import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate_py3 import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate_py3 import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration_py3 import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port_py3 import ApplicationGatewayFrontendPort + from .application_gateway_http_listener_py3 import ApplicationGatewayHttpListener + from .application_gateway_path_rule_py3 import ApplicationGatewayPathRule + from .application_gateway_probe_health_response_match_py3 import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_probe_py3 import ApplicationGatewayProbe + from .application_gateway_request_routing_rule_py3 import ApplicationGatewayRequestRoutingRule + from .application_gateway_redirect_configuration_py3 import ApplicationGatewayRedirectConfiguration + from .application_gateway_url_path_map_py3 import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group_py3 import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration_py3 import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway_py3 import ApplicationGateway + from .application_gateway_firewall_rule_py3 import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group_py3 import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set_py3 import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result_py3 import ApplicationGatewayAvailableWafRuleSetsResult + from .application_gateway_available_ssl_options_py3 import ApplicationGatewayAvailableSslOptions + from .application_gateway_ssl_predefined_policy_py3 import ApplicationGatewaySslPredefinedPolicy + from .resource_py3 import Resource + from .dns_name_availability_result_py3 import DnsNameAvailabilityResult + from .endpoint_service_result_py3 import EndpointServiceResult + from .express_route_circuit_authorization_py3 import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config_py3 import ExpressRouteCircuitPeeringConfig + from .route_filter_rule_py3 import RouteFilterRule + from .express_route_circuit_stats_py3 import ExpressRouteCircuitStats + from .express_route_circuit_peering_py3 import ExpressRouteCircuitPeering + from .route_filter_py3 import RouteFilter + from .ipv6_express_route_circuit_peering_config_py3 import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku_py3 import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties_py3 import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit_py3 import ExpressRouteCircuit + from .express_route_circuit_arp_table_py3 import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result_py3 import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table_py3 import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result_py3 import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary_py3 import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result_py3 import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered_py3 import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider_py3 import ExpressRouteServiceProvider + from .load_balancer_sku_py3 import LoadBalancerSku + from .frontend_ip_configuration_py3 import FrontendIPConfiguration + from .load_balancing_rule_py3 import LoadBalancingRule + from .probe_py3 import Probe + from .inbound_nat_pool_py3 import InboundNatPool + from .outbound_nat_rule_py3 import OutboundNatRule + from .load_balancer_py3 import LoadBalancer + from .error_details_py3 import ErrorDetails + from .error_py3 import Error + from .azure_async_operation_result_py3 import AzureAsyncOperationResult + from .effective_network_security_group_association_py3 import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule_py3 import EffectiveNetworkSecurityRule + from .effective_network_security_group_py3 import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result_py3 import EffectiveNetworkSecurityGroupListResult + from .effective_route_py3 import EffectiveRoute + from .effective_route_list_result_py3 import EffectiveRouteListResult + from .network_watcher_py3 import NetworkWatcher + from .topology_parameters_py3 import TopologyParameters + from .topology_association_py3 import TopologyAssociation + from .topology_resource_py3 import TopologyResource + from .topology_py3 import Topology + from .verification_ip_flow_parameters_py3 import VerificationIPFlowParameters + from .verification_ip_flow_result_py3 import VerificationIPFlowResult + from .next_hop_parameters_py3 import NextHopParameters + from .next_hop_result_py3 import NextHopResult + from .security_group_view_parameters_py3 import SecurityGroupViewParameters + from .network_interface_association_py3 import NetworkInterfaceAssociation + from .subnet_association_py3 import SubnetAssociation + from .security_rule_associations_py3 import SecurityRuleAssociations + from .security_group_network_interface_py3 import SecurityGroupNetworkInterface + from .security_group_view_result_py3 import SecurityGroupViewResult + from .packet_capture_storage_location_py3 import PacketCaptureStorageLocation + from .packet_capture_filter_py3 import PacketCaptureFilter + from .packet_capture_parameters_py3 import PacketCaptureParameters + from .packet_capture_py3 import PacketCapture + from .packet_capture_result_py3 import PacketCaptureResult + from .packet_capture_query_status_result_py3 import PacketCaptureQueryStatusResult + from .troubleshooting_parameters_py3 import TroubleshootingParameters + from .query_troubleshooting_parameters_py3 import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions_py3 import TroubleshootingRecommendedActions + from .troubleshooting_details_py3 import TroubleshootingDetails + from .troubleshooting_result_py3 import TroubleshootingResult + from .retention_policy_parameters_py3 import RetentionPolicyParameters + from .flow_log_status_parameters_py3 import FlowLogStatusParameters + from .flow_log_information_py3 import FlowLogInformation + from .connectivity_source_py3 import ConnectivitySource + from .connectivity_destination_py3 import ConnectivityDestination + from .connectivity_parameters_py3 import ConnectivityParameters + from .connectivity_issue_py3 import ConnectivityIssue + from .connectivity_hop_py3 import ConnectivityHop + from .connectivity_information_py3 import ConnectivityInformation + from .patch_route_filter_rule_py3 import PatchRouteFilterRule + from .patch_route_filter_py3 import PatchRouteFilter + from .bgp_community_py3 import BGPCommunity + from .bgp_service_community_py3 import BgpServiceCommunity + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .virtual_network_peering_py3 import VirtualNetworkPeering + from .address_space_py3 import AddressSpace + from .dhcp_options_py3 import DhcpOptions + from .virtual_network_py3 import VirtualNetwork + from .ip_address_availability_result_py3 import IPAddressAvailabilityResult + from .virtual_network_usage_name_py3 import VirtualNetworkUsageName + from .virtual_network_usage_py3 import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration_py3 import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku_py3 import VirtualNetworkGatewaySku + from .vpn_client_root_certificate_py3 import VpnClientRootCertificate + from .vpn_client_revoked_certificate_py3 import VpnClientRevokedCertificate + from .vpn_client_configuration_py3 import VpnClientConfiguration + from .bgp_settings_py3 import BgpSettings + from .bgp_peer_status_py3 import BgpPeerStatus + from .gateway_route_py3 import GatewayRoute + from .virtual_network_gateway_py3 import VirtualNetworkGateway + from .vpn_client_parameters_py3 import VpnClientParameters + from .bgp_peer_status_list_result_py3 import BgpPeerStatusListResult + from .gateway_route_list_result_py3 import GatewayRouteListResult + from .tunnel_connection_health_py3 import TunnelConnectionHealth + from .local_network_gateway_py3 import LocalNetworkGateway + from .ipsec_policy_py3 import IpsecPolicy + from .virtual_network_gateway_connection_py3 import VirtualNetworkGatewayConnection + from .connection_reset_shared_key_py3 import ConnectionResetSharedKey + from .connection_shared_key_py3 import ConnectionSharedKey + from .virtual_network_connection_gateway_reference_py3 import VirtualNetworkConnectionGatewayReference + from .virtual_network_gateway_connection_list_entity_py3 import VirtualNetworkGatewayConnectionListEntity +except (SyntaxError, ImportError): + from .sub_resource import SubResource + from .backend_address_pool import BackendAddressPool + from .inbound_nat_rule import InboundNatRule + from .security_rule import SecurityRule + from .network_interface_dns_settings import NetworkInterfaceDnsSettings + from .network_interface import NetworkInterface + from .network_security_group import NetworkSecurityGroup + from .route import Route + from .route_table import RouteTable + from .service_endpoint_properties_format import ServiceEndpointPropertiesFormat + from .public_ip_address_sku import PublicIPAddressSku + from .public_ip_address_dns_settings import PublicIPAddressDnsSettings + from .public_ip_address import PublicIPAddress + from .ip_configuration import IPConfiguration + from .resource_navigation_link import ResourceNavigationLink + from .subnet import Subnet + from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health import ApplicationGatewayBackendHealth + from .application_gateway_sku import ApplicationGatewaySku + from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port import ApplicationGatewayFrontendPort + from .application_gateway_http_listener import ApplicationGatewayHttpListener + from .application_gateway_path_rule import ApplicationGatewayPathRule + from .application_gateway_probe_health_response_match import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_probe import ApplicationGatewayProbe + from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule + from .application_gateway_redirect_configuration import ApplicationGatewayRedirectConfiguration + from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway import ApplicationGateway + from .application_gateway_firewall_rule import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult + from .application_gateway_available_ssl_options import ApplicationGatewayAvailableSslOptions + from .application_gateway_ssl_predefined_policy import ApplicationGatewaySslPredefinedPolicy + from .resource import Resource + from .dns_name_availability_result import DnsNameAvailabilityResult + from .endpoint_service_result import EndpointServiceResult + from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig + from .route_filter_rule import RouteFilterRule + from .express_route_circuit_stats import ExpressRouteCircuitStats + from .express_route_circuit_peering import ExpressRouteCircuitPeering + from .route_filter import RouteFilter + from .ipv6_express_route_circuit_peering_config import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit import ExpressRouteCircuit + from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider import ExpressRouteServiceProvider + from .load_balancer_sku import LoadBalancerSku + from .frontend_ip_configuration import FrontendIPConfiguration + from .load_balancing_rule import LoadBalancingRule + from .probe import Probe + from .inbound_nat_pool import InboundNatPool + from .outbound_nat_rule import OutboundNatRule + from .load_balancer import LoadBalancer + from .error_details import ErrorDetails + from .error import Error + from .azure_async_operation_result import AzureAsyncOperationResult + from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule import EffectiveNetworkSecurityRule + from .effective_network_security_group import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult + from .effective_route import EffectiveRoute + from .effective_route_list_result import EffectiveRouteListResult + from .network_watcher import NetworkWatcher + from .topology_parameters import TopologyParameters + from .topology_association import TopologyAssociation + from .topology_resource import TopologyResource + from .topology import Topology + from .verification_ip_flow_parameters import VerificationIPFlowParameters + from .verification_ip_flow_result import VerificationIPFlowResult + from .next_hop_parameters import NextHopParameters + from .next_hop_result import NextHopResult + from .security_group_view_parameters import SecurityGroupViewParameters + from .network_interface_association import NetworkInterfaceAssociation + from .subnet_association import SubnetAssociation + from .security_rule_associations import SecurityRuleAssociations + from .security_group_network_interface import SecurityGroupNetworkInterface + from .security_group_view_result import SecurityGroupViewResult + from .packet_capture_storage_location import PacketCaptureStorageLocation + from .packet_capture_filter import PacketCaptureFilter + from .packet_capture_parameters import PacketCaptureParameters + from .packet_capture import PacketCapture + from .packet_capture_result import PacketCaptureResult + from .packet_capture_query_status_result import PacketCaptureQueryStatusResult + from .troubleshooting_parameters import TroubleshootingParameters + from .query_troubleshooting_parameters import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions + from .troubleshooting_details import TroubleshootingDetails + from .troubleshooting_result import TroubleshootingResult + from .retention_policy_parameters import RetentionPolicyParameters + from .flow_log_status_parameters import FlowLogStatusParameters + from .flow_log_information import FlowLogInformation + from .connectivity_source import ConnectivitySource + from .connectivity_destination import ConnectivityDestination + from .connectivity_parameters import ConnectivityParameters + from .connectivity_issue import ConnectivityIssue + from .connectivity_hop import ConnectivityHop + from .connectivity_information import ConnectivityInformation + from .patch_route_filter_rule import PatchRouteFilterRule + from .patch_route_filter import PatchRouteFilter + from .bgp_community import BGPCommunity + from .bgp_service_community import BgpServiceCommunity + from .usage_name import UsageName + from .usage import Usage + from .virtual_network_peering import VirtualNetworkPeering + from .address_space import AddressSpace + from .dhcp_options import DhcpOptions + from .virtual_network import VirtualNetwork + from .ip_address_availability_result import IPAddressAvailabilityResult + from .virtual_network_usage_name import VirtualNetworkUsageName + from .virtual_network_usage import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku import VirtualNetworkGatewaySku + from .vpn_client_root_certificate import VpnClientRootCertificate + from .vpn_client_revoked_certificate import VpnClientRevokedCertificate + from .vpn_client_configuration import VpnClientConfiguration + from .bgp_settings import BgpSettings + from .bgp_peer_status import BgpPeerStatus + from .gateway_route import GatewayRoute + from .virtual_network_gateway import VirtualNetworkGateway + from .vpn_client_parameters import VpnClientParameters + from .bgp_peer_status_list_result import BgpPeerStatusListResult + from .gateway_route_list_result import GatewayRouteListResult + from .tunnel_connection_health import TunnelConnectionHealth + from .local_network_gateway import LocalNetworkGateway + from .ipsec_policy import IpsecPolicy + from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection + from .connection_reset_shared_key import ConnectionResetSharedKey + from .connection_shared_key import ConnectionSharedKey + from .virtual_network_connection_gateway_reference import VirtualNetworkConnectionGatewayReference + from .virtual_network_gateway_connection_list_entity import VirtualNetworkGatewayConnectionListEntity from .application_gateway_paged import ApplicationGatewayPaged from .application_gateway_ssl_predefined_policy_paged import ApplicationGatewaySslPredefinedPolicyPaged from .endpoint_service_result_paged import EndpointServiceResultPaged diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/address_space.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/address_space.py index d7050c78a457..fbf42c9e0ade 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/address_space.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/address_space.py @@ -25,6 +25,6 @@ class AddressSpace(Model): 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, } - def __init__(self, address_prefixes=None): - super(AddressSpace, self).__init__() - self.address_prefixes = address_prefixes + def __init__(self, **kwargs): + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = kwargs.get('address_prefixes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/address_space_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/address_space_py3.py new file mode 100644 index 000000000000..9794cc805efa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/address_space_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AddressSpace(Model): + """AddressSpace contains an array of IP address ranges that can be used by + subnets of the virtual network. + + :param address_prefixes: A list of address blocks reserved for this + virtual network in CIDR notation. + :type address_prefixes: list[str] + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__(self, *, address_prefixes=None, **kwargs) -> None: + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = address_prefixes diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway.py index 69aac100e9ff..5962fb8d186e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway.py @@ -130,24 +130,24 @@ class ApplicationGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, redirect_configurations=None, web_application_firewall_configuration=None, resource_guid=None, provisioning_state=None, etag=None): - super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.ssl_policy = ssl_policy + def __init__(self, **kwargs): + super(ApplicationGateway, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.ssl_policy = kwargs.get('ssl_policy', None) self.operational_state = None - self.gateway_ip_configurations = gateway_ip_configurations - self.authentication_certificates = authentication_certificates - self.ssl_certificates = ssl_certificates - self.frontend_ip_configurations = frontend_ip_configurations - self.frontend_ports = frontend_ports - self.probes = probes - self.backend_address_pools = backend_address_pools - self.backend_http_settings_collection = backend_http_settings_collection - self.http_listeners = http_listeners - self.url_path_maps = url_path_maps - self.request_routing_rules = request_routing_rules - self.redirect_configurations = redirect_configurations - self.web_application_firewall_configuration = web_application_firewall_configuration - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.gateway_ip_configurations = kwargs.get('gateway_ip_configurations', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.ssl_certificates = kwargs.get('ssl_certificates', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.frontend_ports = kwargs.get('frontend_ports', None) + self.probes = kwargs.get('probes', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) + self.http_listeners = kwargs.get('http_listeners', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.redirect_configurations = kwargs.get('redirect_configurations', None) + self.web_application_firewall_configuration = kwargs.get('web_application_firewall_configuration', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_authentication_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_authentication_certificate.py index 18f36b7401a7..dff594340e59 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_authentication_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_authentication_certificate.py @@ -42,10 +42,10 @@ class ApplicationGatewayAuthenticationCertificate(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, data=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id) - self.data = data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayAuthenticationCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_authentication_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_authentication_certificate_py3.py new file mode 100644 index 000000000000..f31145eb222c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_authentication_certificate_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayAuthenticationCertificate(SubResource): + """Authentication certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Certificate public data. + :type data: str + :param provisioning_state: Provisioning state of the authentication + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_ssl_options.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_ssl_options.py index ac0bbd80ff0a..5893d09efffc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_ssl_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_ssl_options.py @@ -62,9 +62,9 @@ class ApplicationGatewayAvailableSslOptions(Resource): 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, } - def __init__(self, id=None, location=None, tags=None, predefined_policies=None, default_policy=None, available_cipher_suites=None, available_protocols=None): - super(ApplicationGatewayAvailableSslOptions, self).__init__(id=id, location=location, tags=tags) - self.predefined_policies = predefined_policies - self.default_policy = default_policy - self.available_cipher_suites = available_cipher_suites - self.available_protocols = available_protocols + def __init__(self, **kwargs): + super(ApplicationGatewayAvailableSslOptions, self).__init__(**kwargs) + self.predefined_policies = kwargs.get('predefined_policies', None) + self.default_policy = kwargs.get('default_policy', None) + self.available_cipher_suites = kwargs.get('available_cipher_suites', None) + self.available_protocols = kwargs.get('available_protocols', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_ssl_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_ssl_options_py3.py new file mode 100644 index 000000000000..c90e8ef76535 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_ssl_options_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayAvailableSslOptions(Resource): + """Response for ApplicationGatewayAvailableSslOptions API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param predefined_policies: List of available Ssl predefined policy. + :type predefined_policies: + list[~azure.mgmt.network.v2017_08_01.models.SubResource] + :param default_policy: Name of the Ssl predefined policy applied by + default to application gateway. Possible values include: + 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type default_policy: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPolicyName + :param available_cipher_suites: List of available Ssl cipher suites. + :type available_cipher_suites: list[str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslCipherSuite] + :param available_protocols: List of available Ssl protocols. + :type available_protocols: list[str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslProtocol] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'predefined_policies': {'key': 'properties.predefinedPolicies', 'type': '[SubResource]'}, + 'default_policy': {'key': 'properties.defaultPolicy', 'type': 'str'}, + 'available_cipher_suites': {'key': 'properties.availableCipherSuites', 'type': '[str]'}, + 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, predefined_policies=None, default_policy=None, available_cipher_suites=None, available_protocols=None, **kwargs) -> None: + super(ApplicationGatewayAvailableSslOptions, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.predefined_policies = predefined_policies + self.default_policy = default_policy + self.available_cipher_suites = available_cipher_suites + self.available_protocols = available_protocols diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_waf_rule_sets_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_waf_rule_sets_result.py index 9b04bae8599d..7a39df35d365 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_waf_rule_sets_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_waf_rule_sets_result.py @@ -24,6 +24,6 @@ class ApplicationGatewayAvailableWafRuleSetsResult(Model): 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, } - def __init__(self, value=None): - super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_waf_rule_sets_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_waf_rule_sets_result_py3.py new file mode 100644 index 000000000000..bca9da2edeb6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_available_waf_rule_sets_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayAvailableWafRuleSetsResult(Model): + """Response for ApplicationGatewayAvailableWafRuleSets API service call. + + :param value: The list of application gateway rule sets. + :type value: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallRuleSet] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address.py index 6005027d0845..e7a61fe1705c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address.py @@ -26,7 +26,7 @@ class ApplicationGatewayBackendAddress(Model): 'ip_address': {'key': 'ipAddress', 'type': 'str'}, } - def __init__(self, fqdn=None, ip_address=None): - super(ApplicationGatewayBackendAddress, self).__init__() - self.fqdn = fqdn - self.ip_address = ip_address + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = kwargs.get('fqdn', None) + self.ip_address = kwargs.get('ip_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address_pool.py index bc67eea8977b..54366b4c308a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address_pool.py @@ -47,11 +47,11 @@ class ApplicationGatewayBackendAddressPool(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayBackendAddressPool, self).__init__(id=id) - self.backend_ip_configurations = backend_ip_configurations - self.backend_addresses = backend_addresses - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddressPool, self).__init__(**kwargs) + self.backend_ip_configurations = kwargs.get('backend_ip_configurations', None) + self.backend_addresses = kwargs.get('backend_addresses', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address_pool_py3.py new file mode 100644 index 000000000000..acb439e14191 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address_pool_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + :param id: Resource ID. + :type id: str + :param backend_ip_configurations: Collection of references to IPs defined + in network interfaces. + :type backend_ip_configurations: + list[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses + :type backend_addresses: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendAddress] + :param provisioning_state: Provisioning state of the backend address pool + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Resource that is unique within a resource group. This name + can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = backend_ip_configurations + self.backend_addresses = backend_addresses + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address_py3.py new file mode 100644 index 000000000000..d18e476244d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_address_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendAddress(Model): + """Backend address of an application gateway. + + :param fqdn: Fully qualified domain name (FQDN). + :type fqdn: str + :param ip_address: IP address + :type ip_address: str + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__(self, *, fqdn: str=None, ip_address: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = fqdn + self.ip_address = ip_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health.py index 8901f0ecbcb4..31c3f0e93f7d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health.py @@ -24,6 +24,6 @@ class ApplicationGatewayBackendHealth(Model): 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, } - def __init__(self, backend_address_pools=None): - super(ApplicationGatewayBackendHealth, self).__init__() - self.backend_address_pools = backend_address_pools + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = kwargs.get('backend_address_pools', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_http_settings.py index 4be41a52ee4a..0214b930d565 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_http_settings.py @@ -29,7 +29,7 @@ class ApplicationGatewayBackendHealthHttpSettings(Model): 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, } - def __init__(self, backend_http_settings=None, servers=None): - super(ApplicationGatewayBackendHealthHttpSettings, self).__init__() - self.backend_http_settings = backend_http_settings - self.servers = servers + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.servers = kwargs.get('servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_http_settings_py3.py new file mode 100644 index 000000000000..e6c73c489ee5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_http_settings_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthHttpSettings(Model): + """Application gateway BackendHealthHttp settings. + + :param backend_http_settings: Reference of an + ApplicationGatewayBackendHttpSettings resource. + :type backend_http_settings: + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealthServer] + """ + + _attribute_map = { + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, + 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, + } + + def __init__(self, *, backend_http_settings=None, servers=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = backend_http_settings + self.servers = servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_pool.py index 581029a36de8..65f2ff34ac9a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_pool.py @@ -30,7 +30,7 @@ class ApplicationGatewayBackendHealthPool(Model): 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, } - def __init__(self, backend_address_pool=None, backend_http_settings_collection=None): - super(ApplicationGatewayBackendHealthPool, self).__init__() - self.backend_address_pool = backend_address_pool - self.backend_http_settings_collection = backend_http_settings_collection + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_pool_py3.py new file mode 100644 index 000000000000..f8ffabf70cd2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_pool_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthPool(Model): + """Application gateway BackendHealth pool. + + :param backend_address_pool: Reference of an + ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of + ApplicationGatewayBackendHealthHttpSettings resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, + } + + def __init__(self, *, backend_address_pool=None, backend_http_settings_collection=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_http_settings_collection = backend_http_settings_collection diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_py3.py new file mode 100644 index 000000000000..4335ec06047b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealth(Model): + """List of ApplicationGatewayBackendHealthPool resources. + + :param backend_address_pools: + :type backend_address_pools: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealthPool] + """ + + _attribute_map = { + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, + } + + def __init__(self, *, backend_address_pools=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = backend_address_pools diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_server.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_server.py index cb2e480ec405..1c253afde343 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_server.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_server.py @@ -32,8 +32,8 @@ class ApplicationGatewayBackendHealthServer(Model): 'health': {'key': 'health', 'type': 'str'}, } - def __init__(self, address=None, ip_configuration=None, health=None): - super(ApplicationGatewayBackendHealthServer, self).__init__() - self.address = address - self.ip_configuration = ip_configuration - self.health = health + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + self.ip_configuration = kwargs.get('ip_configuration', None) + self.health = kwargs.get('health', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_server_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_server_py3.py new file mode 100644 index 000000000000..636560adb6d0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_health_server_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthServer(Model): + """Application gateway backendhealth http settings. + + :param address: IP address or FQDN of backend server. + :type address: str + :param ip_configuration: Reference of IP configuration of backend server. + :type ip_configuration: + ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration + :param health: Health of backend server. Possible values include: + 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + :type health: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealthServerHealth + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'health': {'key': 'health', 'type': 'str'}, + } + + def __init__(self, *, address: str=None, ip_configuration=None, health=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = address + self.ip_configuration = ip_configuration + self.health = health diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_http_settings.py index c966ef12fb6c..bae8486fd37a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_http_settings.py @@ -87,21 +87,21 @@ class ApplicationGatewayBackendHttpSettings(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, port=None, protocol=None, cookie_based_affinity=None, request_timeout=None, probe=None, authentication_certificates=None, connection_draining=None, host_name=None, pick_host_name_from_backend_address=None, affinity_cookie_name=None, probe_enabled=None, path=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id) - self.port = port - self.protocol = protocol - self.cookie_based_affinity = cookie_based_affinity - self.request_timeout = request_timeout - self.probe = probe - self.authentication_certificates = authentication_certificates - self.connection_draining = connection_draining - self.host_name = host_name - self.pick_host_name_from_backend_address = pick_host_name_from_backend_address - self.affinity_cookie_name = affinity_cookie_name - self.probe_enabled = probe_enabled - self.path = path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHttpSettings, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.protocol = kwargs.get('protocol', None) + self.cookie_based_affinity = kwargs.get('cookie_based_affinity', None) + self.request_timeout = kwargs.get('request_timeout', None) + self.probe = kwargs.get('probe', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.connection_draining = kwargs.get('connection_draining', None) + self.host_name = kwargs.get('host_name', None) + self.pick_host_name_from_backend_address = kwargs.get('pick_host_name_from_backend_address', None) + self.affinity_cookie_name = kwargs.get('affinity_cookie_name', None) + self.probe_enabled = kwargs.get('probe_enabled', None) + self.path = kwargs.get('path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_http_settings_py3.py new file mode 100644 index 000000000000..6c8708c26c05 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_backend_http_settings_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendHttpSettings(SubResource): + """Backend address pool settings of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Port + :type port: int + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProtocol + :param cookie_based_affinity: Cookie based affinity. Possible values + include: 'Enabled', 'Disabled' + :type cookie_based_affinity: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayCookieBasedAffinity + :param request_timeout: Request timeout in seconds. Application Gateway + will fail the request if response is not received within RequestTimeout. + Acceptable values are from 1 second to 86400 seconds. + :type request_timeout: int + :param probe: Probe resource of an application gateway. + :type probe: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param authentication_certificates: Array of references to application + gateway authentication certificates. + :type authentication_certificates: + list[~azure.mgmt.network.v2017_08_01.models.SubResource] + :param connection_draining: Connection draining of the backend http + settings resource. + :type connection_draining: + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayConnectionDraining + :param host_name: Host header to be sent to the backend servers. + :type host_name: str + :param pick_host_name_from_backend_address: Whether to pick host header + should be picked from the host name of the backend server. Default value + is false. + :type pick_host_name_from_backend_address: bool + :param affinity_cookie_name: Cookie name to use for the affinity cookie. + :type affinity_cookie_name: str + :param probe_enabled: Whether the probe is enabled. Default value is + false. + :type probe_enabled: bool + :param path: Path which should be used as a prefix for all HTTP requests. + Null means no path will be prefixed. Default value is null. + :type path: str + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, + 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, + 'connection_draining': {'key': 'properties.connectionDraining', 'type': 'ApplicationGatewayConnectionDraining'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'pick_host_name_from_backend_address': {'key': 'properties.pickHostNameFromBackendAddress', 'type': 'bool'}, + 'affinity_cookie_name': {'key': 'properties.affinityCookieName', 'type': 'str'}, + 'probe_enabled': {'key': 'properties.probeEnabled', 'type': 'bool'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, protocol=None, cookie_based_affinity=None, request_timeout: int=None, probe=None, authentication_certificates=None, connection_draining=None, host_name: str=None, pick_host_name_from_backend_address: bool=None, affinity_cookie_name: str=None, probe_enabled: bool=None, path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id, **kwargs) + self.port = port + self.protocol = protocol + self.cookie_based_affinity = cookie_based_affinity + self.request_timeout = request_timeout + self.probe = probe + self.authentication_certificates = authentication_certificates + self.connection_draining = connection_draining + self.host_name = host_name + self.pick_host_name_from_backend_address = pick_host_name_from_backend_address + self.affinity_cookie_name = affinity_cookie_name + self.probe_enabled = probe_enabled + self.path = path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_connection_draining.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_connection_draining.py index 8f9b88b571e2..531b3cb05dd3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_connection_draining.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_connection_draining.py @@ -17,10 +17,12 @@ class ApplicationGatewayConnectionDraining(Model): active for a specified time after the backend server got removed from the configuration. - :param enabled: Whether connection draining is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. :type enabled: bool - :param drain_timeout_in_sec: The number of seconds connection draining is - active. Acceptable values are from 1 second to 3600 seconds. + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. :type drain_timeout_in_sec: int """ @@ -34,7 +36,7 @@ class ApplicationGatewayConnectionDraining(Model): 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, } - def __init__(self, enabled, drain_timeout_in_sec): - super(ApplicationGatewayConnectionDraining, self).__init__() - self.enabled = enabled - self.drain_timeout_in_sec = drain_timeout_in_sec + def __init__(self, **kwargs): + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.drain_timeout_in_sec = kwargs.get('drain_timeout_in_sec', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_connection_draining_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_connection_draining_py3.py new file mode 100644 index 000000000000..c46fb01cae72 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_connection_draining_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayConnectionDraining(Model): + """Connection draining allows open connections to a backend server to be + active for a specified time after the backend server got removed from the + configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. + :type enabled: bool + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. + :type drain_timeout_in_sec: int + """ + + _validation = { + 'enabled': {'required': True}, + 'drain_timeout_in_sec': {'required': True, 'maximum': 3600, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool, drain_timeout_in_sec: int, **kwargs) -> None: + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = enabled + self.drain_timeout_in_sec = drain_timeout_in_sec diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_disabled_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_disabled_rule_group.py index 02c88980e857..085ae3d78c5c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_disabled_rule_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_disabled_rule_group.py @@ -15,7 +15,10 @@ class ApplicationGatewayFirewallDisabledRuleGroup(Model): """Allows to disable rules within a rule group or an entire rule group. - :param rule_group_name: The name of the rule group that will be disabled. + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. :type rule_group_name: str :param rules: The list of rules that will be disabled. If null, all rules of the rule group will be disabled. @@ -31,7 +34,7 @@ class ApplicationGatewayFirewallDisabledRuleGroup(Model): 'rules': {'key': 'rules', 'type': '[int]'}, } - def __init__(self, rule_group_name, rules=None): - super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__() - self.rule_group_name = rule_group_name - self.rules = rules + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_disabled_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_disabled_rule_group_py3.py new file mode 100644 index 000000000000..44ac696b801c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_disabled_rule_group_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallDisabledRuleGroup(Model): + """Allows to disable rules within a rule group or an entire rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. + :type rule_group_name: str + :param rules: The list of rules that will be disabled. If null, all rules + of the rule group will be disabled. + :type rules: list[int] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[int]'}, + } + + def __init__(self, *, rule_group_name: str, rules=None, **kwargs) -> None: + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule.py index f3f7da7cc11b..661b0d146e16 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule.py @@ -15,7 +15,10 @@ class ApplicationGatewayFirewallRule(Model): """A web application firewall rule. - :param rule_id: The identifier of the web application firewall rule. + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. :type rule_id: int :param description: The description of the web application firewall rule. :type description: str @@ -30,7 +33,7 @@ class ApplicationGatewayFirewallRule(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, rule_id, description=None): - super(ApplicationGatewayFirewallRule, self).__init__() - self.rule_id = rule_id - self.description = description + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_group.py index a8d7389128ba..01ce8b2f4f64 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_group.py @@ -15,13 +15,16 @@ class ApplicationGatewayFirewallRuleGroup(Model): """A web application firewall rule group. - :param rule_group_name: The name of the web application firewall rule - group. + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. :type rule_group_name: str :param description: The description of the web application firewall rule group. :type description: str - :param rules: The rules of the web application firewall rule group. + :param rules: Required. The rules of the web application firewall rule + group. :type rules: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallRule] """ @@ -37,8 +40,8 @@ class ApplicationGatewayFirewallRuleGroup(Model): 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, } - def __init__(self, rule_group_name, rules, description=None): - super(ApplicationGatewayFirewallRuleGroup, self).__init__() - self.rule_group_name = rule_group_name - self.description = description - self.rules = rules + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.description = kwargs.get('description', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_group_py3.py new file mode 100644 index 000000000000..bf808541841e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_group_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRuleGroup(Model): + """A web application firewall rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. + :type rule_group_name: str + :param description: The description of the web application firewall rule + group. + :type description: str + :param rules: Required. The rules of the web application firewall rule + group. + :type rules: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallRule] + """ + + _validation = { + 'rule_group_name': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, + } + + def __init__(self, *, rule_group_name: str, rules, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.description = description + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_py3.py new file mode 100644 index 000000000000..e332fbd16853 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRule(Model): + """A web application firewall rule. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. + :type rule_id: int + :param description: The description of the web application firewall rule. + :type description: str + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, rule_id: int, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = rule_id + self.description = description diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_set.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_set.py index aa203e354223..75da72f7cafb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_set.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_set.py @@ -18,6 +18,8 @@ class ApplicationGatewayFirewallRuleSet(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -31,13 +33,14 @@ class ApplicationGatewayFirewallRuleSet(Resource): :param provisioning_state: The provisioning state of the web application firewall rule set. :type provisioning_state: str - :param rule_set_type: The type of the web application firewall rule set. + :param rule_set_type: Required. The type of the web application firewall + rule set. :type rule_set_type: str - :param rule_set_version: The version of the web application firewall rule - set type. + :param rule_set_version: Required. The version of the web application + firewall rule set type. :type rule_set_version: str - :param rule_groups: The rule groups of the web application firewall rule - set. + :param rule_groups: Required. The rule groups of the web application + firewall rule set. :type rule_groups: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallRuleGroup] """ @@ -62,9 +65,9 @@ class ApplicationGatewayFirewallRuleSet(Resource): 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, } - def __init__(self, rule_set_type, rule_set_version, rule_groups, id=None, location=None, tags=None, provisioning_state=None): - super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags) - self.provisioning_state = provisioning_state - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.rule_groups = rule_groups + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleSet, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.rule_groups = kwargs.get('rule_groups', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_set_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_set_py3.py new file mode 100644 index 000000000000..d51e235e4e57 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_firewall_rule_set_py3.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayFirewallRuleSet(Resource): + """A web application firewall rule set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param provisioning_state: The provisioning state of the web application + firewall rule set. + :type provisioning_state: str + :param rule_set_type: Required. The type of the web application firewall + rule set. + :type rule_set_type: str + :param rule_set_version: Required. The version of the web application + firewall rule set type. + :type rule_set_version: str + :param rule_groups: Required. The rule groups of the web application + firewall rule set. + :type rule_groups: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallRuleGroup] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'rule_groups': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, + } + + def __init__(self, *, rule_set_type: str, rule_set_version: str, rule_groups, id: str=None, location: str=None, tags=None, provisioning_state: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.rule_groups = rule_groups diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_ip_configuration.py index b03825f55e46..8751fdb2c9ce 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_ip_configuration.py @@ -54,13 +54,13 @@ class ApplicationGatewayFrontendIPConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..364fea36c2f5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_ip_configuration_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): + """Frontend IP configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param private_ip_address: PrivateIPAddress of the network interface IP + Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: PrivateIP allocation method. Possible + values include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod + :param subnet: Reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param provisioning_state: Provisioning state of the public IP resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_port.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_port.py index 2b1b32d1b79e..318c0554db0a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_port.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_port.py @@ -41,10 +41,10 @@ class ApplicationGatewayFrontendPort(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, port=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayFrontendPort, self).__init__(id=id) - self.port = port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendPort, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_port_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_port_py3.py new file mode 100644 index 000000000000..03c6c0a31e9c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_frontend_port_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Frontend port + :type port: int + :param provisioning_state: Provisioning state of the frontend port + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendPort, self).__init__(id=id, **kwargs) + self.port = port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_http_listener.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_http_listener.py index 353dba903d88..e796534d641f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_http_listener.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_http_listener.py @@ -61,15 +61,15 @@ class ApplicationGatewayHttpListener(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name=None, ssl_certificate=None, require_server_name_indication=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayHttpListener, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.frontend_port = frontend_port - self.protocol = protocol - self.host_name = host_name - self.ssl_certificate = ssl_certificate - self.require_server_name_indication = require_server_name_indication - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayHttpListener, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.protocol = kwargs.get('protocol', None) + self.host_name = kwargs.get('host_name', None) + self.ssl_certificate = kwargs.get('ssl_certificate', None) + self.require_server_name_indication = kwargs.get('require_server_name_indication', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_http_listener_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_http_listener_py3.py new file mode 100644 index 000000000000..ee78ca402c29 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_http_listener_py3.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayHttpListener(SubResource): + """Http listener of an application gateway. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: Frontend IP configuration resource of an + application gateway. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProtocol + :param host_name: Host name of HTTP listener. + :type host_name: str + :param ssl_certificate: SSL certificate resource of an application + gateway. + :type ssl_certificate: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param require_server_name_indication: Applicable only if protocol is + https. Enables SNI for multi-hosting. + :type require_server_name_indication: bool + :param provisioning_state: Provisioning state of the HTTP listener + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, + 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name: str=None, ssl_certificate=None, require_server_name_indication: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayHttpListener, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.frontend_port = frontend_port + self.protocol = protocol + self.host_name = host_name + self.ssl_certificate = ssl_certificate + self.require_server_name_indication = require_server_name_indication + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ip_configuration.py index 834a40beb754..9e98c8ed7b6c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ip_configuration.py @@ -44,10 +44,10 @@ class ApplicationGatewayIPConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, subnet=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayIPConfiguration, self).__init__(id=id) - self.subnet = subnet - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayIPConfiguration, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..ca5393fa3904 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ip_configuration_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 + private IP configuration is allowed. + + :param id: Resource ID. + :type id: str + :param subnet: Reference of the subnet resource. A subnet from where + application gateway gets its private address. + :type subnet: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param provisioning_state: Provisioning state of the application gateway + subnet resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, subnet=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.subnet = subnet + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_path_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_path_rule.py index dd3ca65727a0..2994e12fa8e0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_path_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_path_rule.py @@ -56,13 +56,13 @@ class ApplicationGatewayPathRule(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, paths=None, backend_address_pool=None, backend_http_settings=None, redirect_configuration=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayPathRule, self).__init__(id=id) - self.paths = paths - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.redirect_configuration = redirect_configuration - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayPathRule, self).__init__(**kwargs) + self.paths = kwargs.get('paths', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_path_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_path_rule_py3.py new file mode 100644 index 000000000000..b9e529643dae --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_path_rule_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayPathRule(SubResource): + """Path rule of URL path map of an application gateway. + + :param id: Resource ID. + :type id: str + :param paths: Path rules of URL path map. + :type paths: list[str] + :param backend_address_pool: Backend address pool resource of URL path map + path rule. + :type backend_address_pool: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param backend_http_settings: Backend http settings resource of URL path + map path rule. + :type backend_http_settings: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of URL path + map path rule. + :type redirect_configuration: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param provisioning_state: Path rule of URL path map resource. Possible + values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'paths': {'key': 'properties.paths', 'type': '[str]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, paths=None, backend_address_pool=None, backend_http_settings=None, redirect_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayPathRule, self).__init__(id=id, **kwargs) + self.paths = paths + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.redirect_configuration = redirect_configuration + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe.py index effe7040af47..799a2d12f438 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe.py @@ -76,18 +76,18 @@ class ApplicationGatewayProbe(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, protocol=None, host=None, path=None, interval=None, timeout=None, unhealthy_threshold=None, pick_host_name_from_backend_http_settings=None, min_servers=None, match=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayProbe, self).__init__(id=id) - self.protocol = protocol - self.host = host - self.path = path - self.interval = interval - self.timeout = timeout - self.unhealthy_threshold = unhealthy_threshold - self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings - self.min_servers = min_servers - self.match = match - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayProbe, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.host = kwargs.get('host', None) + self.path = kwargs.get('path', None) + self.interval = kwargs.get('interval', None) + self.timeout = kwargs.get('timeout', None) + self.unhealthy_threshold = kwargs.get('unhealthy_threshold', None) + self.pick_host_name_from_backend_http_settings = kwargs.get('pick_host_name_from_backend_http_settings', None) + self.min_servers = kwargs.get('min_servers', None) + self.match = kwargs.get('match', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe_health_response_match.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe_health_response_match.py index beaef556eb99..b439b9677f8b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe_health_response_match.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe_health_response_match.py @@ -28,7 +28,7 @@ class ApplicationGatewayProbeHealthResponseMatch(Model): 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, } - def __init__(self, body=None, status_codes=None): - super(ApplicationGatewayProbeHealthResponseMatch, self).__init__() - self.body = body - self.status_codes = status_codes + def __init__(self, **kwargs): + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = kwargs.get('body', None) + self.status_codes = kwargs.get('status_codes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe_health_response_match_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe_health_response_match_py3.py new file mode 100644 index 000000000000..6ed2ee8c04ed --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe_health_response_match_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayProbeHealthResponseMatch(Model): + """Application gateway probe health response match. + + :param body: Body that must be contained in the health response. Default + value is empty. + :type body: str + :param status_codes: Allowed ranges of healthy status codes. Default range + of healthy status codes is 200-399. + :type status_codes: list[str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'str'}, + 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, + } + + def __init__(self, *, body: str=None, status_codes=None, **kwargs) -> None: + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = body + self.status_codes = status_codes diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe_py3.py new file mode 100644 index 000000000000..9ee9ff6588f3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayProbe(SubResource): + """Probe of the application gateway. + + :param id: Resource ID. + :type id: str + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is + sent to ://: + :type path: str + :param interval: The probing interval in seconds. This is the time + interval between two consecutive probes. Acceptable values are from 1 + second to 86400 seconds. + :type interval: int + :param timeout: the probe timeout in seconds. Probe marked as failed if + valid response is not received with this timeout period. Acceptable values + are from 1 second to 86400 seconds. + :type timeout: int + :param unhealthy_threshold: The probe retry count. Backend server is + marked down after consecutive probe failure count reaches + UnhealthyThreshold. Acceptable values are from 1 second to 20. + :type unhealthy_threshold: int + :param pick_host_name_from_backend_http_settings: Whether the host header + should be picked from the backend http settings. Default value is false. + :type pick_host_name_from_backend_http_settings: bool + :param min_servers: Minimum number of servers that are always marked + healthy. Default value is 0. + :type min_servers: int + :param match: Criterion for classifying a healthy probe response. + :type match: + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProbeHealthResponseMatch + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host': {'key': 'properties.host', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, + 'pick_host_name_from_backend_http_settings': {'key': 'properties.pickHostNameFromBackendHttpSettings', 'type': 'bool'}, + 'min_servers': {'key': 'properties.minServers', 'type': 'int'}, + 'match': {'key': 'properties.match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, protocol=None, host: str=None, path: str=None, interval: int=None, timeout: int=None, unhealthy_threshold: int=None, pick_host_name_from_backend_http_settings: bool=None, min_servers: int=None, match=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayProbe, self).__init__(id=id, **kwargs) + self.protocol = protocol + self.host = host + self.path = path + self.interval = interval + self.timeout = timeout + self.unhealthy_threshold = unhealthy_threshold + self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings + self.min_servers = min_servers + self.match = match + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_py3.py new file mode 100644 index 000000000000..7a0fc5f51dc7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_py3.py @@ -0,0 +1,153 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGateway(Resource): + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPolicy + :ivar operational_state: Operational state of the application gateway + resource. Possible values include: 'Stopped', 'Starting', 'Running', + 'Stopping' + :vartype operational_state: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayOperationalState + :param gateway_ip_configurations: Subnets of application the gateway + resource. + :type gateway_ip_configurations: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayIPConfiguration] + :param authentication_certificates: Authentication certificates of the + application gateway resource. + :type authentication_certificates: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAuthenticationCertificate] + :param ssl_certificates: SSL certificates of the application gateway + resource. + :type ssl_certificates: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslCertificate] + :param frontend_ip_configurations: Frontend IP addresses of the + application gateway resource. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFrontendIPConfiguration] + :param frontend_ports: Frontend ports of the application gateway resource. + :type frontend_ports: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProbe] + :param backend_address_pools: Backend address pool of the application + gateway resource. + :type backend_address_pools: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendAddressPool] + :param backend_http_settings_collection: Backend http settings of the + application gateway resource. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHttpSettings] + :param http_listeners: Http listeners of the application gateway resource. + :type http_listeners: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayHttpListener] + :param url_path_maps: URL path map of the application gateway resource. + :type url_path_maps: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application + gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayRequestRoutingRule] + :param redirect_configurations: Redirect configurations of the application + gateway resource. + :type redirect_configurations: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayRedirectConfiguration] + :param web_application_firewall_configuration: Web application firewall + configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param resource_guid: Resource GUID property of the application gateway + resource. + :type resource_guid: str + :param provisioning_state: Provisioning state of the application gateway + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operational_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, + 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, + 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, + 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, + 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, + 'redirect_configurations': {'key': 'properties.redirectConfigurations', 'type': '[ApplicationGatewayRedirectConfiguration]'}, + 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, redirect_configurations=None, web_application_firewall_configuration=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.ssl_policy = ssl_policy + self.operational_state = None + self.gateway_ip_configurations = gateway_ip_configurations + self.authentication_certificates = authentication_certificates + self.ssl_certificates = ssl_certificates + self.frontend_ip_configurations = frontend_ip_configurations + self.frontend_ports = frontend_ports + self.probes = probes + self.backend_address_pools = backend_address_pools + self.backend_http_settings_collection = backend_http_settings_collection + self.http_listeners = http_listeners + self.url_path_maps = url_path_maps + self.request_routing_rules = request_routing_rules + self.redirect_configurations = redirect_configurations + self.web_application_firewall_configuration = web_application_firewall_configuration + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_redirect_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_redirect_configuration.py index 21bbc7ed72a7..4764508ae26d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_redirect_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_redirect_configuration.py @@ -66,16 +66,16 @@ class ApplicationGatewayRedirectConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, redirect_type=None, target_listener=None, target_url=None, include_path=None, include_query_string=None, request_routing_rules=None, url_path_maps=None, path_rules=None, name=None, etag=None, type=None): - super(ApplicationGatewayRedirectConfiguration, self).__init__(id=id) - self.redirect_type = redirect_type - self.target_listener = target_listener - self.target_url = target_url - self.include_path = include_path - self.include_query_string = include_query_string - self.request_routing_rules = request_routing_rules - self.url_path_maps = url_path_maps - self.path_rules = path_rules - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayRedirectConfiguration, self).__init__(**kwargs) + self.redirect_type = kwargs.get('redirect_type', None) + self.target_listener = kwargs.get('target_listener', None) + self.target_url = kwargs.get('target_url', None) + self.include_path = kwargs.get('include_path', None) + self.include_query_string = kwargs.get('include_query_string', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.path_rules = kwargs.get('path_rules', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_redirect_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_redirect_configuration_py3.py new file mode 100644 index 000000000000..b55c6796fdbe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_redirect_configuration_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRedirectConfiguration(SubResource): + """Redirect configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param redirect_type: Supported http redirection types - Permanent, + Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', + 'SeeOther', 'Temporary' + :type redirect_type: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayRedirectType + :param target_listener: Reference to a listener to redirect the request + to. + :type target_listener: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param target_url: Url to redirect the request to. + :type target_url: str + :param include_path: Include path in the redirected url. + :type include_path: bool + :param include_query_string: Include query string in the redirected url. + :type include_query_string: bool + :param request_routing_rules: Request routing specifying redirect + configuration. + :type request_routing_rules: + list[~azure.mgmt.network.v2017_08_01.models.SubResource] + :param url_path_maps: Url path maps specifying default redirect + configuration. + :type url_path_maps: + list[~azure.mgmt.network.v2017_08_01.models.SubResource] + :param path_rules: Path rules specifying redirect configuration. + :type path_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'redirect_type': {'key': 'properties.redirectType', 'type': 'str'}, + 'target_listener': {'key': 'properties.targetListener', 'type': 'SubResource'}, + 'target_url': {'key': 'properties.targetUrl', 'type': 'str'}, + 'include_path': {'key': 'properties.includePath', 'type': 'bool'}, + 'include_query_string': {'key': 'properties.includeQueryString', 'type': 'bool'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[SubResource]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[SubResource]'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[SubResource]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, redirect_type=None, target_listener=None, target_url: str=None, include_path: bool=None, include_query_string: bool=None, request_routing_rules=None, url_path_maps=None, path_rules=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayRedirectConfiguration, self).__init__(id=id, **kwargs) + self.redirect_type = redirect_type + self.target_listener = target_listener + self.target_url = target_url + self.include_path = include_path + self.include_query_string = include_query_string + self.request_routing_rules = request_routing_rules + self.url_path_maps = url_path_maps + self.path_rules = path_rules + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_request_routing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_request_routing_rule.py index 6ce5d6e82a92..6b9cba0bf88e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_request_routing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_request_routing_rule.py @@ -64,15 +64,15 @@ class ApplicationGatewayRequestRoutingRule(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, redirect_configuration=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id) - self.rule_type = rule_type - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.http_listener = http_listener - self.url_path_map = url_path_map - self.redirect_configuration = redirect_configuration - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayRequestRoutingRule, self).__init__(**kwargs) + self.rule_type = kwargs.get('rule_type', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.http_listener = kwargs.get('http_listener', None) + self.url_path_map = kwargs.get('url_path_map', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_request_routing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_request_routing_rule_py3.py new file mode 100644 index 000000000000..980e368df8c9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_request_routing_rule_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRequestRoutingRule(SubResource): + """Request routing rule of an application gateway. + + :param id: Resource ID. + :type id: str + :param rule_type: Rule type. Possible values include: 'Basic', + 'PathBasedRouting' + :type rule_type: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayRequestRoutingRuleType + :param backend_address_pool: Backend address pool resource of the + application gateway. + :type backend_address_pool: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param backend_http_settings: Frontend port resource of the application + gateway. + :type backend_http_settings: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of the + application gateway. + :type redirect_configuration: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param provisioning_state: Provisioning state of the request routing rule + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, + 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, redirect_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id, **kwargs) + self.rule_type = rule_type + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.http_listener = http_listener + self.url_path_map = url_path_map + self.redirect_configuration = redirect_configuration + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_sku.py index f4278d416183..ef5ddb24c44d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_sku.py @@ -34,8 +34,8 @@ class ApplicationGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(ApplicationGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_sku_py3.py new file mode 100644 index 000000000000..2ca43f3d917c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_sku_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySku(Model): + """SKU of an application gateway. + + :param name: Name of an application gateway SKU. Possible values include: + 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', + 'WAF_Large' + :type name: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySkuName + :param tier: Tier of an application gateway. Possible values include: + 'Standard', 'WAF' + :type tier: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayTier + :param capacity: Capacity (instance count) of an application gateway. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_certificate.py index 104629e84a5c..1dfedd4908df 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_certificate.py @@ -50,12 +50,12 @@ class ApplicationGatewaySslCertificate(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, data=None, password=None, public_cert_data=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewaySslCertificate, self).__init__(id=id) - self.data = data - self.password = password - self.public_cert_data = public_cert_data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewaySslCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.password = kwargs.get('password', None) + self.public_cert_data = kwargs.get('public_cert_data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_certificate_py3.py new file mode 100644 index 000000000000..ddb6745c9005 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_certificate_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Base-64 encoded pfx certificate. Only applicable in PUT + Request. + :type data: str + :param password: Password for the pfx file specified in data. Only + applicable in PUT request. + :type password: str + :param public_cert_data: Base-64 encoded Public cert data corresponding to + pfx specified in data. Only applicable in GET request. + :type public_cert_data: str + :param provisioning_state: Provisioning state of the SSL certificate + resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, password: str=None, public_cert_data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewaySslCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.password = password + self.public_cert_data = public_cert_data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_policy.py index ede2e626fefc..8f4b76dd270b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_policy.py @@ -47,10 +47,10 @@ class ApplicationGatewaySslPolicy(Model): 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, } - def __init__(self, disabled_ssl_protocols=None, policy_type=None, policy_name=None, cipher_suites=None, min_protocol_version=None): - super(ApplicationGatewaySslPolicy, self).__init__() - self.disabled_ssl_protocols = disabled_ssl_protocols - self.policy_type = policy_type - self.policy_name = policy_name - self.cipher_suites = cipher_suites - self.min_protocol_version = min_protocol_version + def __init__(self, **kwargs): + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = kwargs.get('disabled_ssl_protocols', None) + self.policy_type = kwargs.get('policy_type', None) + self.policy_name = kwargs.get('policy_name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_policy_py3.py new file mode 100644 index 000000000000..d7796f7e8518 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_policy_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySslPolicy(Model): + """Application Gateway Ssl policy. + + :param disabled_ssl_protocols: Ssl protocols to be disabled on application + gateway. + :type disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslProtocol] + :param policy_type: Type of Ssl Policy. Possible values include: + 'Predefined', 'Custom' + :type policy_type: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPolicyType + :param policy_name: Name of Ssl predefined policy. Possible values + include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type policy_name: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPolicyName + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order to application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, + 'policy_type': {'key': 'policyType', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'cipher_suites': {'key': 'cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, *, disabled_ssl_protocols=None, policy_type=None, policy_name=None, cipher_suites=None, min_protocol_version=None, **kwargs) -> None: + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = disabled_ssl_protocols + self.policy_type = policy_type + self.policy_name = policy_name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_predefined_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_predefined_policy.py index 583cb9aaf08a..4ac726ce7855 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_predefined_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_predefined_policy.py @@ -37,8 +37,8 @@ class ApplicationGatewaySslPredefinedPolicy(SubResource): 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, } - def __init__(self, id=None, name=None, cipher_suites=None, min_protocol_version=None): - super(ApplicationGatewaySslPredefinedPolicy, self).__init__(id=id) - self.name = name - self.cipher_suites = cipher_suites - self.min_protocol_version = min_protocol_version + def __init__(self, **kwargs): + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_predefined_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_predefined_policy_py3.py new file mode 100644 index 000000000000..ddb58f5c301f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_ssl_predefined_policy_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslPredefinedPolicy(SubResource): + """An Ssl predefined policy. + + :param id: Resource ID. + :type id: str + :param name: Name of Ssl predefined policy. + :type name: str + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order for application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, cipher_suites=None, min_protocol_version=None, **kwargs) -> None: + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(id=id, **kwargs) + self.name = name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_url_path_map.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_url_path_map.py index 91c77f5cf0a4..034324017c4c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_url_path_map.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_url_path_map.py @@ -58,13 +58,13 @@ class ApplicationGatewayUrlPathMap(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, default_backend_address_pool=None, default_backend_http_settings=None, default_redirect_configuration=None, path_rules=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayUrlPathMap, self).__init__(id=id) - self.default_backend_address_pool = default_backend_address_pool - self.default_backend_http_settings = default_backend_http_settings - self.default_redirect_configuration = default_redirect_configuration - self.path_rules = path_rules - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayUrlPathMap, self).__init__(**kwargs) + self.default_backend_address_pool = kwargs.get('default_backend_address_pool', None) + self.default_backend_http_settings = kwargs.get('default_backend_http_settings', None) + self.default_redirect_configuration = kwargs.get('default_redirect_configuration', None) + self.path_rules = kwargs.get('path_rules', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_url_path_map_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_url_path_map_py3.py new file mode 100644 index 000000000000..dd7716b72476 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_url_path_map_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayUrlPathMap(SubResource): + """UrlPathMaps give a url path to the backend mapping information for + PathBasedRouting. + + :param id: Resource ID. + :type id: str + :param default_backend_address_pool: Default backend address pool resource + of URL path map. + :type default_backend_address_pool: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param default_backend_http_settings: Default backend http settings + resource of URL path map. + :type default_backend_http_settings: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param default_redirect_configuration: Default redirect configuration + resource of URL path map. + :type default_redirect_configuration: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayPathRule] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, + 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, + 'default_redirect_configuration': {'key': 'properties.defaultRedirectConfiguration', 'type': 'SubResource'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, default_backend_address_pool=None, default_backend_http_settings=None, default_redirect_configuration=None, path_rules=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayUrlPathMap, self).__init__(id=id, **kwargs) + self.default_backend_address_pool = default_backend_address_pool + self.default_backend_http_settings = default_backend_http_settings + self.default_redirect_configuration = default_redirect_configuration + self.path_rules = path_rules + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_web_application_firewall_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_web_application_firewall_configuration.py index 21506000e5f9..96a1a5e59815 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_web_application_firewall_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_web_application_firewall_configuration.py @@ -15,16 +15,19 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): """Application gateway web application firewall configuration. - :param enabled: Whether the web application firewall is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. :type enabled: bool - :param firewall_mode: Web application firewall mode. Possible values - include: 'Detection', 'Prevention' + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' :type firewall_mode: str or ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallMode - :param rule_set_type: The type of the web application firewall rule set. - Possible values are: 'OWASP'. + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. :type rule_set_type: str - :param rule_set_version: The version of the rule set type. + :param rule_set_version: Required. The version of the rule set type. :type rule_set_version: str :param disabled_rule_groups: The disabled rule groups. :type disabled_rule_groups: @@ -46,10 +49,10 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, } - def __init__(self, enabled, firewall_mode, rule_set_type, rule_set_version, disabled_rule_groups=None): - super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__() - self.enabled = enabled - self.firewall_mode = firewall_mode - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.disabled_rule_groups = disabled_rule_groups + def __init__(self, **kwargs): + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.firewall_mode = kwargs.get('firewall_mode', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.disabled_rule_groups = kwargs.get('disabled_rule_groups', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_web_application_firewall_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_web_application_firewall_configuration_py3.py new file mode 100644 index 000000000000..c56d964356b8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/application_gateway_web_application_firewall_configuration_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayWebApplicationFirewallConfiguration(Model): + """Application gateway web application firewall configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. + :type enabled: bool + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' + :type firewall_mode: str or + ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallMode + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. + :type rule_set_type: str + :param rule_set_version: Required. The version of the rule set type. + :type rule_set_version: str + :param disabled_rule_groups: The disabled rule groups. + :type disabled_rule_groups: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallDisabledRuleGroup] + """ + + _validation = { + 'enabled': {'required': True}, + 'firewall_mode': {'required': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, + } + + def __init__(self, *, enabled: bool, firewall_mode, rule_set_type: str, rule_set_version: str, disabled_rule_groups=None, **kwargs) -> None: + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = enabled + self.firewall_mode = firewall_mode + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.disabled_rule_groups = disabled_rule_groups diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/azure_async_operation_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/azure_async_operation_result.py index cb7bc721967b..beeb9c35afe9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/azure_async_operation_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/azure_async_operation_result.py @@ -36,7 +36,7 @@ class AzureAsyncOperationResult(Model): 'error': {'key': 'error', 'type': 'Error'}, } - def __init__(self, status=None, error=None): - super(AzureAsyncOperationResult, self).__init__() - self.status = status - self.error = error + def __init__(self, **kwargs): + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/azure_async_operation_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/azure_async_operation_result_py3.py new file mode 100644 index 000000000000..c11b503b746a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/azure_async_operation_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureAsyncOperationResult(Model): + """The response body contains the status of the specified asynchronous + operation, indicating whether it has succeeded, is in progress, or has + failed. Note that this status is distinct from the HTTP status code + returned for the Get Operation Status operation itself. If the asynchronous + operation succeeded, the response body includes the HTTP status code for + the successful request. If the asynchronous operation failed, the response + body includes the HTTP status code for the failed request and error + information regarding the failure. + + :param status: Status of the Azure async operation. Possible values are: + 'InProgress', 'Succeeded', and 'Failed'. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or + ~azure.mgmt.network.v2017_08_01.models.NetworkOperationStatus + :param error: + :type error: ~azure.mgmt.network.v2017_08_01.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, status=None, error=None, **kwargs) -> None: + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/backend_address_pool.py index 556e8012c7c7..001df8b1bee2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/backend_address_pool.py @@ -59,11 +59,11 @@ class BackendAddressPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, provisioning_state=None, name=None, etag=None): - super(BackendAddressPool, self).__init__(id=id) + def __init__(self, **kwargs): + super(BackendAddressPool, self).__init__(**kwargs) self.backend_ip_configurations = None self.load_balancing_rules = None self.outbound_nat_rule = None - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/backend_address_pool_py3.py new file mode 100644 index 000000000000..97301a56e2ce --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/backend_address_pool_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class BackendAddressPool(SubResource): + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar backend_ip_configurations: Gets collection of references to IP + addresses defined in network interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: Gets load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_08_01.models.SubResource] + :ivar outbound_nat_rule: Gets outbound rules that use this backend address + pool. + :vartype outbound_nat_rule: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param provisioning_state: Get provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configurations': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'outbound_nat_rule': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'outbound_nat_rule': {'key': 'properties.outboundNatRule', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(BackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = None + self.load_balancing_rules = None + self.outbound_nat_rule = None + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_community.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_community.py index 8275a0e4048c..472a170e9ceb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_community.py @@ -42,11 +42,11 @@ class BGPCommunity(Model): 'service_group': {'key': 'serviceGroup', 'type': 'str'}, } - def __init__(self, service_supported_region=None, community_name=None, community_value=None, community_prefixes=None, is_authorized_to_use=None, service_group=None): - super(BGPCommunity, self).__init__() - self.service_supported_region = service_supported_region - self.community_name = community_name - self.community_value = community_value - self.community_prefixes = community_prefixes - self.is_authorized_to_use = is_authorized_to_use - self.service_group = service_group + def __init__(self, **kwargs): + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = kwargs.get('service_supported_region', None) + self.community_name = kwargs.get('community_name', None) + self.community_value = kwargs.get('community_value', None) + self.community_prefixes = kwargs.get('community_prefixes', None) + self.is_authorized_to_use = kwargs.get('is_authorized_to_use', None) + self.service_group = kwargs.get('service_group', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_community_py3.py new file mode 100644 index 000000000000..86b740c84404 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_community_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BGPCommunity(Model): + """Contains bgp community information offered in Service Community resources. + + :param service_supported_region: The region which the service support. + e.g. For O365, region is Global. + :type service_supported_region: str + :param community_name: The name of the bgp community. e.g. Skype. + :type community_name: str + :param community_value: The value of the bgp community. For more + information: + https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + :type community_value: str + :param community_prefixes: The prefixes that the bgp community contains. + :type community_prefixes: list[str] + :param is_authorized_to_use: Customer is authorized to use bgp community + or not. + :type is_authorized_to_use: bool + :param service_group: The service group of the bgp community contains. + :type service_group: str + """ + + _attribute_map = { + 'service_supported_region': {'key': 'serviceSupportedRegion', 'type': 'str'}, + 'community_name': {'key': 'communityName', 'type': 'str'}, + 'community_value': {'key': 'communityValue', 'type': 'str'}, + 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, + 'is_authorized_to_use': {'key': 'isAuthorizedToUse', 'type': 'bool'}, + 'service_group': {'key': 'serviceGroup', 'type': 'str'}, + } + + def __init__(self, *, service_supported_region: str=None, community_name: str=None, community_value: str=None, community_prefixes=None, is_authorized_to_use: bool=None, service_group: str=None, **kwargs) -> None: + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = service_supported_region + self.community_name = community_name + self.community_value = community_value + self.community_prefixes = community_prefixes + self.is_authorized_to_use = is_authorized_to_use + self.service_group = service_group diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status.py index a6b4cf0460df..a735922cf60d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status.py @@ -59,8 +59,8 @@ class BgpPeerStatus(Model): 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, } - def __init__(self): - super(BgpPeerStatus, self).__init__() + def __init__(self, **kwargs): + super(BgpPeerStatus, self).__init__(**kwargs) self.local_address = None self.neighbor = None self.asn = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status_list_result.py index f99a5723974e..bfd128440e91 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status_list_result.py @@ -23,6 +23,6 @@ class BgpPeerStatusListResult(Model): 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, } - def __init__(self, value=None): - super(BgpPeerStatusListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status_list_result_py3.py new file mode 100644 index 000000000000..77035a5f1f31 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatusListResult(Model): + """Response for list BGP peer status API service call. + + :param value: List of BGP peers + :type value: list[~azure.mgmt.network.v2017_08_01.models.BgpPeerStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status_py3.py new file mode 100644 index 000000000000..4d532ad100ee --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_peer_status_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatus(Model): + """BGP peer status details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The virtual network gateway's local address + :vartype local_address: str + :ivar neighbor: The remote BGP peer + :vartype neighbor: str + :ivar asn: The autonomous system number of the remote BGP peer + :vartype asn: int + :ivar state: The BGP peer state. Possible values include: 'Unknown', + 'Stopped', 'Idle', 'Connecting', 'Connected' + :vartype state: str or ~azure.mgmt.network.v2017_08_01.models.BgpPeerState + :ivar connected_duration: For how long the peering has been up + :vartype connected_duration: str + :ivar routes_received: The number of routes learned from this peer + :vartype routes_received: long + :ivar messages_sent: The number of BGP messages sent + :vartype messages_sent: long + :ivar messages_received: The number of BGP messages received + :vartype messages_received: long + """ + + _validation = { + 'local_address': {'readonly': True}, + 'neighbor': {'readonly': True}, + 'asn': {'readonly': True}, + 'state': {'readonly': True}, + 'connected_duration': {'readonly': True}, + 'routes_received': {'readonly': True}, + 'messages_sent': {'readonly': True}, + 'messages_received': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'str'}, + 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, + 'routes_received': {'key': 'routesReceived', 'type': 'long'}, + 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, + 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(BgpPeerStatus, self).__init__(**kwargs) + self.local_address = None + self.neighbor = None + self.asn = None + self.state = None + self.connected_duration = None + self.routes_received = None + self.messages_sent = None + self.messages_received = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_service_community.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_service_community.py index 4485dfa91e0f..9d93749348e6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_service_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_service_community.py @@ -50,7 +50,7 @@ class BgpServiceCommunity(Resource): 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, } - def __init__(self, id=None, location=None, tags=None, service_name=None, bgp_communities=None): - super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags) - self.service_name = service_name - self.bgp_communities = bgp_communities + def __init__(self, **kwargs): + super(BgpServiceCommunity, self).__init__(**kwargs) + self.service_name = kwargs.get('service_name', None) + self.bgp_communities = kwargs.get('bgp_communities', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_service_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_service_community_py3.py new file mode 100644 index 000000000000..1605d6db554f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_service_community_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BgpServiceCommunity(Resource): + """Service Community Properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param service_name: The name of the bgp community. e.g. Skype. + :type service_name: str + :param bgp_communities: Get a list of bgp communities. + :type bgp_communities: + list[~azure.mgmt.network.v2017_08_01.models.BGPCommunity] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, + 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, service_name: str=None, bgp_communities=None, **kwargs) -> None: + super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.service_name = service_name + self.bgp_communities = bgp_communities diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_settings.py index c5730da2e43e..e6e8d1b90aa6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_settings.py @@ -31,8 +31,8 @@ class BgpSettings(Model): 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, } - def __init__(self, asn=None, bgp_peering_address=None, peer_weight=None): - super(BgpSettings, self).__init__() - self.asn = asn - self.bgp_peering_address = bgp_peering_address - self.peer_weight = peer_weight + def __init__(self, **kwargs): + super(BgpSettings, self).__init__(**kwargs) + self.asn = kwargs.get('asn', None) + self.bgp_peering_address = kwargs.get('bgp_peering_address', None) + self.peer_weight = kwargs.get('peer_weight', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_settings_py3.py new file mode 100644 index 000000000000..cb3b3e6795f7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/bgp_settings_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpSettings(Model): + """BGP settings details. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of + this BGP speaker. + :type bgp_peering_address: str + :param peer_weight: The weight added to routes learned from this BGP + speaker. + :type peer_weight: int + """ + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, + } + + def __init__(self, *, asn: int=None, bgp_peering_address: str=None, peer_weight: int=None, **kwargs) -> None: + super(BgpSettings, self).__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + self.peer_weight = peer_weight diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_reset_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_reset_shared_key.py index 3338112a7fe7..1ade077795ed 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_reset_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_reset_shared_key.py @@ -15,8 +15,10 @@ class ConnectionResetSharedKey(Model): """The virtual network connection reset shared key. - :param key_length: The virtual network connection reset shared key length, - should between 1 and 128. + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. :type key_length: int """ @@ -28,6 +30,6 @@ class ConnectionResetSharedKey(Model): 'key_length': {'key': 'keyLength', 'type': 'int'}, } - def __init__(self, key_length): - super(ConnectionResetSharedKey, self).__init__() - self.key_length = key_length + def __init__(self, **kwargs): + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = kwargs.get('key_length', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_reset_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_reset_shared_key_py3.py new file mode 100644 index 000000000000..47326d4c2082 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_reset_shared_key_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionResetSharedKey(Model): + """The virtual network connection reset shared key. + + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. + :type key_length: int + """ + + _validation = { + 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, + } + + _attribute_map = { + 'key_length': {'key': 'keyLength', 'type': 'int'}, + } + + def __init__(self, *, key_length: int, **kwargs) -> None: + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = key_length diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_shared_key.py index 2c1b0ed9a914..742f1cb15126 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_shared_key.py @@ -15,7 +15,9 @@ class ConnectionSharedKey(Model): """Response for GetConnectionSharedKey API service call. - :param value: The virtual network connection shared key value. + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. :type value: str """ @@ -27,6 +29,6 @@ class ConnectionSharedKey(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, value): - super(ConnectionSharedKey, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_shared_key_py3.py new file mode 100644 index 000000000000..11b88da35e17 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connection_shared_key_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionSharedKey(Model): + """Response for GetConnectionSharedKey API service call. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, **kwargs) -> None: + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_destination.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_destination.py index cd0e8818b591..964c425a29d3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_destination.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_destination.py @@ -31,8 +31,8 @@ class ConnectivityDestination(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id=None, address=None, port=None): - super(ConnectivityDestination, self).__init__() - self.resource_id = resource_id - self.address = address - self.port = port + def __init__(self, **kwargs): + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_destination_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_destination_py3.py new file mode 100644 index 000000000000..c51619081ed6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_destination_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityDestination(Model): + """Parameters that define destination of connection. + + :param resource_id: The ID of the resource to which a connection attempt + will be made. + :type resource_id: str + :param address: The IP address or URI the resource to which a connection + attempt will be made. + :type address: str + :param port: Port on which check connectivity will be performed. + :type port: int + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str=None, address: str=None, port: int=None, **kwargs) -> None: + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_hop.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_hop.py index 02dd43082524..65d9f0c4124f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_hop.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_hop.py @@ -51,8 +51,8 @@ class ConnectivityHop(Model): 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, } - def __init__(self): - super(ConnectivityHop, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityHop, self).__init__(**kwargs) self.type = None self.id = None self.address = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_hop_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_hop_py3.py new file mode 100644 index 000000000000..1ab3ca4895e2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_hop_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityHop(Model): + """Information about a hop between the source and the destination. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the hop. + :vartype type: str + :ivar id: The ID of the hop. + :vartype id: str + :ivar address: The IP address of the hop. + :vartype address: str + :ivar resource_id: The ID of the resource corresponding to this hop. + :vartype resource_id: str + :ivar next_hop_ids: List of next hop identifiers. + :vartype next_hop_ids: list[str] + :ivar issues: List of issues. + :vartype issues: + list[~azure.mgmt.network.v2017_08_01.models.ConnectivityIssue] + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'address': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'next_hop_ids': {'readonly': True}, + 'issues': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'next_hop_ids': {'key': 'nextHopIds', 'type': '[str]'}, + 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityHop, self).__init__(**kwargs) + self.type = None + self.id = None + self.address = None + self.resource_id = None + self.next_hop_ids = None + self.issues = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_information.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_information.py index 5056e41af09c..70117f290f20 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_information.py @@ -57,8 +57,8 @@ class ConnectivityInformation(Model): 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, } - def __init__(self): - super(ConnectivityInformation, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityInformation, self).__init__(**kwargs) self.hops = None self.connection_status = None self.avg_latency_in_ms = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_information_py3.py new file mode 100644 index 000000000000..1b53f2ea981c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_information_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityInformation(Model): + """Information on the connectivity status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar hops: List of hops between the source and the destination. + :vartype hops: + list[~azure.mgmt.network.v2017_08_01.models.ConnectivityHop] + :ivar connection_status: The connection status. Possible values include: + 'Unknown', 'Connected', 'Disconnected', 'Degraded' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_08_01.models.ConnectionStatus + :ivar avg_latency_in_ms: Average latency in milliseconds. + :vartype avg_latency_in_ms: int + :ivar min_latency_in_ms: Minimum latency in milliseconds. + :vartype min_latency_in_ms: int + :ivar max_latency_in_ms: Maximum latency in milliseconds. + :vartype max_latency_in_ms: int + :ivar probes_sent: Total number of probes sent. + :vartype probes_sent: int + :ivar probes_failed: Number of failed probes. + :vartype probes_failed: int + """ + + _validation = { + 'hops': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'avg_latency_in_ms': {'readonly': True}, + 'min_latency_in_ms': {'readonly': True}, + 'max_latency_in_ms': {'readonly': True}, + 'probes_sent': {'readonly': True}, + 'probes_failed': {'readonly': True}, + } + + _attribute_map = { + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, + 'probes_sent': {'key': 'probesSent', 'type': 'int'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityInformation, self).__init__(**kwargs) + self.hops = None + self.connection_status = None + self.avg_latency_in_ms = None + self.min_latency_in_ms = None + self.max_latency_in_ms = None + self.probes_sent = None + self.probes_failed = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_issue.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_issue.py index 937d8e5f5f73..49d4945e82df 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_issue.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_issue.py @@ -47,8 +47,8 @@ class ConnectivityIssue(Model): 'context': {'key': 'context', 'type': '[{str}]'}, } - def __init__(self): - super(ConnectivityIssue, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityIssue, self).__init__(**kwargs) self.origin = None self.severity = None self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_issue_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_issue_py3.py new file mode 100644 index 000000000000..ff082930e41b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_issue_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityIssue(Model): + """Information about an issue encountered in the process of checking for + connectivity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar origin: The origin of the issue. Possible values include: 'Local', + 'Inbound', 'Outbound' + :vartype origin: str or ~azure.mgmt.network.v2017_08_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: + 'Error', 'Warning' + :vartype severity: str or ~azure.mgmt.network.v2017_08_01.models.Severity + :ivar type: The type of issue. Possible values include: 'Unknown', + 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', + 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform' + :vartype type: str or ~azure.mgmt.network.v2017_08_01.models.IssueType + :ivar context: Provides additional context on the issue. + :vartype context: list[dict[str, str]] + """ + + _validation = { + 'origin': {'readonly': True}, + 'severity': {'readonly': True}, + 'type': {'readonly': True}, + 'context': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'context': {'key': 'context', 'type': '[{str}]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityIssue, self).__init__(**kwargs) + self.origin = None + self.severity = None + self.type = None + self.context = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_parameters.py index 6e500c4f42df..62eb14f9af8d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_parameters.py @@ -15,9 +15,11 @@ class ConnectivityParameters(Model): """Parameters that determine how the connectivity check will be performed. - :param source: + All required parameters must be populated in order to send to Azure. + + :param source: Required. :type source: ~azure.mgmt.network.v2017_08_01.models.ConnectivitySource - :param destination: + :param destination: Required. :type destination: ~azure.mgmt.network.v2017_08_01.models.ConnectivityDestination """ @@ -32,7 +34,7 @@ class ConnectivityParameters(Model): 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, } - def __init__(self, source, destination): - super(ConnectivityParameters, self).__init__() - self.source = source - self.destination = destination + def __init__(self, **kwargs): + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_parameters_py3.py new file mode 100644 index 000000000000..6c2cb16dcd98 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_parameters_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityParameters(Model): + """Parameters that determine how the connectivity check will be performed. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. + :type source: ~azure.mgmt.network.v2017_08_01.models.ConnectivitySource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2017_08_01.models.ConnectivityDestination + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectivitySource'}, + 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, + } + + def __init__(self, *, source, destination, **kwargs) -> None: + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = source + self.destination = destination diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_source.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_source.py index c42bfc0aa09d..3fd82793f8d7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_source.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_source.py @@ -15,8 +15,10 @@ class ConnectivitySource(Model): """Parameters that define the source of the connection. - :param resource_id: The ID of the resource from which a connectivity check - will be initiated. + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. :type resource_id: str :param port: The source port from which a connectivity check will be performed. @@ -32,7 +34,7 @@ class ConnectivitySource(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id, port=None): - super(ConnectivitySource, self).__init__() - self.resource_id = resource_id - self.port = port + def __init__(self, **kwargs): + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_source_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_source_py3.py new file mode 100644 index 000000000000..f7833d1bef76 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/connectivity_source_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivitySource(Model): + """Parameters that define the source of the connection. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. + :type resource_id: str + :param port: The source port from which a connectivity check will be + performed. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str, port: int=None, **kwargs) -> None: + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = resource_id + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dhcp_options.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dhcp_options.py index 8744ba6fc9b1..93b68a7f037c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dhcp_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dhcp_options.py @@ -25,6 +25,6 @@ class DhcpOptions(Model): 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, } - def __init__(self, dns_servers=None): - super(DhcpOptions, self).__init__() - self.dns_servers = dns_servers + def __init__(self, **kwargs): + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dhcp_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dhcp_options_py3.py new file mode 100644 index 000000000000..7dc4651973a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dhcp_options_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DhcpOptions(Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in + the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + options. + + :param dns_servers: The list of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = dns_servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dns_name_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dns_name_availability_result.py index 15a0238e49a7..86ba19eb407b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dns_name_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dns_name_availability_result.py @@ -23,6 +23,6 @@ class DnsNameAvailabilityResult(Model): 'available': {'key': 'available', 'type': 'bool'}, } - def __init__(self, available=None): - super(DnsNameAvailabilityResult, self).__init__() - self.available = available + def __init__(self, **kwargs): + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dns_name_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dns_name_availability_result_py3.py new file mode 100644 index 000000000000..de0117c27715 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/dns_name_availability_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DnsNameAvailabilityResult(Model): + """Response for the CheckDnsNameAvailability API service call. + + :param available: Domain availability (True/False). + :type available: bool + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + } + + def __init__(self, *, available: bool=None, **kwargs) -> None: + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = available diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group.py index 300a7c89eca0..9d8945dcef64 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group.py @@ -37,9 +37,9 @@ class EffectiveNetworkSecurityGroup(Model): 'tag_map': {'key': 'tagMap', 'type': '{[str]}'}, } - def __init__(self, network_security_group=None, association=None, effective_security_rules=None, tag_map=None): - super(EffectiveNetworkSecurityGroup, self).__init__() - self.network_security_group = network_security_group - self.association = association - self.effective_security_rules = effective_security_rules - self.tag_map = tag_map + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = kwargs.get('network_security_group', None) + self.association = kwargs.get('association', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) + self.tag_map = kwargs.get('tag_map', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_association.py index 9367eb66be0f..b1f7969aa308 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_association.py @@ -27,7 +27,7 @@ class EffectiveNetworkSecurityGroupAssociation(Model): 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, } - def __init__(self, subnet=None, network_interface=None): - super(EffectiveNetworkSecurityGroupAssociation, self).__init__() - self.subnet = subnet - self.network_interface = network_interface + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.network_interface = kwargs.get('network_interface', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_association_py3.py new file mode 100644 index 000000000000..3fde276fa2f1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_association_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupAssociation(Model): + """The effective network security group association. + + :param subnet: The ID of the subnet if assigned. + :type subnet: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: + ~azure.mgmt.network.v2017_08_01.models.SubResource + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, + } + + def __init__(self, *, subnet=None, network_interface=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = subnet + self.network_interface = network_interface diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_list_result.py index e8f948ff1da4..28279d48f050 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_list_result.py @@ -34,7 +34,7 @@ class EffectiveNetworkSecurityGroupListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None): - super(EffectiveNetworkSecurityGroupListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_list_result_py3.py new file mode 100644 index 000000000000..6cd5d6a61818 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_list_result_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupListResult(Model): + """Response for list effective network security groups API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective network security groups. + :type value: + list[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_py3.py new file mode 100644 index 000000000000..b21f02c9dbe1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_group_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroup(Model): + """Effective network security group. + + :param network_security_group: The ID of network security group that is + applied. + :type network_security_group: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param association: Associated resources. + :type association: + ~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityRule] + :param tag_map: Mapping of tags to list of IP Addresses included within + the tag. + :type tag_map: dict[str, list[str]] + """ + + _attribute_map = { + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, + 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + 'tag_map': {'key': 'tagMap', 'type': '{[str]}'}, + } + + def __init__(self, *, network_security_group=None, association=None, effective_security_rules=None, tag_map=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = network_security_group + self.association = association + self.effective_security_rules = effective_security_rules + self.tag_map = tag_map diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_rule.py index 2c58ef9fb5d4..a348a40d348a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_rule.py @@ -82,20 +82,20 @@ class EffectiveNetworkSecurityRule(Model): 'direction': {'key': 'direction', 'type': 'str'}, } - def __init__(self, name=None, protocol=None, source_port_range=None, destination_port_range=None, source_port_ranges=None, destination_port_ranges=None, source_address_prefix=None, destination_address_prefix=None, source_address_prefixes=None, destination_address_prefixes=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority=None, direction=None): - super(EffectiveNetworkSecurityRule, self).__init__() - self.name = name - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_port_ranges = source_port_ranges - self.destination_port_ranges = destination_port_ranges - self.source_address_prefix = source_address_prefix - self.destination_address_prefix = destination_address_prefix - self.source_address_prefixes = source_address_prefixes - self.destination_address_prefixes = destination_address_prefixes - self.expanded_source_address_prefix = expanded_source_address_prefix - self.expanded_destination_address_prefix = expanded_destination_address_prefix - self.access = access - self.priority = priority - self.direction = direction + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.expanded_source_address_prefix = kwargs.get('expanded_source_address_prefix', None) + self.expanded_destination_address_prefix = kwargs.get('expanded_destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_rule_py3.py new file mode 100644 index 000000000000..b0c83e91a4f1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_network_security_rule_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityRule(Model): + """Effective network security rules. + + :param name: The name of the security rule specified by the user (if + created by the user). + :type name: str + :param protocol: The network protocol this rule applies to. Possible + values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', + 'Udp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_08_01.models.EffectiveSecurityRuleProtocol + :param source_port_range: The source port or range. + :type source_port_range: str + :param destination_port_range: The destination port or range. + :type destination_port_range: str + :param source_port_ranges: The source port ranges. Expected values include + a single integer between 0 and 65535, a range using '-' as seperator (e.g. + 100-400), or an asterix (*) + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. Expected + values include a single integer between 0 and 65535, a range using '-' as + seperator (e.g. 100-400), or an asterix (*) + :type destination_port_ranges: list[str] + :param source_address_prefix: The source address prefix. + :type source_address_prefix: str + :param destination_address_prefix: The destination address prefix. + :type destination_address_prefix: str + :param source_address_prefixes: The source address prefixes. Expected + values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type source_address_prefixes: list[str] + :param destination_address_prefixes: The destination address prefixes. + Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type destination_address_prefixes: list[str] + :param expanded_source_address_prefix: The expanded source address prefix. + :type expanded_source_address_prefix: list[str] + :param expanded_destination_address_prefix: Expanded destination address + prefix. + :type expanded_destination_address_prefix: list[str] + :param access: Whether network traffic is allowed or denied. Possible + values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or + ~azure.mgmt.network.v2017_08_01.models.SecurityRuleAccess + :param priority: The priority of the rule. + :type priority: int + :param direction: The direction of the rule. Possible values are: 'Inbound + and Outbound'. Possible values include: 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2017_08_01.models.SecurityRuleDirection + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'source_port_ranges': {'key': 'sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'destinationPortRanges', 'type': '[str]'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'sourceAddressPrefixes', 'type': '[str]'}, + 'destination_address_prefixes': {'key': 'destinationAddressPrefixes', 'type': '[str]'}, + 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, + 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, + 'access': {'key': 'access', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, protocol=None, source_port_range: str=None, destination_port_range: str=None, source_port_ranges=None, destination_port_ranges=None, source_address_prefix: str=None, destination_address_prefix: str=None, source_address_prefixes=None, destination_address_prefixes=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority: int=None, direction=None, **kwargs) -> None: + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = name + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.source_address_prefixes = source_address_prefixes + self.destination_address_prefixes = destination_address_prefixes + self.expanded_source_address_prefix = expanded_source_address_prefix + self.expanded_destination_address_prefix = expanded_destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route.py index cc11b4a98ffa..06011db22ae0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route.py @@ -50,11 +50,11 @@ class EffectiveRoute(Model): 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, } - def __init__(self, name=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None): - super(EffectiveRoute, self).__init__() - self.name = name - self.source = source - self.state = state - self.address_prefix = address_prefix - self.next_hop_ip_address = next_hop_ip_address - self.next_hop_type = next_hop_type + def __init__(self, **kwargs): + super(EffectiveRoute, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.next_hop_type = kwargs.get('next_hop_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route_list_result.py index 579377f54077..13c1b071b351 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route_list_result.py @@ -33,7 +33,7 @@ class EffectiveRouteListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None): - super(EffectiveRouteListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route_list_result_py3.py new file mode 100644 index 000000000000..e44d06978653 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route_list_result_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRouteListResult(Model): + """Response for list effective route API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective routes. + :type value: list[~azure.mgmt.network.v2017_08_01.models.EffectiveRoute] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route_py3.py new file mode 100644 index 000000000000..84fa16756a49 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/effective_route_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRoute(Model): + """Effective Route. + + :param name: The name of the user defined route. This is optional. + :type name: str + :param source: Who created the route. Possible values are: 'Unknown', + 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: + 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' + :type source: str or + ~azure.mgmt.network.v2017_08_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values are: 'Active' + and 'Invalid'. Possible values include: 'Active', 'Invalid' + :type state: str or + ~azure.mgmt.network.v2017_08_01.models.EffectiveRouteState + :param address_prefix: The address prefixes of the effective routes in + CIDR notation. + :type address_prefix: list[str] + :param next_hop_ip_address: The IP address of the next hop of the + effective route. + :type next_hop_ip_address: list[str] + :param next_hop_type: The type of Azure hop the packet should be sent to. + Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_08_01.models.RouteNextHopType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None, **kwargs) -> None: + super(EffectiveRoute, self).__init__(**kwargs) + self.name = name + self.source = source + self.state = state + self.address_prefix = address_prefix + self.next_hop_ip_address = next_hop_ip_address + self.next_hop_type = next_hop_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/endpoint_service_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/endpoint_service_result.py index 9098a41ff164..9ca0e203a834 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/endpoint_service_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/endpoint_service_result.py @@ -37,7 +37,7 @@ class EndpointServiceResult(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None): - super(EndpointServiceResult, self).__init__(id=id) + def __init__(self, **kwargs): + super(EndpointServiceResult, self).__init__(**kwargs) self.name = None self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/endpoint_service_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/endpoint_service_result_py3.py new file mode 100644 index 000000000000..c45df94a6533 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/endpoint_service_result_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class EndpointServiceResult(SubResource): + """Endpoint service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Name of the endpoint service. + :vartype name: str + :ivar type: Type of the endpoint service. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(EndpointServiceResult, self).__init__(id=id, **kwargs) + self.name = None + self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error.py index 65154ab6fd14..c6a67f1caf91 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error.py @@ -35,10 +35,10 @@ class Error(Model): 'inner_error': {'key': 'innerError', 'type': 'str'}, } - def __init__(self, code=None, message=None, target=None, details=None, inner_error=None): - super(Error, self).__init__() - self.code = code - self.message = message - self.target = target - self.details = details - self.inner_error = inner_error + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error_details.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error_details.py index 40bea00aa2fb..a8c4da6ba955 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error_details.py @@ -29,8 +29,8 @@ class ErrorDetails(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ErrorDetails, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error_details_py3.py new file mode 100644 index 000000000000..d791f0895345 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error_details_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """ErrorDetails. + + :param code: + :type code: str + :param target: + :type target: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error_py3.py new file mode 100644 index 000000000000..3b74127e5b7e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(Model): + """Error. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.network.v2017_08_01.models.ErrorDetails] + :param inner_error: + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, inner_error: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit.py index b749199c8f3f..18f0920014b4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit.py @@ -91,17 +91,17 @@ class ExpressRouteCircuit(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, allow_classic_operations=None, circuit_provisioning_state=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key=None, service_provider_notes=None, service_provider_properties=None, provisioning_state=None, gateway_manager_etag=None): - super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.allow_classic_operations = allow_classic_operations - self.circuit_provisioning_state = circuit_provisioning_state - self.service_provider_provisioning_state = service_provider_provisioning_state - self.authorizations = authorizations - self.peerings = peerings - self.service_key = service_key - self.service_provider_notes = service_provider_notes - self.service_provider_properties = service_provider_properties - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag + def __init__(self, **kwargs): + super(ExpressRouteCircuit, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.allow_classic_operations = kwargs.get('allow_classic_operations', None) + self.circuit_provisioning_state = kwargs.get('circuit_provisioning_state', None) + self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) + self.authorizations = kwargs.get('authorizations', None) + self.peerings = kwargs.get('peerings', None) + self.service_key = kwargs.get('service_key', None) + self.service_provider_notes = kwargs.get('service_provider_notes', None) + self.service_provider_properties = kwargs.get('service_provider_properties', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_arp_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_arp_table.py index ace325747ee5..826796619769 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_arp_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_arp_table.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitArpTable(Model): 'mac_address': {'key': 'macAddress', 'type': 'str'}, } - def __init__(self, age=None, interface=None, ip_address=None, mac_address=None): - super(ExpressRouteCircuitArpTable, self).__init__() - self.age = age - self.interface = interface - self.ip_address = ip_address - self.mac_address = mac_address + def __init__(self, **kwargs): + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = kwargs.get('age', None) + self.interface = kwargs.get('interface', None) + self.ip_address = kwargs.get('ip_address', None) + self.mac_address = kwargs.get('mac_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_arp_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_arp_table_py3.py new file mode 100644 index 000000000000..4401108c6001 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_arp_table_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitArpTable(Model): + """The ARP table associated with the ExpressRouteCircuit. + + :param age: Age + :type age: int + :param interface: Interface + :type interface: str + :param ip_address: The IP address. + :type ip_address: str + :param mac_address: The MAC address. + :type mac_address: str + """ + + _attribute_map = { + 'age': {'key': 'age', 'type': 'int'}, + 'interface': {'key': 'interface', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, *, age: int=None, interface: str=None, ip_address: str=None, mac_address: str=None, **kwargs) -> None: + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = age + self.interface = interface + self.ip_address = ip_address + self.mac_address = mac_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_authorization.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_authorization.py index b76e7ccda7bc..4cc7cf9d1c19 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_authorization.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_authorization.py @@ -51,10 +51,10 @@ class ExpressRouteCircuitAuthorization(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, authorization_key=None, authorization_use_status=None, provisioning_state=None, name=None): - super(ExpressRouteCircuitAuthorization, self).__init__(id=id) - self.authorization_key = authorization_key - self.authorization_use_status = authorization_use_status - self.provisioning_state = provisioning_state - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitAuthorization, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.authorization_use_status = kwargs.get('authorization_use_status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_authorization_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_authorization_py3.py new file mode 100644 index 000000000000..47ce46d5ea6d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_authorization_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param authorization_use_status: AuthorizationUseStatus. Possible values + are: 'Available' and 'InUse'. Possible values include: 'Available', + 'InUse' + :type authorization_use_status: str or + ~azure.mgmt.network.v2017_08_01.models.AuthorizationUseStatus + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, authorization_key: str=None, authorization_use_status=None, provisioning_state: str=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitAuthorization, self).__init__(id=id, **kwargs) + self.authorization_key = authorization_key + self.authorization_use_status = authorization_use_status + self.provisioning_state = provisioning_state + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering.py index 56983c9dd337..cf53dd4df69c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering.py @@ -100,24 +100,24 @@ class ExpressRouteCircuitPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, peering_type=None, state=None, azure_asn=None, peer_asn=None, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, primary_azure_port=None, secondary_azure_port=None, shared_key=None, vlan_id=None, microsoft_peering_config=None, stats=None, provisioning_state=None, gateway_manager_etag=None, last_modified_by=None, route_filter=None, ipv6_peering_config=None, name=None): - super(ExpressRouteCircuitPeering, self).__init__(id=id) - self.peering_type = peering_type - self.state = state - self.azure_asn = azure_asn - self.peer_asn = peer_asn - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.primary_azure_port = primary_azure_port - self.secondary_azure_port = secondary_azure_port - self.shared_key = shared_key - self.vlan_id = vlan_id - self.microsoft_peering_config = microsoft_peering_config - self.stats = stats - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag - self.last_modified_by = last_modified_by - self.route_filter = route_filter - self.ipv6_peering_config = ipv6_peering_config - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeering, self).__init__(**kwargs) + self.peering_type = kwargs.get('peering_type', None) + self.state = kwargs.get('state', None) + self.azure_asn = kwargs.get('azure_asn', None) + self.peer_asn = kwargs.get('peer_asn', None) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.primary_azure_port = kwargs.get('primary_azure_port', None) + self.secondary_azure_port = kwargs.get('secondary_azure_port', None) + self.shared_key = kwargs.get('shared_key', None) + self.vlan_id = kwargs.get('vlan_id', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.stats = kwargs.get('stats', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.route_filter = kwargs.get('route_filter', None) + self.ipv6_peering_config = kwargs.get('ipv6_peering_config', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering_config.py index 37911fd41328..6c485ade7278 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering_config.py @@ -45,11 +45,11 @@ class ExpressRouteCircuitPeeringConfig(Model): 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, } - def __init__(self, advertised_public_prefixes=None, advertised_communities=None, advertised_public_prefixes_state=None, legacy_mode=None, customer_asn=None, routing_registry_name=None): - super(ExpressRouteCircuitPeeringConfig, self).__init__() - self.advertised_public_prefixes = advertised_public_prefixes - self.advertised_communities = advertised_communities - self.advertised_public_prefixes_state = advertised_public_prefixes_state - self.legacy_mode = legacy_mode - self.customer_asn = customer_asn - self.routing_registry_name = routing_registry_name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = kwargs.get('advertised_public_prefixes', None) + self.advertised_communities = kwargs.get('advertised_communities', None) + self.advertised_public_prefixes_state = kwargs.get('advertised_public_prefixes_state', None) + self.legacy_mode = kwargs.get('legacy_mode', None) + self.customer_asn = kwargs.get('customer_asn', None) + self.routing_registry_name = kwargs.get('routing_registry_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..08b2f3f731cf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering_config_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitPeeringConfig(Model): + """Specifies the peering configuration. + + :param advertised_public_prefixes: The reference of + AdvertisedPublicPrefixes. + :type advertised_public_prefixes: list[str] + :param advertised_communities: The communities of bgp peering. Spepcified + for microsoft peering + :type advertised_communities: list[str] + :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of + the Peering resource. Possible values are 'NotConfigured', 'Configuring', + 'Configured', and 'ValidationNeeded'. Possible values include: + 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' + :type advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :param legacy_mode: The legacy mode of the peering. + :type legacy_mode: int + :param customer_asn: The CustomerASN of the peering. + :type customer_asn: int + :param routing_registry_name: The RoutingRegistryName of the + configuration. + :type routing_registry_name: str + """ + + _attribute_map = { + 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, + 'advertised_communities': {'key': 'advertisedCommunities', 'type': '[str]'}, + 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, + 'legacy_mode': {'key': 'legacyMode', 'type': 'int'}, + 'customer_asn': {'key': 'customerASN', 'type': 'int'}, + 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, + } + + def __init__(self, *, advertised_public_prefixes=None, advertised_communities=None, advertised_public_prefixes_state=None, legacy_mode: int=None, customer_asn: int=None, routing_registry_name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = advertised_public_prefixes + self.advertised_communities = advertised_communities + self.advertised_public_prefixes_state = advertised_public_prefixes_state + self.legacy_mode = legacy_mode + self.customer_asn = customer_asn + self.routing_registry_name = routing_registry_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering_py3.py new file mode 100644 index 000000000000..00acba9b578f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_peering_py3.py @@ -0,0 +1,123 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitPeering(SubResource): + """Peering in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param peering_type: The PeeringType. Possible values are: + 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. + Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + 'MicrosoftPeering' + :type peering_type: str or + ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringType + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringState + :param azure_asn: The Azure ASN. + :type azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: int + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param primary_azure_port: The primary port. + :type primary_azure_port: str + :param secondary_azure_port: The secondary port. + :type secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringConfig + :param stats: Gets peering stats. + :type stats: + ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitStats + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :param last_modified_by: Gets whether the provider or the customer last + modified the peering. + :type last_modified_by: str + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2017_08_01.models.RouteFilter + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2017_08_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'int'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'route_filter': {'key': 'properties.routeFilter', 'type': 'RouteFilter'}, + 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, peering_type=None, state=None, azure_asn: int=None, peer_asn: int=None, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, primary_azure_port: str=None, secondary_azure_port: str=None, shared_key: str=None, vlan_id: int=None, microsoft_peering_config=None, stats=None, provisioning_state: str=None, gateway_manager_etag: str=None, last_modified_by: str=None, route_filter=None, ipv6_peering_config=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeering, self).__init__(id=id, **kwargs) + self.peering_type = peering_type + self.state = state + self.azure_asn = azure_asn + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = primary_azure_port + self.secondary_azure_port = secondary_azure_port + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.stats = stats + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.last_modified_by = last_modified_by + self.route_filter = route_filter + self.ipv6_peering_config = ipv6_peering_config + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_py3.py new file mode 100644 index 000000000000..16500d706af2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteCircuit(Resource): + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The SKU. + :type sku: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitSku + :param allow_classic_operations: Allow classic operations + :type allow_classic_operations: bool + :param circuit_provisioning_state: The CircuitProvisioningState state of + the resource. + :type circuit_provisioning_state: str + :param service_provider_provisioning_state: The + ServiceProviderProvisioningState state of the resource. Possible values + are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + 'Deprovisioning' + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2017_08_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: + list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] + :param service_key: The ServiceKey. + :type service_key: str + :param service_provider_notes: The ServiceProviderNotes. + :type service_provider_notes: str + :param service_provider_properties: The ServiceProviderProperties. + :type service_provider_properties: + ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitServiceProviderProperties + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, + 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, + 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, allow_classic_operations: bool=None, circuit_provisioning_state: str=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key: str=None, service_provider_notes: str=None, service_provider_properties=None, provisioning_state: str=None, gateway_manager_etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.allow_classic_operations = allow_classic_operations + self.circuit_provisioning_state = circuit_provisioning_state + self.service_provider_provisioning_state = service_provider_provisioning_state + self.authorizations = authorizations + self.peerings = peerings + self.service_key = service_key + self.service_provider_notes = service_provider_notes + self.service_provider_properties = service_provider_properties + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table.py index 804d29a2f9bb..7517e9867cfb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table.py @@ -35,10 +35,10 @@ class ExpressRouteCircuitRoutesTable(Model): 'path': {'key': 'path', 'type': 'str'}, } - def __init__(self, network=None, next_hop=None, loc_prf=None, weight=None, path=None): - super(ExpressRouteCircuitRoutesTable, self).__init__() - self.network = network - self.next_hop = next_hop - self.loc_prf = loc_prf - self.weight = weight - self.path = path + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = kwargs.get('network', None) + self.next_hop = kwargs.get('next_hop', None) + self.loc_prf = kwargs.get('loc_prf', None) + self.weight = kwargs.get('weight', None) + self.path = kwargs.get('path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table_py3.py new file mode 100644 index 000000000000..38ea85cf642d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTable(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param network: network + :type network: str + :param next_hop: nextHop + :type next_hop: str + :param loc_prf: locPrf + :type loc_prf: str + :param weight: weight. + :type weight: int + :param path: path + :type path: str + """ + + _attribute_map = { + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'loc_prf': {'key': 'locPrf', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, *, network: str=None, next_hop: str=None, loc_prf: str=None, weight: int=None, path: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = network + self.next_hop = next_hop + self.loc_prf = loc_prf + self.weight = weight + self.path = path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table_summary.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table_summary.py index 6f5f89764dd4..577c3c2edd45 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table_summary.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table_summary.py @@ -37,10 +37,10 @@ class ExpressRouteCircuitRoutesTableSummary(Model): 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, } - def __init__(self, neighbor=None, v=None, as_property=None, up_down=None, state_pfx_rcd=None): - super(ExpressRouteCircuitRoutesTableSummary, self).__init__() - self.neighbor = neighbor - self.v = v - self.as_property = as_property - self.up_down = up_down - self.state_pfx_rcd = state_pfx_rcd + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = kwargs.get('neighbor', None) + self.v = kwargs.get('v', None) + self.as_property = kwargs.get('as_property', None) + self.up_down = kwargs.get('up_down', None) + self.state_pfx_rcd = kwargs.get('state_pfx_rcd', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table_summary_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table_summary_py3.py new file mode 100644 index 000000000000..e18d0051d218 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_routes_table_summary_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTableSummary(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: Neighbor + :type neighbor: str + :param v: BGP version number spoken to the neighbor. + :type v: int + :param as_property: Autonomous system number. + :type as_property: int + :param up_down: The length of time that the BGP session has been in the + Established state, or the current status if not in the Established state. + :type up_down: str + :param state_pfx_rcd: Current state of the BGP session, and the number of + prefixes that have been received from a neighbor or peer group. + :type state_pfx_rcd: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'v': {'key': 'v', 'type': 'int'}, + 'as_property': {'key': 'as', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, + } + + def __init__(self, *, neighbor: str=None, v: int=None, as_property: int=None, up_down: str=None, state_pfx_rcd: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = neighbor + self.v = v + self.as_property = as_property + self.up_down = up_down + self.state_pfx_rcd = state_pfx_rcd diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_service_provider_properties.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_service_provider_properties.py index 7a6b4ba96061..c51e6d8d653b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_service_provider_properties.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_service_provider_properties.py @@ -29,8 +29,8 @@ class ExpressRouteCircuitServiceProviderProperties(Model): 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, } - def __init__(self, service_provider_name=None, peering_location=None, bandwidth_in_mbps=None): - super(ExpressRouteCircuitServiceProviderProperties, self).__init__() - self.service_provider_name = service_provider_name - self.peering_location = peering_location - self.bandwidth_in_mbps = bandwidth_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = kwargs.get('service_provider_name', None) + self.peering_location = kwargs.get('peering_location', None) + self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_service_provider_properties_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_service_provider_properties_py3.py new file mode 100644 index 000000000000..ea701a54c3fe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_service_provider_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitServiceProviderProperties(Model): + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :param service_provider_name: The serviceProviderName. + :type service_provider_name: str + :param peering_location: The peering location. + :type peering_location: str + :param bandwidth_in_mbps: The BandwidthInMbps. + :type bandwidth_in_mbps: int + """ + + _attribute_map = { + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + } + + def __init__(self, *, service_provider_name: str=None, peering_location: str=None, bandwidth_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = service_provider_name + self.peering_location = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_sku.py index 3d9535a7b4f2..260a9db05db2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_sku.py @@ -33,8 +33,8 @@ class ExpressRouteCircuitSku(Model): 'family': {'key': 'family', 'type': 'str'}, } - def __init__(self, name=None, tier=None, family=None): - super(ExpressRouteCircuitSku, self).__init__() - self.name = name - self.tier = tier - self.family = family + def __init__(self, **kwargs): + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.family = kwargs.get('family', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_sku_py3.py new file mode 100644 index 000000000000..977c885c4f26 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_sku_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitSku(Model): + """Contains SKU in an ExpressRouteCircuit. + + :param name: The name of the SKU. + :type name: str + :param tier: The tier of the SKU. Possible values are 'Standard' and + 'Premium'. Possible values include: 'Standard', 'Premium' + :type tier: str or + ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values are: 'UnlimitedData' + and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' + :type family: str or + ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, tier=None, family=None, **kwargs) -> None: + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.family = family diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_stats.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_stats.py index e26f6f7d2f74..41c45ae2b19a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_stats.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_stats.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitStats(Model): 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, } - def __init__(self, primarybytes_in=None, primarybytes_out=None, secondarybytes_in=None, secondarybytes_out=None): - super(ExpressRouteCircuitStats, self).__init__() - self.primarybytes_in = primarybytes_in - self.primarybytes_out = primarybytes_out - self.secondarybytes_in = secondarybytes_in - self.secondarybytes_out = secondarybytes_out + def __init__(self, **kwargs): + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = kwargs.get('primarybytes_in', None) + self.primarybytes_out = kwargs.get('primarybytes_out', None) + self.secondarybytes_in = kwargs.get('secondarybytes_in', None) + self.secondarybytes_out = kwargs.get('secondarybytes_out', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_stats_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_stats_py3.py new file mode 100644 index 000000000000..f78335343544 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuit_stats_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitStats(Model): + """Contains stats associated with the peering. + + :param primarybytes_in: Gets BytesIn of the peering. + :type primarybytes_in: long + :param primarybytes_out: Gets BytesOut of the peering. + :type primarybytes_out: long + :param secondarybytes_in: Gets BytesIn of the peering. + :type secondarybytes_in: long + :param secondarybytes_out: Gets BytesOut of the peering. + :type secondarybytes_out: long + """ + + _attribute_map = { + 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, + 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, + 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, + 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, + } + + def __init__(self, *, primarybytes_in: int=None, primarybytes_out: int=None, secondarybytes_in: int=None, secondarybytes_out: int=None, **kwargs) -> None: + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = primarybytes_in + self.primarybytes_out = primarybytes_out + self.secondarybytes_in = secondarybytes_in + self.secondarybytes_out = secondarybytes_out diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_arp_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_arp_table_list_result.py index cb35833ea786..dcfd3558b899 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_arp_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_arp_table_list_result.py @@ -27,7 +27,7 @@ class ExpressRouteCircuitsArpTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsArpTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_arp_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_arp_table_list_result_py3.py new file mode 100644 index 000000000000..a91c7330970e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_arp_table_list_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsArpTableListResult(Model): + """Response for ListArpTable associated with the Express Route Circuits API. + + :param value: Gets list of the ARP table. + :type value: + list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitArpTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_list_result.py index 0e4a0a4458f6..4be3a2542f78 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_list_result_py3.py new file mode 100644 index 000000000000..4e38181a7599 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: The list of routes table. + :type value: + list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitRoutesTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_summary_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_summary_list_result.py index a4821ae5dd15..96894cf53f31 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_summary_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_summary_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_summary_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_summary_list_result_py3.py new file mode 100644 index 000000000000..c0ee2be27350 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_circuits_routes_table_summary_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: A list of the routes table. + :type value: + list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitRoutesTableSummary] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider.py index b5e5a2d56943..fa4091f2271a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider.py @@ -53,8 +53,8 @@ class ExpressRouteServiceProvider(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state=None): - super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags) - self.peering_locations = peering_locations - self.bandwidths_offered = bandwidths_offered - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ExpressRouteServiceProvider, self).__init__(**kwargs) + self.peering_locations = kwargs.get('peering_locations', None) + self.bandwidths_offered = kwargs.get('bandwidths_offered', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider_bandwidths_offered.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider_bandwidths_offered.py index 9cbba2fcfe97..b27622af42d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider_bandwidths_offered.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider_bandwidths_offered.py @@ -26,7 +26,7 @@ class ExpressRouteServiceProviderBandwidthsOffered(Model): 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, } - def __init__(self, offer_name=None, value_in_mbps=None): - super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__() - self.offer_name = offer_name - self.value_in_mbps = value_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = kwargs.get('offer_name', None) + self.value_in_mbps = kwargs.get('value_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider_bandwidths_offered_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider_bandwidths_offered_py3.py new file mode 100644 index 000000000000..88516a0dfcf8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider_bandwidths_offered_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteServiceProviderBandwidthsOffered(Model): + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :param offer_name: The OfferName. + :type offer_name: str + :param value_in_mbps: The ValueInMbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__(self, *, offer_name: str=None, value_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = offer_name + self.value_in_mbps = value_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider_py3.py new file mode 100644 index 000000000000..f1ed4f4d9e29 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/express_route_service_provider_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param peering_locations: Get a list of peering locations. + :type peering_locations: list[str] + :param bandwidths_offered: Gets bandwidths offered. + :type bandwidths_offered: + list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteServiceProviderBandwidthsOffered] + :param provisioning_state: Gets the provisioning state of the resource. + :type provisioning_state: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, + 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state: str=None, **kwargs) -> None: + super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.peering_locations = peering_locations + self.bandwidths_offered = bandwidths_offered + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_information.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_information.py index adc3f12ea653..4255e7f62ae2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_information.py @@ -15,13 +15,15 @@ class FlowLogInformation(Model): """Information on the configuration of flow log. - :param target_resource_id: The ID of the resource to configure for flow - logging. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. :type target_resource_id: str - :param storage_id: ID of the storage account which is used to store the - flow log. + :param storage_id: Required. ID of the storage account which is used to + store the flow log. :type storage_id: str - :param enabled: Flag to enable/disable flow logging. + :param enabled: Required. Flag to enable/disable flow logging. :type enabled: bool :param retention_policy: :type retention_policy: @@ -41,9 +43,9 @@ class FlowLogInformation(Model): 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, } - def __init__(self, target_resource_id, storage_id, enabled, retention_policy=None): - super(FlowLogInformation, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.enabled = enabled - self.retention_policy = retention_policy + def __init__(self, **kwargs): + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.enabled = kwargs.get('enabled', None) + self.retention_policy = kwargs.get('retention_policy', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_information_py3.py new file mode 100644 index 000000000000..350fe96f39d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_information_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogInformation(Model): + """Information on the configuration of flow log. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. + :type target_resource_id: str + :param storage_id: Required. ID of the storage account which is used to + store the flow log. + :type storage_id: str + :param enabled: Required. Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: + :type retention_policy: + ~azure.mgmt.network.v2017_08_01.models.RetentionPolicyParameters + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, enabled: bool, retention_policy=None, **kwargs) -> None: + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.enabled = enabled + self.retention_policy = retention_policy diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_status_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_status_parameters.py index 4cd22222bb45..5a48e938f2d6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_status_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_status_parameters.py @@ -15,8 +15,10 @@ class FlowLogStatusParameters(Model): """Parameters that define a resource to query flow log status. - :param target_resource_id: The target resource where getting the flow - logging status. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class FlowLogStatusParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(FlowLogStatusParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_status_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_status_parameters_py3.py new file mode 100644 index 000000000000..0768d2495150 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/flow_log_status_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogStatusParameters(Model): + """Parameters that define a resource to query flow log status. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/frontend_ip_configuration.py index c17f5d23812c..2e18698616fb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/frontend_ip_configuration.py @@ -85,17 +85,17 @@ class FrontendIPConfiguration(SubResource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None, zones=None): - super(FrontendIPConfiguration, self).__init__(id=id) + def __init__(self, **kwargs): + super(FrontendIPConfiguration, self).__init__(**kwargs) self.inbound_nat_rules = None self.inbound_nat_pools = None self.outbound_nat_rules = None self.load_balancing_rules = None - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.zones = zones + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..8d0ee831f330 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/frontend_ip_configuration_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class FrontendIPConfiguration(SubResource): + """Frontend IP address of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar inbound_nat_rules: Read only. Inbound rules URIs that use this + frontend IP. + :vartype inbound_nat_rules: + list[~azure.mgmt.network.v2017_08_01.models.SubResource] + :ivar inbound_nat_pools: Read only. Inbound pools URIs that use this + frontend IP. + :vartype inbound_nat_pools: + list[~azure.mgmt.network.v2017_08_01.models.SubResource] + :ivar outbound_nat_rules: Read only. Outbound rules URIs that use this + frontend IP. + :vartype outbound_nat_rules: + list[~azure.mgmt.network.v2017_08_01.models.SubResource] + :ivar load_balancing_rules: Gets load balancing rules URIs that use this + frontend IP. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_08_01.models.SubResource] + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The Private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_08_01.models.Subnet + :param public_ip_address: The reference of the Public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'inbound_nat_rules': {'readonly': True}, + 'inbound_nat_pools': {'readonly': True}, + 'outbound_nat_rules': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[SubResource]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, zones=None, **kwargs) -> None: + super(FrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.inbound_nat_rules = None + self.inbound_nat_pools = None + self.outbound_nat_rules = None + self.load_balancing_rules = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.zones = zones diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route.py index 64a53f146c0b..0b96cb661e70 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route.py @@ -54,8 +54,8 @@ class GatewayRoute(Model): 'weight': {'key': 'weight', 'type': 'int'}, } - def __init__(self): - super(GatewayRoute, self).__init__() + def __init__(self, **kwargs): + super(GatewayRoute, self).__init__(**kwargs) self.local_address = None self.network = None self.next_hop = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route_list_result.py index 31f26ed44436..8845838c26f8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route_list_result.py @@ -23,6 +23,6 @@ class GatewayRouteListResult(Model): 'value': {'key': 'value', 'type': '[GatewayRoute]'}, } - def __init__(self, value=None): - super(GatewayRouteListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route_list_result_py3.py new file mode 100644 index 000000000000..5c9e90911f99 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRouteListResult(Model): + """List of virtual network gateway routes. + + :param value: List of gateway routes + :type value: list[~azure.mgmt.network.v2017_08_01.models.GatewayRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayRoute]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route_py3.py new file mode 100644 index 000000000000..1aa3ba60605f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRoute(Model): + """Gateway routing details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The gateway's local address + :vartype local_address: str + :ivar network: The route's network prefix + :vartype network: str + :ivar next_hop: The route's next hop + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from + :vartype source_peer: str + :ivar origin: The source this route was learned from + :vartype origin: str + :ivar as_path: The route's AS path sequence + :vartype as_path: str + :ivar weight: The route's weight + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(GatewayRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_pool.py index d5d79fd97f36..56e2402e32cf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_pool.py @@ -15,25 +15,29 @@ class InboundNatPool(SubResource): """Inbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. :type frontend_ip_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param protocol: The transport protocol for the endpoint. Possible values - are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :param protocol: Required. The transport protocol for the endpoint. + Possible values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.TransportProtocol - :param frontend_port_range_start: The first port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65534. + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. :type frontend_port_range_start: int - :param frontend_port_range_end: The last port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65535. + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. :type frontend_port_range_end: int - :param backend_port: The port used for internal connections on the - endpoint. Acceptable values are between 1 and 65535. + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. :type backend_port: int :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. @@ -65,13 +69,13 @@ class InboundNatPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port_range_start, frontend_port_range_end, backend_port, id=None, frontend_ip_configuration=None, provisioning_state=None, name=None, etag=None): - super(InboundNatPool, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.protocol = protocol - self.frontend_port_range_start = frontend_port_range_start - self.frontend_port_range_end = frontend_port_range_end - self.backend_port = backend_port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(InboundNatPool, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.protocol = kwargs.get('protocol', None) + self.frontend_port_range_start = kwargs.get('frontend_port_range_start', None) + self.frontend_port_range_end = kwargs.get('frontend_port_range_end', None) + self.backend_port = kwargs.get('backend_port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_pool_py3.py new file mode 100644 index 000000000000..2326071970f5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_pool_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatPool(SubResource): + """Inbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param protocol: Required. The transport protocol for the endpoint. + Possible values are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_08_01.models.TransportProtocol + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. + :type frontend_port_range_start: int + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. + :type frontend_port_range_end: int + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port_range_start': {'required': True}, + 'frontend_port_range_end': {'required': True}, + 'backend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, + 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port_range_start: int, frontend_port_range_end: int, backend_port: int, id: str=None, frontend_ip_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatPool, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.protocol = protocol + self.frontend_port_range_start = frontend_port_range_start + self.frontend_port_range_end = frontend_port_range_end + self.backend_port = backend_port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_rule.py index 06ef1a4d71f7..9721b9c56c68 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_rule.py @@ -78,15 +78,15 @@ class InboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, protocol=None, frontend_port=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(InboundNatRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration + def __init__(self, **kwargs): + super(InboundNatRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) self.backend_ip_configuration = None - self.protocol = protocol - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_rule_py3.py new file mode 100644 index 000000000000..b451493d9589 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/inbound_nat_rule_py3.py @@ -0,0 +1,92 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatRule(SubResource): + """Inbound NAT rule of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :ivar backend_ip_configuration: A reference to a private IP address + defined on a network interface of a VM. Traffic sent to the frontend port + of each of the frontend IP configurations is forwarded to the backend IP. + :vartype backend_ip_configuration: + ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration + :param protocol: The transport protocol for the endpoint. Possible values + are: 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_08_01.models.TransportProtocol + :param frontend_port: The port for the external endpoint. Port numbers for + each rule must be unique within the Load Balancer. Acceptable values range + from 1 to 65534. + :type frontend_port: int + :param backend_port: The port used for the internal endpoint. Acceptable + values range from 1 to 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, protocol=None, frontend_port: int=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_ip_configuration = None + self.protocol = protocol + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_address_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_address_availability_result.py index f2cb36a550ec..6bcf52275711 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_address_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_address_availability_result.py @@ -27,7 +27,7 @@ class IPAddressAvailabilityResult(Model): 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, } - def __init__(self, available=None, available_ip_addresses=None): - super(IPAddressAvailabilityResult, self).__init__() - self.available = available - self.available_ip_addresses = available_ip_addresses + def __init__(self, **kwargs): + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) + self.available_ip_addresses = kwargs.get('available_ip_addresses', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_address_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_address_availability_result_py3.py new file mode 100644 index 000000000000..e5fc4340d370 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_address_availability_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPAddressAvailabilityResult(Model): + """Response for CheckIPAddressAvailability API service call. + + :param available: Private IP address availability. + :type available: bool + :param available_ip_addresses: Contains other available private IP + addresses if the asked for address is taken. + :type available_ip_addresses: list[str] + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, + } + + def __init__(self, *, available: bool=None, available_ip_addresses=None, **kwargs) -> None: + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = available + self.available_ip_addresses = available_ip_addresses diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_configuration.py index bf3efdd5e596..c23c017b4cf5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_configuration.py @@ -51,12 +51,12 @@ class IPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(IPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(IPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_configuration_py3.py new file mode 100644 index 000000000000..69bb28387fb4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ip_configuration_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class IPConfiguration(SubResource): + """IP configuration. + + :param id: Resource ID. + :type id: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_08_01.models.Subnet + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(IPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipsec_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipsec_policy.py index b8e9f75e0830..8b1ecc36ae07 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipsec_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipsec_policy.py @@ -15,39 +15,41 @@ class IpsecPolicy(Model): """An IPSec Policy configuration for a virtual network gateway connection. - :param sa_life_time_seconds: The IPSec Security Association (also called - Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN - tunnel. + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. :type sa_life_time_seconds: int - :param sa_data_size_kilobytes: The IPSec Security Association (also called - Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN - tunnel. + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. :type sa_data_size_kilobytes: int - :param ipsec_encryption: The IPSec encryption algorithm (IKE phase 1). - Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', - 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' :type ipsec_encryption: str or ~azure.mgmt.network.v2017_08_01.models.IpsecEncryption - :param ipsec_integrity: The IPSec integrity algorithm (IKE phase 1). - Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256' :type ipsec_integrity: str or ~azure.mgmt.network.v2017_08_01.models.IpsecIntegrity - :param ike_encryption: The IKE encryption algorithm (IKE phase 2). - Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' :type ike_encryption: str or ~azure.mgmt.network.v2017_08_01.models.IkeEncryption - :param ike_integrity: The IKE integrity algorithm (IKE phase 2). Possible - values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' :type ike_integrity: str or ~azure.mgmt.network.v2017_08_01.models.IkeIntegrity - :param dh_group: The DH Groups used in IKE Phase 1 for initial SA. - Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' :type dh_group: str or ~azure.mgmt.network.v2017_08_01.models.DhGroup - :param pfs_group: The DH Groups used in IKE Phase 2 for new child SA. - Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', - 'ECP384', 'PFS24' + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' :type pfs_group: str or ~azure.mgmt.network.v2017_08_01.models.PfsGroup """ @@ -73,13 +75,13 @@ class IpsecPolicy(Model): 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, } - def __init__(self, sa_life_time_seconds, sa_data_size_kilobytes, ipsec_encryption, ipsec_integrity, ike_encryption, ike_integrity, dh_group, pfs_group): - super(IpsecPolicy, self).__init__() - self.sa_life_time_seconds = sa_life_time_seconds - self.sa_data_size_kilobytes = sa_data_size_kilobytes - self.ipsec_encryption = ipsec_encryption - self.ipsec_integrity = ipsec_integrity - self.ike_encryption = ike_encryption - self.ike_integrity = ike_integrity - self.dh_group = dh_group - self.pfs_group = pfs_group + def __init__(self, **kwargs): + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = kwargs.get('sa_life_time_seconds', None) + self.sa_data_size_kilobytes = kwargs.get('sa_data_size_kilobytes', None) + self.ipsec_encryption = kwargs.get('ipsec_encryption', None) + self.ipsec_integrity = kwargs.get('ipsec_integrity', None) + self.ike_encryption = kwargs.get('ike_encryption', None) + self.ike_integrity = kwargs.get('ike_integrity', None) + self.dh_group = kwargs.get('dh_group', None) + self.pfs_group = kwargs.get('pfs_group', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipsec_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipsec_policy_py3.py new file mode 100644 index 000000000000..9758cb869b07 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipsec_policy_py3.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IpsecPolicy(Model): + """An IPSec Policy configuration for a virtual network gateway connection. + + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. + :type sa_life_time_seconds: int + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. + :type sa_data_size_kilobytes: int + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :type ipsec_encryption: str or + ~azure.mgmt.network.v2017_08_01.models.IpsecEncryption + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + 'GCMAES192', 'GCMAES256' + :type ipsec_integrity: str or + ~azure.mgmt.network.v2017_08_01.models.IpsecIntegrity + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :type ike_encryption: str or + ~azure.mgmt.network.v2017_08_01.models.IkeEncryption + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :type ike_integrity: str or + ~azure.mgmt.network.v2017_08_01.models.IkeIntegrity + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + :type dh_group: str or ~azure.mgmt.network.v2017_08_01.models.DhGroup + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' + :type pfs_group: str or ~azure.mgmt.network.v2017_08_01.models.PfsGroup + """ + + _validation = { + 'sa_life_time_seconds': {'required': True}, + 'sa_data_size_kilobytes': {'required': True}, + 'ipsec_encryption': {'required': True}, + 'ipsec_integrity': {'required': True}, + 'ike_encryption': {'required': True}, + 'ike_integrity': {'required': True}, + 'dh_group': {'required': True}, + 'pfs_group': {'required': True}, + } + + _attribute_map = { + 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, + 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, + 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, + 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, + 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, + 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, + 'dh_group': {'key': 'dhGroup', 'type': 'str'}, + 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, + } + + def __init__(self, *, sa_life_time_seconds: int, sa_data_size_kilobytes: int, ipsec_encryption, ipsec_integrity, ike_encryption, ike_integrity, dh_group, pfs_group, **kwargs) -> None: + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = sa_life_time_seconds + self.sa_data_size_kilobytes = sa_data_size_kilobytes + self.ipsec_encryption = ipsec_encryption + self.ipsec_integrity = ipsec_integrity + self.ike_encryption = ike_encryption + self.ike_integrity = ike_integrity + self.dh_group = dh_group + self.pfs_group = pfs_group diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipv6_express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipv6_express_route_circuit_peering_config.py index 2ae9ce968dca..5bb4abf45244 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipv6_express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipv6_express_route_circuit_peering_config.py @@ -38,10 +38,10 @@ class Ipv6ExpressRouteCircuitPeeringConfig(Model): 'state': {'key': 'state', 'type': 'str'}, } - def __init__(self, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, microsoft_peering_config=None, route_filter=None, state=None): - super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__() - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.microsoft_peering_config = microsoft_peering_config - self.route_filter = route_filter - self.state = state + def __init__(self, **kwargs): + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.route_filter = kwargs.get('route_filter', None) + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipv6_express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipv6_express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..2cfddb78d568 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/ipv6_express_route_circuit_peering_config_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv6ExpressRouteCircuitPeeringConfig(Model): + """Contains IPv6 peering config. + + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2017_08_01.models.RouteFilter + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringState + """ + + _attribute_map = { + 'primary_peer_address_prefix': {'key': 'primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'secondaryPeerAddressPrefix', 'type': 'str'}, + 'microsoft_peering_config': {'key': 'microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'route_filter': {'key': 'routeFilter', 'type': 'RouteFilter'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, microsoft_peering_config=None, route_filter=None, state=None, **kwargs) -> None: + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.microsoft_peering_config = microsoft_peering_config + self.route_filter = route_filter + self.state = state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer.py index a389e185fa8c..b32b5008e048 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer.py @@ -100,16 +100,16 @@ class LoadBalancer(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(LoadBalancer, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pools = backend_address_pools - self.load_balancing_rules = load_balancing_rules - self.probes = probes - self.inbound_nat_rules = inbound_nat_rules - self.inbound_nat_pools = inbound_nat_pools - self.outbound_nat_rules = outbound_nat_rules - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancer, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.load_balancing_rules = kwargs.get('load_balancing_rules', None) + self.probes = kwargs.get('probes', None) + self.inbound_nat_rules = kwargs.get('inbound_nat_rules', None) + self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) + self.outbound_nat_rules = kwargs.get('outbound_nat_rules', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer_py3.py new file mode 100644 index 000000000000..6d6996b6596b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer_py3.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LoadBalancer(Resource): + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The load balancer SKU. + :type sku: ~azure.mgmt.network.v2017_08_01.models.LoadBalancerSku + :param frontend_ip_configurations: Object representing the frontend IPs to + be used for the load balancer + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_08_01.models.FrontendIPConfiguration] + :param backend_address_pools: Collection of backend address pools used by + a load balancer + :type backend_address_pools: + list[~azure.mgmt.network.v2017_08_01.models.BackendAddressPool] + :param load_balancing_rules: Object collection representing the load + balancing rules Gets the provisioning + :type load_balancing_rules: + list[~azure.mgmt.network.v2017_08_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer + :type probes: list[~azure.mgmt.network.v2017_08_01.models.Probe] + :param inbound_nat_rules: Collection of inbound NAT Rules used by a load + balancer. Defining inbound NAT rules on your load balancer is mutually + exclusive with defining an inbound NAT pool. Inbound NAT pools are + referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an Inbound NAT pool. They + have to reference individual inbound NAT rules. + :type inbound_nat_rules: + list[~azure.mgmt.network.v2017_08_01.models.InboundNatRule] + :param inbound_nat_pools: Defines an external port range for inbound NAT + to a single backend port on NICs associated with a load balancer. Inbound + NAT rules are created automatically for each NIC associated with the Load + Balancer using an external port from this range. Defining an Inbound NAT + pool on your Load Balancer is mutually exclusive with defining inbound Nat + rules. Inbound NAT pools are referenced from virtual machine scale sets. + NICs that are associated with individual virtual machines cannot reference + an inbound NAT pool. They have to reference individual inbound NAT rules. + :type inbound_nat_pools: + list[~azure.mgmt.network.v2017_08_01.models.InboundNatPool] + :param outbound_nat_rules: The outbound NAT rules. + :type outbound_nat_rules: + list[~azure.mgmt.network.v2017_08_01.models.OutboundNatRule] + :param resource_guid: The resource GUID property of the load balancer + resource. + :type resource_guid: str + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'LoadBalancerSku'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, + 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[OutboundNatRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancer, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pools = backend_address_pools + self.load_balancing_rules = load_balancing_rules + self.probes = probes + self.inbound_nat_rules = inbound_nat_rules + self.inbound_nat_pools = inbound_nat_pools + self.outbound_nat_rules = outbound_nat_rules + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer_sku.py index a80a46924ee3..f8ca9ad51161 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer_sku.py @@ -25,6 +25,6 @@ class LoadBalancerSku(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - super(LoadBalancerSku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer_sku_py3.py new file mode 100644 index 000000000000..1393d75fdde3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancer_sku_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LoadBalancerSku(Model): + """SKU of a load balancer. + + :param name: Name of a load balancer SKU. Possible values include: + 'Basic', 'Standard' + :type name: str or + ~azure.mgmt.network.v2017_08_01.models.LoadBalancerSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancing_rule.py index d30e7a6492d8..9ae9d77a93b6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancing_rule.py @@ -15,6 +15,8 @@ class LoadBalancingRule(SubResource): """A load balancing rule for a load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. @@ -27,8 +29,9 @@ class LoadBalancingRule(SubResource): :param probe: The reference of the load balancer probe used by the load balancing rule. :type probe: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param protocol: The transport protocol for the external endpoint. - Possible values are 'Udp' or 'Tcp'. Possible values include: 'Udp', 'Tcp' + :param protocol: Required. The transport protocol for the external + endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: + 'Udp', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.TransportProtocol :param load_distribution: The load distribution policy for this rule. @@ -36,9 +39,9 @@ class LoadBalancingRule(SubResource): Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' :type load_distribution: str or ~azure.mgmt.network.v2017_08_01.models.LoadDistribution - :param frontend_port: The port for the external endpoint. Port numbers for - each rule must be unique within the Load Balancer. Acceptable values are - between 1 and 65534. + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 1 and 65534. :type frontend_port: int :param backend_port: The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. @@ -90,18 +93,18 @@ class LoadBalancingRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port, id=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, disable_outbound_snat=None, provisioning_state=None, name=None, etag=None): - super(LoadBalancingRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.backend_address_pool = backend_address_pool - self.probe = probe - self.protocol = protocol - self.load_distribution = load_distribution - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.disable_outbound_snat = disable_outbound_snat - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancingRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.probe = kwargs.get('probe', None) + self.protocol = kwargs.get('protocol', None) + self.load_distribution = kwargs.get('load_distribution', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.disable_outbound_snat = kwargs.get('disable_outbound_snat', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancing_rule_py3.py new file mode 100644 index 000000000000..b82b21ed1857 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/load_balancing_rule_py3.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class LoadBalancingRule(SubResource): + """A load balancing rule for a load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param backend_address_pool: A reference to a pool of DIPs. Inbound + traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param probe: The reference of the load balancer probe used by the load + balancing rule. + :type probe: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param protocol: Required. The transport protocol for the external + endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: + 'Udp', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_08_01.models.TransportProtocol + :param load_distribution: The load distribution policy for this rule. + Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + :type load_distribution: str or + ~azure.mgmt.network.v2017_08_01.models.LoadDistribution + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 1 and 65534. + :type frontend_port: int + :param backend_port: The port used for internal connections on the + endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param disable_outbound_snat: Configures SNAT for the VMs in the backend + pool to use the publicIP address specified in the frontend of the load + balancing rule. + :type disable_outbound_snat: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'disable_outbound_snat': {'key': 'properties.disableOutboundSnat', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port: int, id: str=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, disable_outbound_snat: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancingRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_address_pool = backend_address_pool + self.probe = probe + self.protocol = protocol + self.load_distribution = load_distribution + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.disable_outbound_snat = disable_outbound_snat + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/local_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/local_network_gateway.py index 439d52490a13..08334a2aacb1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/local_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/local_network_gateway.py @@ -67,11 +67,11 @@ class LocalNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, local_network_address_space=None, gateway_ip_address=None, bgp_settings=None, resource_guid=None, etag=None): - super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.local_network_address_space = local_network_address_space - self.gateway_ip_address = gateway_ip_address - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(LocalNetworkGateway, self).__init__(**kwargs) + self.local_network_address_space = kwargs.get('local_network_address_space', None) + self.gateway_ip_address = kwargs.get('gateway_ip_address', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/local_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/local_network_gateway_py3.py new file mode 100644 index 000000000000..f132198b0f2c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/local_network_gateway_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LocalNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param local_network_address_space: Local network site address space. + :type local_network_address_space: + ~azure.mgmt.network.v2017_08_01.models.AddressSpace + :param gateway_ip_address: IP address of local network gateway. + :type gateway_ip_address: str + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2017_08_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + LocalNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', + and 'Failed'. + :vartype provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, + 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, local_network_address_space=None, gateway_ip_address: str=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.local_network_address_space = local_network_address_space + self.gateway_ip_address = gateway_ip_address + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface.py index d6e9685439d6..f06493866ca6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface.py @@ -87,16 +87,16 @@ class NetworkInterface(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address=None, primary=None, enable_accelerated_networking=None, enable_ip_forwarding=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkInterface, self).__init__(id=id, location=location, tags=tags) - self.virtual_machine = virtual_machine - self.network_security_group = network_security_group - self.ip_configurations = ip_configurations - self.dns_settings = dns_settings - self.mac_address = mac_address - self.primary = primary - self.enable_accelerated_networking = enable_accelerated_networking - self.enable_ip_forwarding = enable_ip_forwarding - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.virtual_machine = kwargs.get('virtual_machine', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.mac_address = kwargs.get('mac_address', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_association.py index 8c8928c70cfa..b1f4d37a503c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_association.py @@ -34,7 +34,7 @@ class NetworkInterfaceAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(NetworkInterfaceAssociation, self).__init__() + def __init__(self, **kwargs): + super(NetworkInterfaceAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_association_py3.py new file mode 100644 index 000000000000..60648d97ecb7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Network interface ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(NetworkInterfaceAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_dns_settings.py index 675a4a1eb08a..b6ee0ff40d51 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_dns_settings.py @@ -46,10 +46,10 @@ class NetworkInterfaceDnsSettings(Model): 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, } - def __init__(self, dns_servers=None, applied_dns_servers=None, internal_dns_name_label=None, internal_fqdn=None, internal_domain_name_suffix=None): - super(NetworkInterfaceDnsSettings, self).__init__() - self.dns_servers = dns_servers - self.applied_dns_servers = applied_dns_servers - self.internal_dns_name_label = internal_dns_name_label - self.internal_fqdn = internal_fqdn - self.internal_domain_name_suffix = internal_domain_name_suffix + def __init__(self, **kwargs): + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + self.applied_dns_servers = kwargs.get('applied_dns_servers', None) + self.internal_dns_name_label = kwargs.get('internal_dns_name_label', None) + self.internal_fqdn = kwargs.get('internal_fqdn', None) + self.internal_domain_name_suffix = kwargs.get('internal_domain_name_suffix', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_dns_settings_py3.py new file mode 100644 index 000000000000..ccdcc937def8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_dns_settings_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceDnsSettings(Model): + """DNS settings of a network interface. + + :param dns_servers: List of DNS servers IP addresses. Use + 'AzureProvidedDNS' to switch to azure provided DNS resolution. + 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + only value in dnsServers collection. + :type dns_servers: list[str] + :param applied_dns_servers: If the VM that uses this NIC is part of an + Availability Set, then this list will have the union of all DNS servers + from all NICs that are part of the Availability Set. This property is what + is configured on each of those VMs. + :type applied_dns_servers: list[str] + :param internal_dns_name_label: Relative DNS name for this NIC used for + internal communications between VMs in the same virtual network. + :type internal_dns_name_label: str + :param internal_fqdn: Fully qualified DNS name supporting internal + communications between VMs in the same virtual network. + :type internal_fqdn: str + :param internal_domain_name_suffix: Even if internalDnsNameLabel is not + specified, a DNS entry is created for the primary NIC of the VM. This DNS + name can be constructed by concatenating the VM name with the value of + internalDomainNameSuffix. + :type internal_domain_name_suffix: str + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, + 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, + } + + def __init__(self, *, dns_servers=None, applied_dns_servers=None, internal_dns_name_label: str=None, internal_fqdn: str=None, internal_domain_name_suffix: str=None, **kwargs) -> None: + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers + self.applied_dns_servers = applied_dns_servers + self.internal_dns_name_label = internal_dns_name_label + self.internal_fqdn = internal_fqdn + self.internal_domain_name_suffix = internal_domain_name_suffix diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_ip_configuration.py index 18e83d4b26d6..8dae6df92827 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_ip_configuration.py @@ -78,17 +78,17 @@ class NetworkInterfaceIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(NetworkInterfaceIPConfiguration, self).__init__(id=id) - self.application_gateway_backend_address_pools = application_gateway_backend_address_pools - self.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.private_ip_address_version = private_ip_address_version - self.subnet = subnet - self.primary = primary - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterfaceIPConfiguration, self).__init__(**kwargs) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_rules = kwargs.get('load_balancer_inbound_nat_rules', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_ip_configuration_py3.py new file mode 100644 index 000000000000..71f39085a89b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_ip_configuration_py3.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class NetworkInterfaceIPConfiguration(SubResource): + """IPConfiguration in a network interface. + + :param id: Resource ID. + :type id: str + :param application_gateway_backend_address_pools: The reference of + ApplicationGatewayBackendAddressPool resource. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendAddressPool] + :param load_balancer_backend_address_pools: The reference of + LoadBalancerBackendAddressPool resource. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2017_08_01.models.BackendAddressPool] + :param load_balancer_inbound_nat_rules: A list of references of + LoadBalancerInboundNatRules. + :type load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2017_08_01.models.InboundNatRule] + :param private_ip_address: Private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: Defines how a private IP address is + assigned. Possible values are: 'Static' and 'Dynamic'. Possible values + include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod + :param private_ip_address_version: Available from Api-Version 2016-03-30 + onwards, it represents whether the specific ipconfiguration is IPv4 or + IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.network.v2017_08_01.models.IPVersion + :param subnet: Subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.network.v2017_08_01.models.Subnet + :param primary: Gets whether this is a primary customer address on the + network interface. + :type primary: bool + :param public_ip_address: Public IP address bound to the IP configuration. + :type public_ip_address: + ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress + :param provisioning_state: The provisioning state of the network interface + IP configuration. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address: str=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary: bool=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterfaceIPConfiguration, self).__init__(id=id, **kwargs) + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.private_ip_address_version = private_ip_address_version + self.subnet = subnet + self.primary = primary + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_py3.py new file mode 100644 index 000000000000..bfd11ae4fc92 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_interface_py3.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkInterface(Resource): + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param virtual_machine: The reference of a virtual machine. + :type virtual_machine: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup + :param ip_configurations: A list of IPConfigurations of the network + interface. + :type ip_configurations: + list[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: + ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceDnsSettings + :param mac_address: The MAC address of the network interface. + :type mac_address: str + :param primary: Gets whether this is a primary network interface on a + virtual machine. + :type primary: bool + :param enable_accelerated_networking: If the network interface is + accelerated networking enabled. + :type enable_accelerated_networking: bool + :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on + this network interface. + :type enable_ip_forwarding: bool + :param resource_guid: The resource GUID property of the network interface + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, + 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address: str=None, primary: bool=None, enable_accelerated_networking: bool=None, enable_ip_forwarding: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterface, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.virtual_machine = virtual_machine + self.network_security_group = network_security_group + self.ip_configurations = ip_configurations + self.dns_settings = dns_settings + self.mac_address = mac_address + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.enable_ip_forwarding = enable_ip_forwarding + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_management_client_enums.py index 26b99abf8f2e..b0d2582bff1a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_management_client_enums.py @@ -12,44 +12,44 @@ from enum import Enum -class TransportProtocol(Enum): +class TransportProtocol(str, Enum): udp = "Udp" tcp = "Tcp" -class IPAllocationMethod(Enum): +class IPAllocationMethod(str, Enum): static = "Static" dynamic = "Dynamic" -class IPVersion(Enum): +class IPVersion(str, Enum): ipv4 = "IPv4" ipv6 = "IPv6" -class SecurityRuleProtocol(Enum): +class SecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" asterisk = "*" -class SecurityRuleAccess(Enum): +class SecurityRuleAccess(str, Enum): allow = "Allow" deny = "Deny" -class SecurityRuleDirection(Enum): +class SecurityRuleDirection(str, Enum): inbound = "Inbound" outbound = "Outbound" -class RouteNextHopType(Enum): +class RouteNextHopType(str, Enum): virtual_network_gateway = "VirtualNetworkGateway" vnet_local = "VnetLocal" @@ -58,25 +58,25 @@ class RouteNextHopType(Enum): none = "None" -class PublicIPAddressSkuName(Enum): +class PublicIPAddressSkuName(str, Enum): basic = "Basic" standard = "Standard" -class ApplicationGatewayProtocol(Enum): +class ApplicationGatewayProtocol(str, Enum): http = "Http" https = "Https" -class ApplicationGatewayCookieBasedAffinity(Enum): +class ApplicationGatewayCookieBasedAffinity(str, Enum): enabled = "Enabled" disabled = "Disabled" -class ApplicationGatewayBackendHealthServerHealth(Enum): +class ApplicationGatewayBackendHealthServerHealth(str, Enum): unknown = "Unknown" up = "Up" @@ -85,7 +85,7 @@ class ApplicationGatewayBackendHealthServerHealth(Enum): draining = "Draining" -class ApplicationGatewaySkuName(Enum): +class ApplicationGatewaySkuName(str, Enum): standard_small = "Standard_Small" standard_medium = "Standard_Medium" @@ -94,33 +94,33 @@ class ApplicationGatewaySkuName(Enum): waf_large = "WAF_Large" -class ApplicationGatewayTier(Enum): +class ApplicationGatewayTier(str, Enum): standard = "Standard" waf = "WAF" -class ApplicationGatewaySslProtocol(Enum): +class ApplicationGatewaySslProtocol(str, Enum): tl_sv1_0 = "TLSv1_0" tl_sv1_1 = "TLSv1_1" tl_sv1_2 = "TLSv1_2" -class ApplicationGatewaySslPolicyType(Enum): +class ApplicationGatewaySslPolicyType(str, Enum): predefined = "Predefined" custom = "Custom" -class ApplicationGatewaySslPolicyName(Enum): +class ApplicationGatewaySslPolicyName(str, Enum): app_gw_ssl_policy20150501 = "AppGwSslPolicy20150501" app_gw_ssl_policy20170401 = "AppGwSslPolicy20170401" app_gw_ssl_policy20170401_s = "AppGwSslPolicy20170401S" -class ApplicationGatewaySslCipherSuite(Enum): +class ApplicationGatewaySslCipherSuite(str, Enum): tls_ecdhe_rsa_with_aes_256_cbc_sha384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" tls_ecdhe_rsa_with_aes_128_cbc_sha256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" @@ -149,13 +149,13 @@ class ApplicationGatewaySslCipherSuite(Enum): tls_rsa_with_3_des_ede_cbc_sha = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" -class ApplicationGatewayRequestRoutingRuleType(Enum): +class ApplicationGatewayRequestRoutingRuleType(str, Enum): basic = "Basic" path_based_routing = "PathBasedRouting" -class ApplicationGatewayRedirectType(Enum): +class ApplicationGatewayRedirectType(str, Enum): permanent = "Permanent" found = "Found" @@ -163,7 +163,7 @@ class ApplicationGatewayRedirectType(Enum): temporary = "Temporary" -class ApplicationGatewayOperationalState(Enum): +class ApplicationGatewayOperationalState(str, Enum): stopped = "Stopped" starting = "Starting" @@ -171,19 +171,19 @@ class ApplicationGatewayOperationalState(Enum): stopping = "Stopping" -class ApplicationGatewayFirewallMode(Enum): +class ApplicationGatewayFirewallMode(str, Enum): detection = "Detection" prevention = "Prevention" -class AuthorizationUseStatus(Enum): +class AuthorizationUseStatus(str, Enum): available = "Available" in_use = "InUse" -class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(str, Enum): not_configured = "NotConfigured" configuring = "Configuring" @@ -191,38 +191,38 @@ class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): validation_needed = "ValidationNeeded" -class Access(Enum): +class Access(str, Enum): allow = "Allow" deny = "Deny" -class ExpressRouteCircuitPeeringType(Enum): +class ExpressRouteCircuitPeeringType(str, Enum): azure_public_peering = "AzurePublicPeering" azure_private_peering = "AzurePrivatePeering" microsoft_peering = "MicrosoftPeering" -class ExpressRouteCircuitPeeringState(Enum): +class ExpressRouteCircuitPeeringState(str, Enum): disabled = "Disabled" enabled = "Enabled" -class ExpressRouteCircuitSkuTier(Enum): +class ExpressRouteCircuitSkuTier(str, Enum): standard = "Standard" premium = "Premium" -class ExpressRouteCircuitSkuFamily(Enum): +class ExpressRouteCircuitSkuFamily(str, Enum): unlimited_data = "UnlimitedData" metered_data = "MeteredData" -class ServiceProviderProvisioningState(Enum): +class ServiceProviderProvisioningState(str, Enum): not_provisioned = "NotProvisioned" provisioning = "Provisioning" @@ -230,40 +230,40 @@ class ServiceProviderProvisioningState(Enum): deprovisioning = "Deprovisioning" -class LoadBalancerSkuName(Enum): +class LoadBalancerSkuName(str, Enum): basic = "Basic" standard = "Standard" -class LoadDistribution(Enum): +class LoadDistribution(str, Enum): default = "Default" source_ip = "SourceIP" source_ip_protocol = "SourceIPProtocol" -class ProbeProtocol(Enum): +class ProbeProtocol(str, Enum): http = "Http" tcp = "Tcp" -class NetworkOperationStatus(Enum): +class NetworkOperationStatus(str, Enum): in_progress = "InProgress" succeeded = "Succeeded" failed = "Failed" -class EffectiveSecurityRuleProtocol(Enum): +class EffectiveSecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" all = "All" -class EffectiveRouteSource(Enum): +class EffectiveRouteSource(str, Enum): unknown = "Unknown" user = "User" @@ -271,13 +271,13 @@ class EffectiveRouteSource(Enum): default = "Default" -class EffectiveRouteState(Enum): +class EffectiveRouteState(str, Enum): active = "Active" invalid = "Invalid" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): succeeded = "Succeeded" updating = "Updating" @@ -285,25 +285,25 @@ class ProvisioningState(Enum): failed = "Failed" -class AssociationType(Enum): +class AssociationType(str, Enum): associated = "Associated" contains = "Contains" -class Direction(Enum): +class Direction(str, Enum): inbound = "Inbound" outbound = "Outbound" -class Protocol(Enum): +class Protocol(str, Enum): tcp = "TCP" udp = "UDP" -class NextHopType(Enum): +class NextHopType(str, Enum): internet = "Internet" virtual_appliance = "VirtualAppliance" @@ -313,14 +313,14 @@ class NextHopType(Enum): none = "None" -class PcProtocol(Enum): +class PcProtocol(str, Enum): tcp = "TCP" udp = "UDP" any = "Any" -class PcStatus(Enum): +class PcStatus(str, Enum): not_started = "NotStarted" running = "Running" @@ -329,7 +329,7 @@ class PcStatus(Enum): unknown = "Unknown" -class PcError(Enum): +class PcError(str, Enum): internal_error = "InternalError" agent_stopped = "AgentStopped" @@ -338,20 +338,20 @@ class PcError(Enum): storage_failed = "StorageFailed" -class Origin(Enum): +class Origin(str, Enum): local = "Local" inbound = "Inbound" outbound = "Outbound" -class Severity(Enum): +class Severity(str, Enum): error = "Error" warning = "Warning" -class IssueType(Enum): +class IssueType(str, Enum): unknown = "Unknown" agent_stopped = "AgentStopped" @@ -364,7 +364,7 @@ class IssueType(Enum): platform = "Platform" -class ConnectionStatus(Enum): +class ConnectionStatus(str, Enum): unknown = "Unknown" connected = "Connected" @@ -372,26 +372,26 @@ class ConnectionStatus(Enum): degraded = "Degraded" -class VirtualNetworkPeeringState(Enum): +class VirtualNetworkPeeringState(str, Enum): initiated = "Initiated" connected = "Connected" disconnected = "Disconnected" -class VirtualNetworkGatewayType(Enum): +class VirtualNetworkGatewayType(str, Enum): vpn = "Vpn" express_route = "ExpressRoute" -class VpnType(Enum): +class VpnType(str, Enum): policy_based = "PolicyBased" route_based = "RouteBased" -class VirtualNetworkGatewaySkuName(Enum): +class VirtualNetworkGatewaySkuName(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -402,7 +402,7 @@ class VirtualNetworkGatewaySkuName(Enum): vpn_gw3 = "VpnGw3" -class VirtualNetworkGatewaySkuTier(Enum): +class VirtualNetworkGatewaySkuTier(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -413,13 +413,13 @@ class VirtualNetworkGatewaySkuTier(Enum): vpn_gw3 = "VpnGw3" -class VpnClientProtocol(Enum): +class VpnClientProtocol(str, Enum): ike_v2 = "IkeV2" sstp = "SSTP" -class BgpPeerState(Enum): +class BgpPeerState(str, Enum): unknown = "Unknown" stopped = "Stopped" @@ -428,19 +428,19 @@ class BgpPeerState(Enum): connected = "Connected" -class ProcessorArchitecture(Enum): +class ProcessorArchitecture(str, Enum): amd64 = "Amd64" x86 = "X86" -class AuthenticationMethod(Enum): +class AuthenticationMethod(str, Enum): eaptls = "EAPTLS" eapmscha_pv2 = "EAPMSCHAPv2" -class VirtualNetworkGatewayConnectionStatus(Enum): +class VirtualNetworkGatewayConnectionStatus(str, Enum): unknown = "Unknown" connecting = "Connecting" @@ -448,7 +448,7 @@ class VirtualNetworkGatewayConnectionStatus(Enum): not_connected = "NotConnected" -class VirtualNetworkGatewayConnectionType(Enum): +class VirtualNetworkGatewayConnectionType(str, Enum): ipsec = "IPsec" vnet2_vnet = "Vnet2Vnet" @@ -456,7 +456,7 @@ class VirtualNetworkGatewayConnectionType(Enum): vpn_client = "VPNClient" -class IpsecEncryption(Enum): +class IpsecEncryption(str, Enum): none = "None" des = "DES" @@ -469,7 +469,7 @@ class IpsecEncryption(Enum): gcmaes256 = "GCMAES256" -class IpsecIntegrity(Enum): +class IpsecIntegrity(str, Enum): md5 = "MD5" sha1 = "SHA1" @@ -479,7 +479,7 @@ class IpsecIntegrity(Enum): gcmaes256 = "GCMAES256" -class IkeEncryption(Enum): +class IkeEncryption(str, Enum): des = "DES" des3 = "DES3" @@ -488,7 +488,7 @@ class IkeEncryption(Enum): aes256 = "AES256" -class IkeIntegrity(Enum): +class IkeIntegrity(str, Enum): md5 = "MD5" sha1 = "SHA1" @@ -496,7 +496,7 @@ class IkeIntegrity(Enum): sha384 = "SHA384" -class DhGroup(Enum): +class DhGroup(str, Enum): none = "None" dh_group1 = "DHGroup1" @@ -508,7 +508,7 @@ class DhGroup(Enum): dh_group24 = "DHGroup24" -class PfsGroup(Enum): +class PfsGroup(str, Enum): none = "None" pfs1 = "PFS1" diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_security_group.py index 50dbbbcbe3c6..e13e990c49f4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_security_group.py @@ -75,12 +75,12 @@ class NetworkSecurityGroup(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, security_rules=None, default_security_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags) - self.security_rules = security_rules - self.default_security_rules = default_security_rules + def __init__(self, **kwargs): + super(NetworkSecurityGroup, self).__init__(**kwargs) + self.security_rules = kwargs.get('security_rules', None) + self.default_security_rules = kwargs.get('default_security_rules', None) self.network_interfaces = None self.subnets = None - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_security_group_py3.py new file mode 100644 index 000000000000..b63f19e15c37 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_security_group_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkSecurityGroup(Resource): + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param security_rules: A collection of security rules of the network + security group. + :type security_rules: + list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] + :param default_security_rules: The default security rules of network + security group. + :type default_security_rules: + list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network + interfaces. + :vartype network_interfaces: + list[~azure.mgmt.network.v2017_08_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2017_08_01.models.Subnet] + :param resource_guid: The resource GUID property of the network security + group resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, + 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, security_rules=None, default_security_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.security_rules = security_rules + self.default_security_rules = default_security_rules + self.network_interfaces = None + self.subnets = None + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_watcher.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_watcher.py index c90a59be1a89..85d254ca9325 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_watcher.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_watcher.py @@ -53,7 +53,7 @@ class NetworkWatcher(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, etag=None): - super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags) - self.etag = etag + def __init__(self, **kwargs): + super(NetworkWatcher, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_watcher_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_watcher_py3.py new file mode 100644 index 000000000000..6586637e56d2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/network_watcher_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkWatcher(Resource): + """Network watcher in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.network.v2017_08_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, etag: str=None, **kwargs) -> None: + super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = etag + self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_parameters.py index 3e1478409a0a..54d8674c8884 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_parameters.py @@ -15,12 +15,14 @@ class NextHopParameters(Model): """Parameters that define the source and destination endpoint. - :param target_resource_id: The resource identifier of the target resource - against which the action is to be performed. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. :type target_resource_id: str - :param source_ip_address: The source IP address. + :param source_ip_address: Required. The source IP address. :type source_ip_address: str - :param destination_ip_address: The destination IP address. + :param destination_ip_address: Required. The destination IP address. :type destination_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be @@ -41,9 +43,9 @@ class NextHopParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, source_ip_address, destination_ip_address, target_nic_resource_id=None): - super(NextHopParameters, self).__init__() - self.target_resource_id = target_resource_id - self.source_ip_address = source_ip_address - self.destination_ip_address = destination_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.source_ip_address = kwargs.get('source_ip_address', None) + self.destination_ip_address = kwargs.get('destination_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_parameters_py3.py new file mode 100644 index 000000000000..50ee3d334e91 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_parameters_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopParameters(Model): + """Parameters that define the source and destination endpoint. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. + :type target_resource_id: str + :param source_ip_address: Required. The source IP address. + :type source_ip_address: str + :param destination_ip_address: Required. The destination IP address. + :type destination_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of the nics, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'source_ip_address': {'required': True}, + 'destination_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, + 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, source_ip_address: str, destination_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.source_ip_address = source_ip_address + self.destination_ip_address = destination_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_result.py index 111c214ec708..8907b778a3a4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_result.py @@ -35,8 +35,8 @@ class NextHopResult(Model): 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, } - def __init__(self, next_hop_type=None, next_hop_ip_address=None, route_table_id=None): - super(NextHopResult, self).__init__() - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.route_table_id = route_table_id + def __init__(self, **kwargs): + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.route_table_id = kwargs.get('route_table_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_result_py3.py new file mode 100644 index 000000000000..af3b242fed60 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/next_hop_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopResult(Model): + """The information about next hop from the specified VM. + + :param next_hop_type: Next hop type. Possible values include: 'Internet', + 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', + 'HyperNetGateway', 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_08_01.models.NextHopType + :param next_hop_ip_address: Next hop IP Address + :type next_hop_ip_address: str + :param route_table_id: The resource identifier for the route table + associated with the route being returned. If the route being returned does + not correspond to any user created routes then this field will be the + string 'System Route'. + :type route_table_id: str + """ + + _attribute_map = { + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type=None, next_hop_ip_address: str=None, route_table_id: str=None, **kwargs) -> None: + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.route_table_id = route_table_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/outbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/outbound_nat_rule.py index 774ad3bd4107..dad3ce658889 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/outbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/outbound_nat_rule.py @@ -15,6 +15,8 @@ class OutboundNatRule(SubResource): """Outbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param allocated_outbound_ports: The number of outbound ports to be used @@ -24,8 +26,8 @@ class OutboundNatRule(SubResource): balancer. :type frontend_ip_configurations: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param backend_address_pool: A reference to a pool of DIPs. Outbound - traffic is randomly load balanced across IPs in the backend IPs. + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. :type backend_address_pool: ~azure.mgmt.network.v2017_08_01.models.SubResource :param provisioning_state: Gets the provisioning state of the PublicIP @@ -53,11 +55,11 @@ class OutboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, backend_address_pool, id=None, allocated_outbound_ports=None, frontend_ip_configurations=None, provisioning_state=None, name=None, etag=None): - super(OutboundNatRule, self).__init__(id=id) - self.allocated_outbound_ports = allocated_outbound_ports - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pool = backend_address_pool - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(OutboundNatRule, self).__init__(**kwargs) + self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/outbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/outbound_nat_rule_py3.py new file mode 100644 index 000000000000..0671e6492fc5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/outbound_nat_rule_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class OutboundNatRule(SubResource): + """Outbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param allocated_outbound_ports: The number of outbound ports to be used + for NAT. + :type allocated_outbound_ports: int + :param frontend_ip_configurations: The Frontend IP addresses of the load + balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_08_01.models.SubResource] + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_address_pool': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, backend_address_pool, id: str=None, allocated_outbound_ports: int=None, frontend_ip_configurations=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(OutboundNatRule, self).__init__(id=id, **kwargs) + self.allocated_outbound_ports = allocated_outbound_ports + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pool = backend_address_pool + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture.py index 2af0db758e08..a628e097a59b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture.py @@ -15,8 +15,10 @@ class PacketCapture(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCapture(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCapture(Model): 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCapture, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCapture, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_filter.py index 0c7d35db0de3..9e467c7fde9a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_filter.py @@ -51,10 +51,10 @@ class PacketCaptureFilter(Model): 'remote_port': {'key': 'remotePort', 'type': 'str'}, } - def __init__(self, protocol="Any", local_ip_address=None, remote_ip_address=None, local_port=None, remote_port=None): - super(PacketCaptureFilter, self).__init__() - self.protocol = protocol - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.local_port = local_port - self.remote_port = remote_port + def __init__(self, **kwargs): + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', "Any") + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_filter_py3.py new file mode 100644 index 000000000000..8ae1e60214ab --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_filter_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureFilter(Model): + """Filter that is applied to packet capture request. Multiple filters can be + applied. + + :param protocol: Protocol to be filtered on. Possible values include: + 'TCP', 'UDP', 'Any'. Default value: "Any" . + :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.PcProtocol + :param local_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type local_ip_address: str + :param remote_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type remote_ip_address: str + :param local_port: Local port to be filtered on. Notation: "80" for single + port entry."80-85" for range. "80;443;" for multiple entries. Multiple + ranges not currently supported. Mixing ranges with multiple entries not + currently supported. Default = null. + :type local_port: str + :param remote_port: Remote port to be filtered on. Notation: "80" for + single port entry."80-85" for range. "80;443;" for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple + entries not currently supported. Default = null. + :type remote_port: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + } + + def __init__(self, *, protocol="Any", local_ip_address: str=None, remote_ip_address: str=None, local_port: str=None, remote_port: str=None, **kwargs) -> None: + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = protocol + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.local_port = local_port + self.remote_port = remote_port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_parameters.py index 773b63d290f8..07daa5859298 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_parameters.py @@ -15,8 +15,10 @@ class PacketCaptureParameters(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCaptureParameters(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCaptureParameters(Model): 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCaptureParameters, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_parameters_py3.py new file mode 100644 index 000000000000..380b2ff9f413 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_parameters_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureParameters(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_08_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_py3.py new file mode 100644 index 000000000000..9b977a975f92 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCapture(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_08_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCapture, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_query_status_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_query_status_result.py index d892135545b1..b99373c9c2c0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_query_status_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_query_status_result.py @@ -43,11 +43,11 @@ class PacketCaptureQueryStatusResult(Model): 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, } - def __init__(self, name=None, id=None, capture_start_time=None, packet_capture_status=None, stop_reason=None, packet_capture_error=None): - super(PacketCaptureQueryStatusResult, self).__init__() - self.name = name - self.id = id - self.capture_start_time = capture_start_time - self.packet_capture_status = packet_capture_status - self.stop_reason = stop_reason - self.packet_capture_error = packet_capture_error + def __init__(self, **kwargs): + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.capture_start_time = kwargs.get('capture_start_time', None) + self.packet_capture_status = kwargs.get('packet_capture_status', None) + self.stop_reason = kwargs.get('stop_reason', None) + self.packet_capture_error = kwargs.get('packet_capture_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_query_status_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_query_status_result_py3.py new file mode 100644 index 000000000000..7d073377aa6b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_query_status_result_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureQueryStatusResult(Model): + """Status of packet capture session. + + :param name: The name of the packet capture resource. + :type name: str + :param id: The ID of the packet capture resource. + :type id: str + :param capture_start_time: The start time of the packet capture session. + :type capture_start_time: datetime + :param packet_capture_status: The status of the packet capture session. + Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', + 'Unknown' + :type packet_capture_status: str or + ~azure.mgmt.network.v2017_08_01.models.PcStatus + :param stop_reason: The reason the current packet capture session was + stopped. + :type stop_reason: str + :param packet_capture_error: List of errors of packet capture session. + :type packet_capture_error: list[str or + ~azure.mgmt.network.v2017_08_01.models.PcError] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, + 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, + 'stop_reason': {'key': 'stopReason', 'type': 'str'}, + 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, id: str=None, capture_start_time=None, packet_capture_status=None, stop_reason: str=None, packet_capture_error=None, **kwargs) -> None: + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = name + self.id = id + self.capture_start_time = capture_start_time + self.packet_capture_status = packet_capture_status + self.stop_reason = stop_reason + self.packet_capture_error = packet_capture_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_result.py index f8342856187d..2224fcaac0af 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_result.py @@ -18,6 +18,8 @@ class PacketCaptureResult(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar name: Name of the packet capture session. :vartype name: str :ivar id: ID of the packet capture operation. @@ -25,8 +27,8 @@ class PacketCaptureResult(Model): :param etag: Default value: "A unique read-only string that changes whenever the resource is updated." . :type etag: str - :param target: The ID of the targeted resource, only VM is currently - supported. + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -37,7 +39,7 @@ class PacketCaptureResult(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation :param filters: @@ -70,15 +72,15 @@ class PacketCaptureResult(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, target, storage_location, etag="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None, provisioning_state=None): - super(PacketCaptureResult, self).__init__() + def __init__(self, **kwargs): + super(PacketCaptureResult, self).__init__(**kwargs) self.name = None self.id = None - self.etag = etag - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters - self.provisioning_state = provisioning_state + self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_result_py3.py new file mode 100644 index 000000000000..80886dab5b1f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_result_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureResult(Model): + """Information about packet capture session. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the packet capture session. + :vartype name: str + :ivar id: ID of the packet capture operation. + :vartype id: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_08_01.models.PacketCaptureFilter] + :param provisioning_state: The provisioning state of the packet capture + session. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2017_08_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, target: str, storage_location, etag: str="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, provisioning_state=None, **kwargs) -> None: + super(PacketCaptureResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = etag + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_storage_location.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_storage_location.py index 773b04d22501..62ed83d592b3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_storage_location.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_storage_location.py @@ -35,8 +35,8 @@ class PacketCaptureStorageLocation(Model): 'file_path': {'key': 'filePath', 'type': 'str'}, } - def __init__(self, storage_id=None, storage_path=None, file_path=None): - super(PacketCaptureStorageLocation, self).__init__() - self.storage_id = storage_id - self.storage_path = storage_path - self.file_path = file_path + def __init__(self, **kwargs): + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) + self.file_path = kwargs.get('file_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_storage_location_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_storage_location_py3.py new file mode 100644 index 000000000000..6925dd4f9bdf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/packet_capture_storage_location_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureStorageLocation(Model): + """Describes the storage location for a packet capture session. + + :param storage_id: The ID of the storage account to save the packet + capture session. Required if no local file path is provided. + :type storage_id: str + :param storage_path: The URI of the storage path to save the packet + capture. Must be a well-formed URI describing the location to save the + packet capture. + :type storage_path: str + :param file_path: A valid local path on the targeting VM. Must include the + name of the capture file (*.cap). For linux virtual machine it must start + with /var/captures. Required if no storage ID is provided, otherwise + optional. + :type file_path: str + """ + + _attribute_map = { + 'storage_id': {'key': 'storageId', 'type': 'str'}, + 'storage_path': {'key': 'storagePath', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + } + + def __init__(self, *, storage_id: str=None, storage_path: str=None, file_path: str=None, **kwargs) -> None: + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = storage_id + self.storage_path = storage_path + self.file_path = file_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter.py index 67294c090d1a..681d097dea03 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter.py @@ -60,12 +60,12 @@ class PatchRouteFilter(SubResource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, rules=None, peerings=None, tags=None): - super(PatchRouteFilter, self).__init__(id=id) - self.rules = rules - self.peerings = peerings + def __init__(self, **kwargs): + super(PatchRouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.peerings = kwargs.get('peerings', None) self.provisioning_state = None self.name = None self.etag = None self.type = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter_py3.py new file mode 100644 index 000000000000..607548138e1e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilter(SubResource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, rules=None, peerings=None, tags=None, **kwargs) -> None: + super(PatchRouteFilter, self).__init__(id=id, **kwargs) + self.rules = rules + self.peerings = peerings + self.provisioning_state = None + self.name = None + self.etag = None + self.type = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter_rule.py index e4d74609e03c..7f2393a090f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter_rule.py @@ -18,16 +18,18 @@ class PatchRouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2017_08_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -64,11 +66,11 @@ class PatchRouteFilterRule(SubResource): route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, tags=None): - super(PatchRouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(PatchRouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None self.name = None self.etag = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter_rule_py3.py new file mode 100644 index 000000000000..9cec9cfdb33d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter_rule_py3.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_08_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, tags=None, **kwargs) -> None: + super(PatchRouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = None + self.etag = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/probe.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/probe.py index cd8642c55e18..9fa1afe1bab9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/probe.py @@ -18,20 +18,22 @@ class Probe(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar load_balancing_rules: The load balancer rules that use this probe. :vartype load_balancing_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param protocol: The protocol of the end point. Possible values are: - 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the - probe to be successful. If 'Http' is specified, a 200 OK response from the - specifies URI is required for the probe to be successful. Possible values - include: 'Http', 'Tcp' + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.ProbeProtocol - :param port: The port for communicating the probe. Possible values range - from 1 to 65535, inclusive. + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. :type port: int :param interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is @@ -78,14 +80,14 @@ class Probe(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, port, id=None, interval_in_seconds=None, number_of_probes=None, request_path=None, provisioning_state=None, name=None, etag=None): - super(Probe, self).__init__(id=id) + def __init__(self, **kwargs): + super(Probe, self).__init__(**kwargs) self.load_balancing_rules = None - self.protocol = protocol - self.port = port - self.interval_in_seconds = interval_in_seconds - self.number_of_probes = number_of_probes - self.request_path = request_path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.port = kwargs.get('port', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.number_of_probes = kwargs.get('number_of_probes', None) + self.request_path = kwargs.get('request_path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/probe_py3.py new file mode 100644 index 000000000000..88f3c7210c96 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Probe(SubResource): + """A load balancer probe. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar load_balancing_rules: The load balancer rules that use this probe. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_08_01.models.SubResource] + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_08_01.models.ProbeProtocol + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. + :type port: int + :param interval_in_seconds: The interval, in seconds, for how frequently + to probe the endpoint for health status. Typically, the interval is + slightly less than half the allocated timeout period (in seconds) which + allows two full probes before taking the instance out of rotation. The + default value is 15, the minimum value is 5. + :type interval_in_seconds: int + :param number_of_probes: The number of probes where if no response, will + result in stopping further traffic from being delivered to the endpoint. + This values allows endpoints to be taken out of rotation faster or slower + than the typical times used in Azure. + :type number_of_probes: int + :param request_path: The URI used for requesting health status from the + VM. Path is required if a protocol is set to http. Otherwise, it is not + allowed. There is no default value. + :type request_path: str + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'load_balancing_rules': {'readonly': True}, + 'protocol': {'required': True}, + 'port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, + 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, port: int, id: str=None, interval_in_seconds: int=None, number_of_probes: int=None, request_path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Probe, self).__init__(id=id, **kwargs) + self.load_balancing_rules = None + self.protocol = protocol + self.port = port + self.interval_in_seconds = interval_in_seconds + self.number_of_probes = number_of_probes + self.request_path = request_path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address.py index 3165b88cda95..5ecd1c5391c3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address.py @@ -91,16 +91,16 @@ class PublicIPAddress(Resource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address=None, idle_timeout_in_minutes=None, resource_guid=None, provisioning_state=None, etag=None, zones=None): - super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.public_ip_allocation_method = public_ip_allocation_method - self.public_ip_address_version = public_ip_address_version + def __init__(self, **kwargs): + super(PublicIPAddress, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) + self.public_ip_address_version = kwargs.get('public_ip_address_version', None) self.ip_configuration = None - self.dns_settings = dns_settings - self.ip_address = ip_address - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag - self.zones = zones + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_address = kwargs.get('ip_address', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_dns_settings.py index a248461f05d7..07dfe30433a6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_dns_settings.py @@ -38,8 +38,8 @@ class PublicIPAddressDnsSettings(Model): 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, } - def __init__(self, domain_name_label=None, fqdn=None, reverse_fqdn=None): - super(PublicIPAddressDnsSettings, self).__init__() - self.domain_name_label = domain_name_label - self.fqdn = fqdn - self.reverse_fqdn = reverse_fqdn + def __init__(self, **kwargs): + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) + self.fqdn = kwargs.get('fqdn', None) + self.reverse_fqdn = kwargs.get('reverse_fqdn', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_dns_settings_py3.py new file mode 100644 index 000000000000..e84aa9c10bf5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_dns_settings_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressDnsSettings(Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :param domain_name_label: Gets or sets the Domain name label.The + concatenation of the domain name label and the regionalized DNS zone make + up the fully qualified domain name associated with the public IP address. + If a domain name label is specified, an A DNS record is created for the + public IP in the Microsoft Azure DNS system. + :type domain_name_label: str + :param fqdn: Gets the FQDN, Fully qualified domain name of the A DNS + record associated with the public IP. This is the concatenation of the + domainNameLabel and the regionalized DNS zone. + :type fqdn: str + :param reverse_fqdn: Gets or Sets the Reverse FQDN. A user-visible, fully + qualified domain name that resolves to this public IP address. If the + reverseFqdn is specified, then a PTR DNS record is created pointing from + the IP address in the in-addr.arpa domain to the reverse FQDN. + :type reverse_fqdn: str + """ + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, + } + + def __init__(self, *, domain_name_label: str=None, fqdn: str=None, reverse_fqdn: str=None, **kwargs) -> None: + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label + self.fqdn = fqdn + self.reverse_fqdn = reverse_fqdn diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_py3.py new file mode 100644 index 000000000000..d90929f412cd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_py3.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PublicIPAddress(Resource): + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The public IP address SKU. + :type sku: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddressSku + :param public_ip_allocation_method: The public IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type public_ip_allocation_method: str or + ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod + :param public_ip_address_version: The public IP address version. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + :type public_ip_address_version: str or + ~azure.mgmt.network.v2017_08_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP + address. + :vartype ip_configuration: + ~azure.mgmt.network.v2017_08_01.models.IPConfiguration + :param dns_settings: The FQDN of the DNS record associated with the public + IP address. + :type dns_settings: + ~azure.mgmt.network.v2017_08_01.models.PublicIPAddressDnsSettings + :param ip_address: The IP address associated with the public IP address + resource. + :type ip_address: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param resource_guid: The resource GUID property of the public IP + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address: str=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, zones=None, **kwargs) -> None: + super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.public_ip_allocation_method = public_ip_allocation_method + self.public_ip_address_version = public_ip_address_version + self.ip_configuration = None + self.dns_settings = dns_settings + self.ip_address = ip_address + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag + self.zones = zones diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_sku.py index f2ef83f4e96c..3749b5be6338 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_sku.py @@ -25,6 +25,6 @@ class PublicIPAddressSku(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - super(PublicIPAddressSku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_sku_py3.py new file mode 100644 index 000000000000..3f7d8152a827 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/public_ip_address_sku_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressSku(Model): + """SKU of a public IP address. + + :param name: Name of a public IP address SKU. Possible values include: + 'Basic', 'Standard' + :type name: str or + ~azure.mgmt.network.v2017_08_01.models.PublicIPAddressSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/query_troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/query_troubleshooting_parameters.py index 9b6801eb7b63..6ae1924916c6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/query_troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/query_troubleshooting_parameters.py @@ -15,7 +15,9 @@ class QueryTroubleshootingParameters(Model): """Parameters that define the resource to query the troubleshooting result. - :param target_resource_id: The target resource ID to query the + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the troubleshooting result. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class QueryTroubleshootingParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(QueryTroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/query_troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/query_troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..b5fccb87857c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/query_troubleshooting_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryTroubleshootingParameters(Model): + """Parameters that define the resource to query the troubleshooting result. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the + troubleshooting result. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource.py index ff5f1f40e14e..7dabab29ac9d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource.py @@ -43,10 +43,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, location=None, tags=None): - super(Resource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource_navigation_link.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource_navigation_link.py index 9b4484be654a..705698f513f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource_navigation_link.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource_navigation_link.py @@ -49,10 +49,10 @@ class ResourceNavigationLink(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, linked_resource_type=None, link=None, name=None): - super(ResourceNavigationLink, self).__init__(id=id) - self.linked_resource_type = linked_resource_type - self.link = link + def __init__(self, **kwargs): + super(ResourceNavigationLink, self).__init__(**kwargs) + self.linked_resource_type = kwargs.get('linked_resource_type', None) + self.link = kwargs.get('link', None) self.provisioning_state = None - self.name = name + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource_navigation_link_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource_navigation_link_py3.py new file mode 100644 index 000000000000..5cb22d347836 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource_navigation_link_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ResourceNavigationLink(SubResource): + """ResourceNavigationLink resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource + :type link: str + :ivar provisioning_state: Provisioning state of the ResourceNavigationLink + resource. + :vartype provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, linked_resource_type: str=None, link: str=None, name: str=None, **kwargs) -> None: + super(ResourceNavigationLink, self).__init__(id=id, **kwargs) + self.linked_resource_type = linked_resource_type + self.link = link + self.provisioning_state = None + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource_py3.py new file mode 100644 index 000000000000..ae95b78b4f23 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/resource_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Common resource representation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/retention_policy_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/retention_policy_parameters.py index 102f4c5c3b4c..28cb43056d47 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/retention_policy_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/retention_policy_parameters.py @@ -26,7 +26,7 @@ class RetentionPolicyParameters(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, days=0, enabled=False): - super(RetentionPolicyParameters, self).__init__() - self.days = days - self.enabled = enabled + def __init__(self, **kwargs): + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = kwargs.get('days', 0) + self.enabled = kwargs.get('enabled', False) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/retention_policy_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/retention_policy_parameters_py3.py new file mode 100644 index 000000000000..3b2ffc5e741e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/retention_policy_parameters_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RetentionPolicyParameters(Model): + """Parameters that define the retention policy for flow log. + + :param days: Number of days to retain flow log records. Default value: 0 . + :type days: int + :param enabled: Flag to enable/disable retention. Default value: False . + :type enabled: bool + """ + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, days: int=0, enabled: bool=False, **kwargs) -> None: + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = days + self.enabled = enabled diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route.py index df0260a8cb58..82ecf229fda9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route.py @@ -15,13 +15,15 @@ class Route(SubResource): """Route resource. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param address_prefix: The destination CIDR to which the route applies. :type address_prefix: str - :param next_hop_type: The type of Azure hop the packet should be sent to. - Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - 'VirtualAppliance', and 'None'. Possible values include: + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' :type next_hop_type: str or @@ -55,11 +57,11 @@ class Route(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, next_hop_type, id=None, address_prefix=None, next_hop_ip_address=None, provisioning_state=None, name=None, etag=None): - super(Route, self).__init__(id=id) - self.address_prefix = address_prefix - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(Route, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter.py index c6b14a18e40c..04b918f02613 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter.py @@ -62,9 +62,9 @@ class RouteFilter(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, rules=None, peerings=None): - super(RouteFilter, self).__init__(id=id, location=location, tags=tags) - self.rules = rules - self.peerings = peerings + def __init__(self, **kwargs): + super(RouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.peerings = kwargs.get('peerings', None) self.provisioning_state = None self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter_py3.py new file mode 100644 index 000000000000..340f96920595 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteFilter(Resource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, rules=None, peerings=None, **kwargs) -> None: + super(RouteFilter, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.rules = rules + self.peerings = peerings + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter_rule.py index 6b38286846f1..18f0a6e7432b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter_rule.py @@ -18,16 +18,18 @@ class RouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2017_08_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -66,12 +68,12 @@ class RouteFilterRule(SubResource): route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, name=None, location=None, tags=None): - super(RouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(RouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None - self.name = name - self.location = location + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) self.etag = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter_rule_py3.py new file mode 100644 index 000000000000..0778efad6f45 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_filter_rule_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class RouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_08_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param location: Resource location. + :type location: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(RouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = name + self.location = location + self.etag = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_py3.py new file mode 100644 index 000000000000..7180d668f6d7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Route(SubResource): + """Route resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param address_prefix: The destination CIDR to which the route applies. + :type address_prefix: str + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_08_01.models.RouteNextHopType + :param next_hop_ip_address: The IP address packets should be forwarded to. + Next hop values are only allowed in routes where the next hop type is + VirtualAppliance. + :type next_hop_ip_address: str + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'next_hop_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type, id: str=None, address_prefix: str=None, next_hop_ip_address: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Route, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_table.py index b214df6b556a..651b9cbe7d73 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_table.py @@ -58,9 +58,9 @@ class RouteTable(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, routes=None, provisioning_state=None, etag=None): - super(RouteTable, self).__init__(id=id, location=location, tags=tags) - self.routes = routes + def __init__(self, **kwargs): + super(RouteTable, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) self.subnets = None - self.provisioning_state = provisioning_state - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_table_py3.py new file mode 100644 index 000000000000..ba9d42b5df53 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/route_table_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteTable(Resource): + """Route table resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param routes: Collection of routes contained within a route table. + :type routes: list[~azure.mgmt.network.v2017_08_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2017_08_01.models.Subnet] + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'routes': {'key': 'properties.routes', 'type': '[Route]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, routes=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(RouteTable, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.routes = routes + self.subnets = None + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_network_interface.py index 4b0a64691a47..44a7db046f05 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_network_interface.py @@ -27,7 +27,7 @@ class SecurityGroupNetworkInterface(Model): 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, } - def __init__(self, id=None, security_rule_associations=None): - super(SecurityGroupNetworkInterface, self).__init__() - self.id = id - self.security_rule_associations = security_rule_associations + def __init__(self, **kwargs): + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.security_rule_associations = kwargs.get('security_rule_associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_network_interface_py3.py new file mode 100644 index 000000000000..e39a76b730c1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_network_interface_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupNetworkInterface(Model): + """Network interface and all its associated security rules. + + :param id: ID of the network interface. + :type id: str + :param security_rule_associations: + :type security_rule_associations: + ~azure.mgmt.network.v2017_08_01.models.SecurityRuleAssociations + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, + } + + def __init__(self, *, id: str=None, security_rule_associations=None, **kwargs) -> None: + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = id + self.security_rule_associations = security_rule_associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_parameters.py index 5c0972e5d55e..1d547b0b0e2b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_parameters.py @@ -15,7 +15,9 @@ class SecurityGroupViewParameters(Model): """Parameters that define the VM to check security groups for. - :param target_resource_id: ID of the target VM. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. :type target_resource_id: str """ @@ -27,6 +29,6 @@ class SecurityGroupViewParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(SecurityGroupViewParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_parameters_py3.py new file mode 100644 index 000000000000..7ccc48017444 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_parameters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewParameters(Model): + """Parameters that define the VM to check security groups for. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_result.py index 06cd47eb7068..375349fcc153 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_result.py @@ -24,6 +24,6 @@ class SecurityGroupViewResult(Model): 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, } - def __init__(self, network_interfaces=None): - super(SecurityGroupViewResult, self).__init__() - self.network_interfaces = network_interfaces + def __init__(self, **kwargs): + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_result_py3.py new file mode 100644 index 000000000000..0a754b763b2f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_group_view_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewResult(Model): + """The information about security rules applied to the specified VM. + + :param network_interfaces: List of network interfaces on the specified VM. + :type network_interfaces: + list[~azure.mgmt.network.v2017_08_01.models.SecurityGroupNetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule.py index aae11e9d1b9a..3cfb8cb70a22 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule.py @@ -15,12 +15,15 @@ class SecurityRule(SubResource): """Network security rule. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param description: A description for this rule. Restricted to 140 chars. :type description: str - :param protocol: Network protocol this rule applies to. Possible values - are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*' + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.SecurityRuleProtocol :param source_port_range: The source port or range. Integer or range @@ -49,8 +52,9 @@ class SecurityRule(SubResource): :type source_port_ranges: list[str] :param destination_port_ranges: The destination port ranges. :type destination_port_ranges: list[str] - :param access: The network traffic is allowed or denied. Possible values - are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' :type access: str or ~azure.mgmt.network.v2017_08_01.models.SecurityRuleAccess :param priority: The priority of the rule. The value can be between 100 @@ -58,10 +62,10 @@ class SecurityRule(SubResource): collection. The lower the priority number, the higher the priority of the rule. :type priority: int - :param direction: The direction of the rule. The direction specifies if - rule will be evaluated on incoming or outcoming traffic. Possible values - are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', - 'Outbound' + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2017_08_01.models.SecurityRuleDirection :param provisioning_state: The provisioning state of the public IP @@ -101,21 +105,21 @@ class SecurityRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, source_address_prefix=None, destination_address_prefix=None, access=None, direction=None, id=None, description=None, source_port_range=None, destination_port_range=None, source_address_prefixes=None, destination_address_prefixes=None, source_port_ranges=None, destination_port_ranges=None, priority=None, provisioning_state=None, name=None, etag=None): - super(SecurityRule, self).__init__(id=id) - self.description = description - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_address_prefix = source_address_prefix - self.source_address_prefixes = source_address_prefixes - self.destination_address_prefix = destination_address_prefix - self.destination_address_prefixes = destination_address_prefixes - self.source_port_ranges = source_port_ranges - self.destination_port_ranges = destination_port_ranges - self.access = access - self.priority = priority - self.direction = direction - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(SecurityRule, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule_associations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule_associations.py index 8df7e8aa4db7..715e14971151 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule_associations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule_associations.py @@ -37,9 +37,9 @@ class SecurityRuleAssociations(Model): 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, } - def __init__(self, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None): - super(SecurityRuleAssociations, self).__init__() - self.network_interface_association = network_interface_association - self.subnet_association = subnet_association - self.default_security_rules = default_security_rules - self.effective_security_rules = effective_security_rules + def __init__(self, **kwargs): + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = kwargs.get('network_interface_association', None) + self.subnet_association = kwargs.get('subnet_association', None) + self.default_security_rules = kwargs.get('default_security_rules', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule_associations_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule_associations_py3.py new file mode 100644 index 000000000000..024a79aa7512 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule_associations_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityRuleAssociations(Model): + """All security rules associated with the network interface. + + :param network_interface_association: + :type network_interface_association: + ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceAssociation + :param subnet_association: + :type subnet_association: + ~azure.mgmt.network.v2017_08_01.models.SubnetAssociation + :param default_security_rules: Collection of default security rules of the + network security group. + :type default_security_rules: + list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, + 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, + 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__(self, *, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None, **kwargs) -> None: + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = network_interface_association + self.subnet_association = subnet_association + self.default_security_rules = default_security_rules + self.effective_security_rules = effective_security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule_py3.py new file mode 100644 index 000000000000..5ce684abee7a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/security_rule_py3.py @@ -0,0 +1,125 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class SecurityRule(SubResource): + """Network security rule. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2017_08_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. Integer or range + between 0 and 65535. Asterix '*' can also be used to match all ports. + :type source_port_range: str + :param destination_port_range: The destination port or range. Integer or + range between 0 and 65535. Asterix '*' can also be used to match all + ports. + :type destination_port_range: str + :param source_address_prefix: The CIDR or source IP range. Asterix '*' can + also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + this is an ingress rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param source_address_prefixes: The CIDR or source IP ranges. + :type source_address_prefixes: list[str] + :param destination_address_prefix: The destination address prefix. CIDR or + destination IP range. Asterix '*' can also be used to match all source + IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. + :type destination_address_prefix: str + :param destination_address_prefixes: The destination address prefixes. + CIDR or destination IP ranges. + :type destination_address_prefixes: list[str] + :param source_port_ranges: The source port ranges. + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. + :type destination_port_ranges: list[str] + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' + :type access: str or + ~azure.mgmt.network.v2017_08_01.models.SecurityRuleAccess + :param priority: The priority of the rule. The value can be between 100 + and 4096. The priority number must be unique for each rule in the + collection. The lower the priority number, the higher the priority of the + rule. + :type priority: int + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2017_08_01.models.SecurityRuleDirection + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'access': {'required': True}, + 'direction': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'properties.sourceAddressPrefixes', 'type': '[str]'}, + 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, + 'destination_address_prefixes': {'key': 'properties.destinationAddressPrefixes', 'type': '[str]'}, + 'source_port_ranges': {'key': 'properties.sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'properties.destinationPortRanges', 'type': '[str]'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, access, direction, id: str=None, description: str=None, source_port_range: str=None, destination_port_range: str=None, source_address_prefix: str=None, source_address_prefixes=None, destination_address_prefix: str=None, destination_address_prefixes=None, source_port_ranges=None, destination_port_ranges=None, priority: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(SecurityRule, self).__init__(id=id, **kwargs) + self.description = description + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.source_address_prefixes = source_address_prefixes + self.destination_address_prefix = destination_address_prefix + self.destination_address_prefixes = destination_address_prefixes + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/service_endpoint_properties_format.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/service_endpoint_properties_format.py index 847cb9ac8b3b..87ca01e64540 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/service_endpoint_properties_format.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/service_endpoint_properties_format.py @@ -29,8 +29,8 @@ class ServiceEndpointPropertiesFormat(Model): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } - def __init__(self, service=None, locations=None, provisioning_state=None): - super(ServiceEndpointPropertiesFormat, self).__init__() - self.service = service - self.locations = locations - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = kwargs.get('service', None) + self.locations = kwargs.get('locations', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/service_endpoint_properties_format_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/service_endpoint_properties_format_py3.py new file mode 100644 index 000000000000..8d3d2e5e8347 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/service_endpoint_properties_format_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceEndpointPropertiesFormat(Model): + """The service endpoint properties. + + :param service: The type of the endpoint service. + :type service: str + :param locations: A list of locations. + :type locations: list[str] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + """ + + _attribute_map = { + 'service': {'key': 'service', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, service: str=None, locations=None, provisioning_state: str=None, **kwargs) -> None: + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = service + self.locations = locations + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/sub_resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/sub_resource.py index 491f1d1caf83..6ab81f55f21b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/sub_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/sub_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/sub_resource_py3.py new file mode 100644 index 000000000000..8f4c4c816061 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """Reference to another subresource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet.py index a646e96e4526..3cdd2e915ed8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet.py @@ -66,14 +66,14 @@ class Subnet(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, address_prefix=None, network_security_group=None, route_table=None, service_endpoints=None, resource_navigation_links=None, provisioning_state=None, name=None, etag=None): - super(Subnet, self).__init__(id=id) - self.address_prefix = address_prefix - self.network_security_group = network_security_group - self.route_table = route_table - self.service_endpoints = service_endpoints + def __init__(self, **kwargs): + super(Subnet, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.route_table = kwargs.get('route_table', None) + self.service_endpoints = kwargs.get('service_endpoints', None) self.ip_configurations = None - self.resource_navigation_links = resource_navigation_links - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.resource_navigation_links = kwargs.get('resource_navigation_links', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet_association.py index a873d76f0217..76663508a08d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet_association.py @@ -34,7 +34,7 @@ class SubnetAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(SubnetAssociation, self).__init__() + def __init__(self, **kwargs): + super(SubnetAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet_association_py3.py new file mode 100644 index 000000000000..58811a9411fd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Subnet ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(SubnetAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet_py3.py new file mode 100644 index 000000000000..57d9a867a24f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/subnet_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Subnet(SubResource): + """Subnet in a virtual network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param address_prefix: The address prefix for the subnet. + :type address_prefix: str + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup + :param route_table: The reference of the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2017_08_01.models.RouteTable + :param service_endpoints: An array of service endpoints. + :type service_endpoints: + list[~azure.mgmt.network.v2017_08_01.models.ServiceEndpointPropertiesFormat] + :ivar ip_configurations: Gets an array of references to the network + interface IP configurations using subnet. + :vartype ip_configurations: + list[~azure.mgmt.network.v2017_08_01.models.IPConfiguration] + :param resource_navigation_links: Gets an array of references to the + external resources using subnet. + :type resource_navigation_links: + list[~azure.mgmt.network.v2017_08_01.models.ResourceNavigationLink] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'ip_configurations': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, + 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, address_prefix: str=None, network_security_group=None, route_table=None, service_endpoints=None, resource_navigation_links=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Subnet, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.network_security_group = network_security_group + self.route_table = route_table + self.service_endpoints = service_endpoints + self.ip_configurations = None + self.resource_navigation_links = resource_navigation_links + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology.py index 3adfa74a0e60..d6fd82f0edf7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology.py @@ -43,9 +43,9 @@ class Topology(Model): 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, } - def __init__(self, resources=None): - super(Topology, self).__init__() + def __init__(self, **kwargs): + super(Topology, self).__init__(**kwargs) self.id = None self.created_date_time = None self.last_modified = None - self.resources = resources + self.resources = kwargs.get('resources', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_association.py index 1f14e581194a..282118b3a079 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_association.py @@ -33,8 +33,8 @@ class TopologyAssociation(Model): 'association_type': {'key': 'associationType', 'type': 'str'}, } - def __init__(self, name=None, resource_id=None, association_type=None): - super(TopologyAssociation, self).__init__() - self.name = name - self.resource_id = resource_id - self.association_type = association_type + def __init__(self, **kwargs): + super(TopologyAssociation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.resource_id = kwargs.get('resource_id', None) + self.association_type = kwargs.get('association_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_association_py3.py new file mode 100644 index 000000000000..052147d5a6b1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyAssociation(Model): + """Resources that have an association with the parent resource. + + :param name: The name of the resource that is associated with the parent + resource. + :type name: str + :param resource_id: The ID of the resource that is associated with the + parent resource. + :type resource_id: str + :param association_type: The association type of the child resource to the + parent resource. Possible values include: 'Associated', 'Contains' + :type association_type: str or + ~azure.mgmt.network.v2017_08_01.models.AssociationType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'association_type': {'key': 'associationType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, resource_id: str=None, association_type=None, **kwargs) -> None: + super(TopologyAssociation, self).__init__(**kwargs) + self.name = name + self.resource_id = resource_id + self.association_type = association_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_parameters.py index 04920dc9665d..c7065ef57c09 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_parameters.py @@ -15,8 +15,10 @@ class TopologyParameters(Model): """Parameters that define the representation of topology. - :param target_resource_group_name: The name of the target resource group - to perform topology on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_group_name: Required. The name of the target + resource group to perform topology on. :type target_resource_group_name: str """ @@ -28,6 +30,6 @@ class TopologyParameters(Model): 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, } - def __init__(self, target_resource_group_name): - super(TopologyParameters, self).__init__() - self.target_resource_group_name = target_resource_group_name + def __init__(self, **kwargs): + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = kwargs.get('target_resource_group_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_parameters_py3.py new file mode 100644 index 000000000000..90c2365d8dba --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyParameters(Model): + """Parameters that define the representation of topology. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group_name: Required. The name of the target + resource group to perform topology on. + :type target_resource_group_name: str + """ + + _validation = { + 'target_resource_group_name': {'required': True}, + } + + _attribute_map = { + 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, + } + + def __init__(self, *, target_resource_group_name: str, **kwargs) -> None: + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = target_resource_group_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_py3.py new file mode 100644 index 000000000000..1823f5957c29 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Topology(Model): + """Topology of the specified resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: GUID representing the operation id. + :vartype id: str + :ivar created_date_time: The datetime when the topology was initially + created for the resource group. + :vartype created_date_time: datetime + :ivar last_modified: The datetime when the topology was last modified. + :vartype last_modified: datetime + :param resources: + :type resources: + list[~azure.mgmt.network.v2017_08_01.models.TopologyResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, + } + + def __init__(self, *, resources=None, **kwargs) -> None: + super(Topology, self).__init__(**kwargs) + self.id = None + self.created_date_time = None + self.last_modified = None + self.resources = resources diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_resource.py index 17f968c22c06..29c15c0d19ab 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_resource.py @@ -34,9 +34,9 @@ class TopologyResource(Model): 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, } - def __init__(self, name=None, id=None, location=None, associations=None): - super(TopologyResource, self).__init__() - self.name = name - self.id = id - self.location = location - self.associations = associations + def __init__(self, **kwargs): + super(TopologyResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.associations = kwargs.get('associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_resource_py3.py new file mode 100644 index 000000000000..2474cc6d944c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/topology_resource_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyResource(Model): + """The network resource topology information for the given resource group. + + :param name: Name of the resource. + :type name: str + :param id: ID of the resource. + :type id: str + :param location: Resource location. + :type location: str + :param associations: Holds the associations the resource has with other + resources in the resource group. + :type associations: + list[~azure.mgmt.network.v2017_08_01.models.TopologyAssociation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, + } + + def __init__(self, *, name: str=None, id: str=None, location: str=None, associations=None, **kwargs) -> None: + super(TopologyResource, self).__init__(**kwargs) + self.name = name + self.id = id + self.location = location + self.associations = associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_details.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_details.py index 98555e3482d3..8fe8a9dd6c19 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_details.py @@ -36,10 +36,10 @@ class TroubleshootingDetails(Model): 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, } - def __init__(self, id=None, reason_type=None, summary=None, detail=None, recommended_actions=None): - super(TroubleshootingDetails, self).__init__() - self.id = id - self.reason_type = reason_type - self.summary = summary - self.detail = detail - self.recommended_actions = recommended_actions + def __init__(self, **kwargs): + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.reason_type = kwargs.get('reason_type', None) + self.summary = kwargs.get('summary', None) + self.detail = kwargs.get('detail', None) + self.recommended_actions = kwargs.get('recommended_actions', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_details_py3.py new file mode 100644 index 000000000000..3040238f6a2d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_details_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingDetails(Model): + """Information gained from troubleshooting of specified resource. + + :param id: The id of the get troubleshoot operation. + :type id: str + :param reason_type: Reason type of failure. + :type reason_type: str + :param summary: A summary of troubleshooting. + :type summary: str + :param detail: Details on troubleshooting results. + :type detail: str + :param recommended_actions: List of recommended actions. + :type recommended_actions: + list[~azure.mgmt.network.v2017_08_01.models.TroubleshootingRecommendedActions] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'reason_type': {'key': 'reasonType', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'detail': {'key': 'detail', 'type': 'str'}, + 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, + } + + def __init__(self, *, id: str=None, reason_type: str=None, summary: str=None, detail: str=None, recommended_actions=None, **kwargs) -> None: + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = id + self.reason_type = reason_type + self.summary = summary + self.detail = detail + self.recommended_actions = recommended_actions diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_parameters.py index c4833fb8eeb3..6b11d3eb5ffc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_parameters.py @@ -15,13 +15,15 @@ class TroubleshootingParameters(Model): """Parameters that define the resource to troubleshoot. - :param target_resource_id: The target resource to troubleshoot. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. :type target_resource_id: str - :param storage_id: The ID for the storage account to save the troubleshoot - result. + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. :type storage_id: str - :param storage_path: The path to the blob to save the troubleshoot result - in. + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. :type storage_path: str """ @@ -37,8 +39,8 @@ class TroubleshootingParameters(Model): 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, } - def __init__(self, target_resource_id, storage_id, storage_path): - super(TroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.storage_path = storage_path + def __init__(self, **kwargs): + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..e010b7bdc9de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_parameters_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingParameters(Model): + """Parameters that define the resource to troubleshoot. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. + :type target_resource_id: str + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. + :type storage_id: str + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. + :type storage_path: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'storage_path': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, storage_path: str, **kwargs) -> None: + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.storage_path = storage_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_recommended_actions.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_recommended_actions.py index cbc5e31177c7..be395be4ad54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_recommended_actions.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_recommended_actions.py @@ -34,9 +34,9 @@ class TroubleshootingRecommendedActions(Model): 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, } - def __init__(self, action_id=None, action_text=None, action_uri=None, action_uri_text=None): - super(TroubleshootingRecommendedActions, self).__init__() - self.action_id = action_id - self.action_text = action_text - self.action_uri = action_uri - self.action_uri_text = action_uri_text + def __init__(self, **kwargs): + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = kwargs.get('action_id', None) + self.action_text = kwargs.get('action_text', None) + self.action_uri = kwargs.get('action_uri', None) + self.action_uri_text = kwargs.get('action_uri_text', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_recommended_actions_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_recommended_actions_py3.py new file mode 100644 index 000000000000..05c3f654353b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_recommended_actions_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingRecommendedActions(Model): + """Recommended actions based on discovered issues. + + :param action_id: ID of the recommended action. + :type action_id: str + :param action_text: Description of recommended actions. + :type action_text: str + :param action_uri: The uri linking to a documentation for the recommended + troubleshooting actions. + :type action_uri: str + :param action_uri_text: The information from the URI for the recommended + troubleshooting actions. + :type action_uri_text: str + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'action_text': {'key': 'actionText', 'type': 'str'}, + 'action_uri': {'key': 'actionUri', 'type': 'str'}, + 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, + } + + def __init__(self, *, action_id: str=None, action_text: str=None, action_uri: str=None, action_uri_text: str=None, **kwargs) -> None: + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = action_id + self.action_text = action_text + self.action_uri = action_uri + self.action_uri_text = action_uri_text diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_result.py index 78d42387bcd8..8126e1ed952c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_result.py @@ -33,9 +33,9 @@ class TroubleshootingResult(Model): 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, } - def __init__(self, start_time=None, end_time=None, code=None, results=None): - super(TroubleshootingResult, self).__init__() - self.start_time = start_time - self.end_time = end_time - self.code = code - self.results = results + def __init__(self, **kwargs): + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.code = kwargs.get('code', None) + self.results = kwargs.get('results', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_result_py3.py new file mode 100644 index 000000000000..8114acf0bf20 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/troubleshooting_result_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingResult(Model): + """Troubleshooting information gained from specified resource. + + :param start_time: The start time of the troubleshooting. + :type start_time: datetime + :param end_time: The end time of the troubleshooting. + :type end_time: datetime + :param code: The result code of the troubleshooting. + :type code: str + :param results: Information from troubleshooting. + :type results: + list[~azure.mgmt.network.v2017_08_01.models.TroubleshootingDetails] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, + } + + def __init__(self, *, start_time=None, end_time=None, code: str=None, results=None, **kwargs) -> None: + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.code = code + self.results = results diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/tunnel_connection_health.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/tunnel_connection_health.py index 05307b23676e..4243ebd36156 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/tunnel_connection_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/tunnel_connection_health.py @@ -52,8 +52,8 @@ class TunnelConnectionHealth(Model): 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, } - def __init__(self): - super(TunnelConnectionHealth, self).__init__() + def __init__(self, **kwargs): + super(TunnelConnectionHealth, self).__init__(**kwargs) self.tunnel = None self.connection_status = None self.ingress_bytes_transferred = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/tunnel_connection_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/tunnel_connection_health_py3.py new file mode 100644 index 000000000000..24a85ba20a58 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/tunnel_connection_health_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TunnelConnectionHealth(Model): + """VirtualNetworkGatewayConnection properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tunnel: Tunnel name. + :vartype tunnel: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values include: 'Unknown', 'Connecting', 'Connected', + 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionStatus + :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this + connection + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: The Egress Bytes Transferred in this + connection + :vartype egress_bytes_transferred: long + :ivar last_connection_established_utc_time: The time at which connection + was established in Utc format. + :vartype last_connection_established_utc_time: str + """ + + _validation = { + 'tunnel': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'last_connection_established_utc_time': {'readonly': True}, + } + + _attribute_map = { + 'tunnel': {'key': 'tunnel', 'type': 'str'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TunnelConnectionHealth, self).__init__(**kwargs) + self.tunnel = None + self.connection_status = None + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.last_connection_established_utc_time = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage.py index e70f2be17cc4..73acebaf22d6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage.py @@ -18,16 +18,18 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource identifier. :vartype id: str - :ivar unit: An enum describing the unit of measurement. Default value: - "Count" . + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . :vartype unit: str - :param current_value: The current value of the usage. + :param current_value: Required. The current value of the usage. :type current_value: long - :param limit: The limit of usage. + :param limit: Required. The limit of usage. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.network.v2017_08_01.models.UsageName """ @@ -49,9 +51,9 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.id = None - self.current_value = current_value - self.limit = limit - self.name = name + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage_name.py index df7f344bfb9b..bd1813944fdc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage_name_py3.py new file mode 100644 index 000000000000..4e5e3e10de15 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage_py3.py new file mode 100644 index 000000000000..a40acbfc6116 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/usage_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes network resource usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource identifier. + :vartype id: str + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . + :vartype unit: str + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.network.v2017_08_01.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.id = None + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_parameters.py index 532be214d2f5..21e43cb1bee6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_parameters.py @@ -15,28 +15,30 @@ class VerificationIPFlowParameters(Model): """Parameters that define the IP flow to be verified. - :param target_resource_id: The ID of the target resource to perform - next-hop on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. :type target_resource_id: str - :param direction: The direction of the packet represented as a 5-tuple. - Possible values include: 'Inbound', 'Outbound' + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2017_08_01.models.Direction - :param protocol: Protocol to be verified on. Possible values include: - 'TCP', 'UDP' + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.Protocol - :param local_port: The local port. Acceptable values are a single integer - in the range (0-65535). Support for * for the source port, which depends - on the direction. + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type local_port: str - :param remote_port: The remote port. Acceptable values are a single - integer in the range (0-65535). Support for * for the source port, which - depends on the direction. + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type remote_port: str - :param local_ip_address: The local IP address. Acceptable values are valid - IPv4 addresses. + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. :type local_ip_address: str - :param remote_ip_address: The remote IP address. Acceptable values are - valid IPv4 addresses. + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. :type remote_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be @@ -65,13 +67,13 @@ class VerificationIPFlowParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, direction, protocol, local_port, remote_port, local_ip_address, remote_ip_address, target_nic_resource_id=None): - super(VerificationIPFlowParameters, self).__init__() - self.target_resource_id = target_resource_id - self.direction = direction - self.protocol = protocol - self.local_port = local_port - self.remote_port = remote_port - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.direction = kwargs.get('direction', None) + self.protocol = kwargs.get('protocol', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_parameters_py3.py new file mode 100644 index 000000000000..cb26c1c02d6b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_parameters_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowParameters(Model): + """Parameters that define the IP flow to be verified. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. + :type target_resource_id: str + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' + :type direction: str or ~azure.mgmt.network.v2017_08_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' + :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.Protocol + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type local_port: str + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type remote_port: str + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. + :type local_ip_address: str + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. + :type remote_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of them, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'local_port': {'required': True}, + 'remote_port': {'required': True}, + 'local_ip_address': {'required': True}, + 'remote_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, direction, protocol, local_port: str, remote_port: str, local_ip_address: str, remote_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.direction = direction + self.protocol = protocol + self.local_port = local_port + self.remote_port = remote_port + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_result.py index 63f5e3b94516..a4278bae2f76 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_result.py @@ -28,7 +28,7 @@ class VerificationIPFlowResult(Model): 'rule_name': {'key': 'ruleName', 'type': 'str'}, } - def __init__(self, access=None, rule_name=None): - super(VerificationIPFlowResult, self).__init__() - self.access = access - self.rule_name = rule_name + def __init__(self, **kwargs): + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.rule_name = kwargs.get('rule_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_result_py3.py new file mode 100644 index 000000000000..d817d470ba3d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/verification_ip_flow_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowResult(Model): + """Results of IP flow verification on the target resource. + + :param access: Indicates whether the traffic is allowed or denied. + Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_08_01.models.Access + :param rule_name: Name of the rule. If input is not matched against any + security rule, it is not displayed. + :type rule_name: str + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + } + + def __init__(self, *, access=None, rule_name: str=None, **kwargs) -> None: + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = access + self.rule_name = rule_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network.py index 1a98ffa37779..d4e5d966b207 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network.py @@ -70,12 +70,12 @@ class VirtualNetwork(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid=None, provisioning_state=None, etag=None): - super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags) - self.address_space = address_space - self.dhcp_options = dhcp_options - self.subnets = subnets - self.virtual_network_peerings = virtual_network_peerings - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetwork, self).__init__(**kwargs) + self.address_space = kwargs.get('address_space', None) + self.dhcp_options = kwargs.get('dhcp_options', None) + self.subnets = kwargs.get('subnets', None) + self.virtual_network_peerings = kwargs.get('virtual_network_peerings', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_connection_gateway_reference.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_connection_gateway_reference.py index eb18a3c124ff..aa10101778f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_connection_gateway_reference.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_connection_gateway_reference.py @@ -15,8 +15,10 @@ class VirtualNetworkConnectionGatewayReference(Model): """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. - :param id: The ID of VirtualNetworkGateway or LocalNetworkGateway - resource. + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or + LocalNetworkGateway resource. :type id: str """ @@ -28,6 +30,6 @@ class VirtualNetworkConnectionGatewayReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id): - super(VirtualNetworkConnectionGatewayReference, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_connection_gateway_reference_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_connection_gateway_reference_py3.py new file mode 100644 index 000000000000..b2d9734baf3c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_connection_gateway_reference_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkConnectionGatewayReference(Model): + """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or + LocalNetworkGateway resource. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway.py index 0eadd03bf612..9fdf1cf430ee 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway.py @@ -98,17 +98,17 @@ class VirtualNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp=None, active_active=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid=None, etag=None): - super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.ip_configurations = ip_configurations - self.gateway_type = gateway_type - self.vpn_type = vpn_type - self.enable_bgp = enable_bgp - self.active_active = active_active - self.gateway_default_site = gateway_default_site - self.sku = sku - self.vpn_client_configuration = vpn_client_configuration - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(VirtualNetworkGateway, self).__init__(**kwargs) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.gateway_type = kwargs.get('gateway_type', None) + self.vpn_type = kwargs.get('vpn_type', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.active_active = kwargs.get('active_active', None) + self.gateway_default_site = kwargs.get('gateway_default_site', None) + self.sku = kwargs.get('sku', None) + self.vpn_client_configuration = kwargs.get('vpn_client_configuration', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection.py index 951efafaf99a..176885f83f11 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayConnection(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -30,8 +32,8 @@ class VirtualNetworkGatewayConnection(Resource): :type tags: dict[str, str] :param authorization_key: The authorizationKey. :type authorization_key: str - :param virtual_network_gateway1: The reference to virtual network gateway - resource. + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. :type virtual_network_gateway1: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway :param virtual_network_gateway2: The reference to virtual network gateway @@ -42,8 +44,8 @@ class VirtualNetworkGatewayConnection(Resource): resource. :type local_network_gateway2: ~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway - :param connection_type: Gateway connection type. Possible values are: - 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' :type connection_type: str or ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionType @@ -128,23 +130,23 @@ class VirtualNetworkGatewayConnection(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, virtual_network_gateway1, connection_type, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight=None, shared_key=None, peer=None, enable_bgp=None, use_policy_based_traffic_selectors=None, ipsec_policies=None, resource_guid=None, etag=None): - super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnection, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) self.connection_status = None self.tunnel_connection_status = None self.egress_bytes_transferred = None self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors - self.ipsec_policies = ipsec_policies - self.resource_guid = resource_guid + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection_list_entity.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection_list_entity.py index 8095683ae7d3..57d810c7520f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection_list_entity.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection_list_entity.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -30,8 +32,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): :type tags: dict[str, str] :param authorization_key: The authorizationKey. :type authorization_key: str - :param virtual_network_gateway1: The reference to virtual network gateway - resource. + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. :type virtual_network_gateway1: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkConnectionGatewayReference :param virtual_network_gateway2: The reference to virtual network gateway @@ -42,8 +44,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): resource. :type local_network_gateway2: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkConnectionGatewayReference - :param connection_type: Gateway connection type. Possible values are: - 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' :type connection_type: str or ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionType @@ -128,23 +130,23 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, virtual_network_gateway1, connection_type, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight=None, shared_key=None, peer=None, enable_bgp=None, use_policy_based_traffic_selectors=None, ipsec_policies=None, resource_guid=None, etag=None): - super(VirtualNetworkGatewayConnectionListEntity, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) self.connection_status = None self.tunnel_connection_status = None self.egress_bytes_transferred = None self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors - self.ipsec_policies = ipsec_policies - self.resource_guid = resource_guid + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection_list_entity_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection_list_entity_py3.py new file mode 100644 index 000000000000..57762639fbe8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection_list_entity_py3.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnectionListEntity(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkConnectionGatewayReference + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkConnectionGatewayReference + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkConnectionGatewayReference + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2017_08_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2017_08_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, use_policy_based_traffic_selectors: bool=None, ipsec_policies=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection_py3.py new file mode 100644 index 000000000000..165accb17c2c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_connection_py3.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnection(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2017_08_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2017_08_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, use_policy_based_traffic_selectors: bool=None, ipsec_policies=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_ip_configuration.py index 2454afaebce4..448c93e9f36b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_ip_configuration.py @@ -55,11 +55,11 @@ class VirtualNetworkGatewayIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name=None, etag=None): - super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id) - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address + def __init__(self, **kwargs): + super(VirtualNetworkGatewayIPConfiguration, self).__init__(**kwargs) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..84b4fc242e62 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_ip_configuration_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_08_01.models.SubResource + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :ivar provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_py3.py new file mode 100644 index 000000000000..5df630fee4db --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_py3.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param ip_configurations: IP configurations for virtual network gateway. + :type ip_configurations: + list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible + values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', + 'ExpressRoute' + :type gateway_type: str or + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayType + :param vpn_type: The type of this virtual network gateway. Possible values + are: 'PolicyBased' and 'RouteBased'. Possible values include: + 'PolicyBased', 'RouteBased' + :type vpn_type: str or ~azure.mgmt.network.v2017_08_01.models.VpnType + :param enable_bgp: Whether BGP is enabled for this virtual network gateway + or not. + :type enable_bgp: bool + :param active_active: ActiveActive flag + :type active_active: bool + :param gateway_default_site: The reference of the LocalNetworkGateway + resource which represents local network site having default routes. Assign + Null value in case of removing existing default site setting. + :type gateway_default_site: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param sku: The reference of the VirtualNetworkGatewaySku resource which + represents the SKU selected for Virtual network gateway. + :type sku: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewaySku + :param vpn_client_configuration: The reference of the + VpnClientConfiguration resource which represents the P2S VpnClient + configurations. + :type vpn_client_configuration: + ~azure.mgmt.network.v2017_08_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2017_08_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + VirtualNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGateway resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, + 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, + 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'active_active': {'key': 'properties.activeActive', 'type': 'bool'}, + 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, + 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, + 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp: bool=None, active_active: bool=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.ip_configurations = ip_configurations + self.gateway_type = gateway_type + self.vpn_type = vpn_type + self.enable_bgp = enable_bgp + self.active_active = active_active + self.gateway_default_site = gateway_default_site + self.sku = sku + self.vpn_client_configuration = vpn_client_configuration + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_sku.py index 0bb4234db59e..a74dda8285fe 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_sku.py @@ -35,8 +35,8 @@ class VirtualNetworkGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(VirtualNetworkGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_sku_py3.py new file mode 100644 index 000000000000..b5fd9f0a47c4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_gateway_sku_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkGatewaySku(Model): + """VirtualNetworkGatewaySku details. + + :param name: Gateway SKU name. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type name: str or + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewaySkuName + :param tier: Gateway SKU tier. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type tier: str or + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewaySkuTier + :param capacity: The capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_peering.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_peering.py index 6b90af0bb774..774a9688ae59 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_peering.py @@ -65,14 +65,14 @@ class VirtualNetworkPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, allow_virtual_network_access=None, allow_forwarded_traffic=None, allow_gateway_transit=None, use_remote_gateways=None, remote_virtual_network=None, peering_state=None, provisioning_state=None, name=None, etag=None): - super(VirtualNetworkPeering, self).__init__(id=id) - self.allow_virtual_network_access = allow_virtual_network_access - self.allow_forwarded_traffic = allow_forwarded_traffic - self.allow_gateway_transit = allow_gateway_transit - self.use_remote_gateways = use_remote_gateways - self.remote_virtual_network = remote_virtual_network - self.peering_state = peering_state - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetworkPeering, self).__init__(**kwargs) + self.allow_virtual_network_access = kwargs.get('allow_virtual_network_access', None) + self.allow_forwarded_traffic = kwargs.get('allow_forwarded_traffic', None) + self.allow_gateway_transit = kwargs.get('allow_gateway_transit', None) + self.use_remote_gateways = kwargs.get('use_remote_gateways', None) + self.remote_virtual_network = kwargs.get('remote_virtual_network', None) + self.peering_state = kwargs.get('peering_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_peering_py3.py new file mode 100644 index 000000000000..a733abaf7a3c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_peering_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkPeering(SubResource): + """Peerings in a virtual network resource. + + :param id: Resource ID. + :type id: str + :param allow_virtual_network_access: Whether the VMs in the linked virtual + network space would be able to access all the VMs in local Virtual network + space. + :type allow_virtual_network_access: bool + :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs + in the remote virtual network will be allowed/disallowed. + :type allow_forwarded_traffic: bool + :param allow_gateway_transit: If gateway links can be used in remote + virtual networking to link to this virtual network. + :type allow_gateway_transit: bool + :param use_remote_gateways: If remote gateways can be used on this virtual + network. If the flag is set to true, and allowGatewayTransit on remote + peering is also true, virtual network will use gateways of remote virtual + network for transit. Only one peering can have this flag set to true. This + flag cannot be set if virtual network already has a gateway. + :type use_remote_gateways: bool + :param remote_virtual_network: The reference of the remote virtual + network. + :type remote_virtual_network: + ~azure.mgmt.network.v2017_08_01.models.SubResource + :param peering_state: The status of the virtual network peering. Possible + values are 'Initiated', 'Connected', and 'Disconnected'. Possible values + include: 'Initiated', 'Connected', 'Disconnected' + :type peering_state: str or + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeeringState + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, + 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, + 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, + 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, allow_virtual_network_access: bool=None, allow_forwarded_traffic: bool=None, allow_gateway_transit: bool=None, use_remote_gateways: bool=None, remote_virtual_network=None, peering_state=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkPeering, self).__init__(id=id, **kwargs) + self.allow_virtual_network_access = allow_virtual_network_access + self.allow_forwarded_traffic = allow_forwarded_traffic + self.allow_gateway_transit = allow_gateway_transit + self.use_remote_gateways = use_remote_gateways + self.remote_virtual_network = remote_virtual_network + self.peering_state = peering_state + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_py3.py new file mode 100644 index 000000000000..16d5b5086d11 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetwork(Resource): + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param address_space: The AddressSpace that contains an array of IP + address ranges that can be used by subnets. + :type address_space: ~azure.mgmt.network.v2017_08_01.models.AddressSpace + :param dhcp_options: The dhcpOptions that contains an array of DNS servers + available to VMs deployed in the virtual network. + :type dhcp_options: ~azure.mgmt.network.v2017_08_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2017_08_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering] + :param resource_guid: The resourceGuid property of the Virtual Network + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.address_space = address_space + self.dhcp_options = dhcp_options + self.subnets = subnets + self.virtual_network_peerings = virtual_network_peerings + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage.py index dce105d9280f..c057d2f383ce 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage.py @@ -47,8 +47,8 @@ class VirtualNetworkUsage(Model): 'unit': {'key': 'unit', 'type': 'str'}, } - def __init__(self): - super(VirtualNetworkUsage, self).__init__() + def __init__(self, **kwargs): + super(VirtualNetworkUsage, self).__init__(**kwargs) self.current_value = None self.id = None self.limit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage_name.py index 01fcbf0875eb..607ccec3b964 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage_name.py @@ -34,7 +34,7 @@ class VirtualNetworkUsageName(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self): - super(VirtualNetworkUsageName, self).__init__() + def __init__(self, **kwargs): + super(VirtualNetworkUsageName, self).__init__(**kwargs) self.localized_value = None self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage_name_py3.py new file mode 100644 index 000000000000..1651ebda7e77 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage_name_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsageName(Model): + """Usage strings container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar localized_value: Localized subnet size and usage string. + :vartype localized_value: str + :ivar value: Subnet size and usage string. + :vartype value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsageName, self).__init__(**kwargs) + self.localized_value = None + self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage_py3.py new file mode 100644 index 000000000000..bca6b8bd3991 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/virtual_network_usage_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsage(Model): + """Usage details for subnet. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar current_value: Indicates number of IPs used from the Subnet. + :vartype current_value: float + :ivar id: Subnet identifier. + :vartype id: str + :ivar limit: Indicates the size of the subnet. + :vartype limit: float + :ivar name: The name containing common and localized value for usage. + :vartype name: + ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkUsageName + :ivar unit: Usage units. Returns 'Count' + :vartype unit: str + """ + + _validation = { + 'current_value': {'readonly': True}, + 'id': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'name': {'key': 'name', 'type': 'VirtualNetworkUsageName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsage, self).__init__(**kwargs) + self.current_value = None + self.id = None + self.limit = None + self.name = None + self.unit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_configuration.py index 5e27eec921a8..6b9042846540 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_configuration.py @@ -48,11 +48,11 @@ class VpnClientConfiguration(Model): 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, } - def __init__(self, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, vpn_client_protocols=None, radius_server_address=None, radius_server_secret=None): - super(VpnClientConfiguration, self).__init__() - self.vpn_client_address_pool = vpn_client_address_pool - self.vpn_client_root_certificates = vpn_client_root_certificates - self.vpn_client_revoked_certificates = vpn_client_revoked_certificates - self.vpn_client_protocols = vpn_client_protocols - self.radius_server_address = radius_server_address - self.radius_server_secret = radius_server_secret + def __init__(self, **kwargs): + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = kwargs.get('vpn_client_address_pool', None) + self.vpn_client_root_certificates = kwargs.get('vpn_client_root_certificates', None) + self.vpn_client_revoked_certificates = kwargs.get('vpn_client_revoked_certificates', None) + self.vpn_client_protocols = kwargs.get('vpn_client_protocols', None) + self.radius_server_address = kwargs.get('radius_server_address', None) + self.radius_server_secret = kwargs.get('radius_server_secret', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_configuration_py3.py new file mode 100644 index 000000000000..180fbbd82bbe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_configuration_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientConfiguration(Model): + """VpnClientConfiguration for P2S client. + + :param vpn_client_address_pool: The reference of the address space + resource which represents Address space for P2S VpnClient. + :type vpn_client_address_pool: + ~azure.mgmt.network.v2017_08_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual + network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2017_08_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for + Virtual network gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2017_08_01.models.VpnClientRevokedCertificate] + :param vpn_client_protocols: VpnClientProtocols for Virtual network + gateway. + :type vpn_client_protocols: list[str or + ~azure.mgmt.network.v2017_08_01.models.VpnClientProtocol] + :param radius_server_address: The radius server address property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_address: str + :param radius_server_secret: The radius secret property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_secret: str + """ + + _attribute_map = { + 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, + 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, + 'vpn_client_protocols': {'key': 'vpnClientProtocols', 'type': '[str]'}, + 'radius_server_address': {'key': 'radiusServerAddress', 'type': 'str'}, + 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, + } + + def __init__(self, *, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, vpn_client_protocols=None, radius_server_address: str=None, radius_server_secret: str=None, **kwargs) -> None: + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = vpn_client_address_pool + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + self.vpn_client_protocols = vpn_client_protocols + self.radius_server_address = radius_server_address + self.radius_server_secret = radius_server_secret diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_parameters.py index 1792cc36c432..521ce8fd88ba 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_parameters.py @@ -42,9 +42,9 @@ class VpnClientParameters(Model): 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, } - def __init__(self, processor_architecture=None, authentication_method=None, radius_server_auth_certificate=None, client_root_certificates=None): - super(VpnClientParameters, self).__init__() - self.processor_architecture = processor_architecture - self.authentication_method = authentication_method - self.radius_server_auth_certificate = radius_server_auth_certificate - self.client_root_certificates = client_root_certificates + def __init__(self, **kwargs): + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = kwargs.get('processor_architecture', None) + self.authentication_method = kwargs.get('authentication_method', None) + self.radius_server_auth_certificate = kwargs.get('radius_server_auth_certificate', None) + self.client_root_certificates = kwargs.get('client_root_certificates', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_parameters_py3.py new file mode 100644 index 000000000000..f3498f4ce472 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_parameters_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientParameters(Model): + """Vpn Client Parameters for package generation. + + :param processor_architecture: VPN client Processor Architecture. Possible + values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' + :type processor_architecture: str or + ~azure.mgmt.network.v2017_08_01.models.ProcessorArchitecture + :param authentication_method: VPN client Authentication Method. Possible + values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', + 'EAPMSCHAPv2' + :type authentication_method: str or + ~azure.mgmt.network.v2017_08_01.models.AuthenticationMethod + :param radius_server_auth_certificate: The public certificate data for the + radius server authentication certificate as a Base-64 encoded string. + Required only if external radius authentication has been configured with + EAPTLS authentication. + :type radius_server_auth_certificate: str + :param client_root_certificates: A list of client root certificates public + certificate data encoded as Base-64 strings. Optional parameter for + external radius based authentication with EAPTLS. + :type client_root_certificates: list[str] + """ + + _attribute_map = { + 'processor_architecture': {'key': 'processorArchitecture', 'type': 'str'}, + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + 'radius_server_auth_certificate': {'key': 'radiusServerAuthCertificate', 'type': 'str'}, + 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, + } + + def __init__(self, *, processor_architecture=None, authentication_method=None, radius_server_auth_certificate: str=None, client_root_certificates=None, **kwargs) -> None: + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = processor_architecture + self.authentication_method = authentication_method + self.radius_server_auth_certificate = radius_server_auth_certificate + self.client_root_certificates = client_root_certificates diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_revoked_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_revoked_certificate.py index ebd6a4bbba2f..1fa6f6a1ef23 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_revoked_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_revoked_certificate.py @@ -46,9 +46,9 @@ class VpnClientRevokedCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, thumbprint=None, name=None, etag=None): - super(VpnClientRevokedCertificate, self).__init__(id=id) - self.thumbprint = thumbprint + def __init__(self, **kwargs): + super(VpnClientRevokedCertificate, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_revoked_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_revoked_certificate_py3.py new file mode 100644 index 000000000000..7c1e05f283a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_revoked_certificate_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + :ivar provisioning_state: The provisioning state of the VPN client revoked + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, thumbprint: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRevokedCertificate, self).__init__(id=id, **kwargs) + self.thumbprint = thumbprint + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_root_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_root_certificate.py index 6d820d3a8c11..48c7033d42ec 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_root_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_root_certificate.py @@ -18,9 +18,11 @@ class VpnClientRootCertificate(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param public_cert_data: The certificate public data. + :param public_cert_data: Required. The certificate public data. :type public_cert_data: str :ivar provisioning_state: The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and @@ -47,9 +49,9 @@ class VpnClientRootCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, public_cert_data, id=None, name=None, etag=None): - super(VpnClientRootCertificate, self).__init__(id=id) - self.public_cert_data = public_cert_data + def __init__(self, **kwargs): + super(VpnClientRootCertificate, self).__init__(**kwargs) + self.public_cert_data = kwargs.get('public_cert_data', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_root_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_root_certificate_py3.py new file mode 100644 index 000000000000..db8a1e547705 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/vpn_client_root_certificate_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param public_cert_data: Required. The certificate public data. + :type public_cert_data: str + :ivar provisioning_state: The provisioning state of the VPN client root + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'public_cert_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, public_cert_data: str, id: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRootCertificate, self).__init__(id=id, **kwargs) + self.public_cert_data = public_cert_data + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/network_management_client.py index 58dd420e4c74..a80115b17ca8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/network_management_client.py @@ -15,7 +15,8 @@ from .version import VERSION from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.application_gateways_operations import ApplicationGatewaysOperations from .operations.available_endpoint_services_operations import AvailableEndpointServicesOperations @@ -277,7 +278,7 @@ def check_dns_name_availability( api_version = "2017-08-01" # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability' + url = self.check_dns_name_availability.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -318,3 +319,4 @@ def check_dns_name_availability( return client_raw_response return deserialized + check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/application_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/application_gateways_operations.py index 3e5da444d859..c45d485530ed 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/application_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/application_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ApplicationGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def get( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def _create_or_update_initial( self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_08_01.models.ApplicationGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.ApplicationGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.ApplicationGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ApplicationGateway', response) if raw: @@ -312,12 +276,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -339,7 +305,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -385,6 +351,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -404,7 +371,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -449,12 +416,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} def _start_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -490,7 +458,7 @@ def _start_initial( return client_raw_response def start( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -498,12 +466,14 @@ def start( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -513,46 +483,26 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} def _stop_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -588,7 +538,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -596,12 +546,14 @@ def stop( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -611,46 +563,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} def _backend_health_initial( self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth' + url = self.backend_health.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -695,7 +627,7 @@ def _backend_health_initial( return deserialized def backend_health( - self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the backend health of the specified application gateway in a resource group. @@ -707,13 +639,17 @@ def backend_health( referenced in backend health. :type expand: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGatewayBackendHealth or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApplicationGatewayBackendHealth or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealth] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealth]] :raises: :class:`CloudError` """ raw_result = self._backend_health_initial( @@ -724,30 +660,8 @@ def backend_health( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ApplicationGatewayBackendHealth', response) if raw: @@ -756,12 +670,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} def list_available_waf_rule_sets( self, custom_headers=None, raw=False, **operation_config): @@ -780,7 +696,7 @@ def list_available_waf_rule_sets( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets' + url = self.list_available_waf_rule_sets.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -819,6 +735,7 @@ def list_available_waf_rule_sets( return client_raw_response return deserialized + list_available_waf_rule_sets.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'} def list_available_ssl_options( self, custom_headers=None, raw=False, **operation_config): @@ -837,7 +754,7 @@ def list_available_ssl_options( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default' + url = self.list_available_ssl_options.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -876,6 +793,7 @@ def list_available_ssl_options( return client_raw_response return deserialized + list_available_ssl_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default'} def list_available_ssl_predefined_policies( self, custom_headers=None, raw=False, **operation_config): @@ -896,7 +814,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies' + url = self.list_available_ssl_predefined_policies.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -941,6 +859,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_ssl_predefined_policies.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies'} def get_ssl_predefined_policy( self, predefined_policy_name, custom_headers=None, raw=False, **operation_config): @@ -961,7 +880,7 @@ def get_ssl_predefined_policy( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}' + url = self.get_ssl_predefined_policy.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'predefinedPolicyName': self._serialize.url("predefined_policy_name", predefined_policy_name, 'str') @@ -1001,3 +920,4 @@ def get_ssl_predefined_policy( return client_raw_response return deserialized + get_ssl_predefined_policy.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/available_endpoint_services_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/available_endpoint_services_operations.py index 5db20193a4e6..bbe8144a3e51 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/available_endpoint_services_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/available_endpoint_services_operations.py @@ -22,7 +22,7 @@ class AvailableEndpointServicesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/bgp_service_communities_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/bgp_service_communities_operations.py index 8098b3949b91..2bc998d68016 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/bgp_service_communities_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/bgp_service_communities_operations.py @@ -22,7 +22,7 @@ class BgpServiceCommunitiesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/default_security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/default_security_rules_operations.py index 512ca6df14f5..2396f65dfa48 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/default_security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/default_security_rules_operations.py @@ -22,7 +22,7 @@ class DefaultSecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -60,7 +60,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -107,6 +107,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules'} def get( self, resource_group_name, network_security_group_name, default_security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -131,7 +132,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -173,3 +174,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_circuit_authorizations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_circuit_authorizations_operations.py index f5118ca30e28..3383c69b7fb3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_circuit_authorizations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_circuit_authorizations_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified authorization from the specified express route circuit. @@ -91,12 +91,14 @@ def delete( :param authorization_name: The name of the authorization. :type authorization_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def get( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): @@ -166,7 +148,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an authorization in the specified express route circuit. @@ -278,13 +261,17 @@ def create_or_update( :type authorization_parameters: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitAuthorization or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitAuthorization or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -296,30 +283,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitAuthorization', response) if raw: @@ -328,12 +293,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +324,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -404,3 +371,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_circuit_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_circuit_peerings_operations.py index 131af7c36380..1715259177bd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_circuit_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_circuit_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param peering_name: The name of the peering. :type peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def get( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -275,13 +258,17 @@ def create_or_update( :type peering_parameters: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitPeering or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitPeering', response) if raw: @@ -325,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -401,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_circuits_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_circuits_operations.py index 90b4d8d503bf..3b6c6f36acef 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_circuits_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_circuits_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param circuit_name: The name of the express route circuit. :type circuit_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def get( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuit or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuit', response) if raw: @@ -312,18 +276,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _list_arp_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}' + url = self.list_arp_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -368,7 +334,7 @@ def _list_arp_table_initial( return deserialized def list_arp_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -381,14 +347,17 @@ def list_arp_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsArpTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsArpTableListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsArpTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsArpTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_arp_table_initial( @@ -400,30 +369,8 @@ def list_arp_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', response) if raw: @@ -432,18 +379,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} def _list_routes_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}' + url = self.list_routes_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -488,7 +437,7 @@ def _list_routes_table_initial( return deserialized def list_routes_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -501,14 +450,18 @@ def list_routes_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsRoutesTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsRoutesTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_initial( @@ -520,30 +473,8 @@ def list_routes_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', response) if raw: @@ -552,18 +483,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} def _list_routes_table_summary_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}' + url = self.list_routes_table_summary.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -608,7 +541,7 @@ def _list_routes_table_summary_initial( return deserialized def list_routes_table_summary( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -621,14 +554,18 @@ def list_routes_table_summary( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableSummaryListResult or ClientRawResponse - if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableSummaryListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_summary_initial( @@ -640,30 +577,8 @@ def list_routes_table_summary( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', response) if raw: @@ -672,12 +587,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} def get_stats( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -699,7 +616,7 @@ def get_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats' + url = self.get_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -740,6 +657,7 @@ def get_stats( return client_raw_response return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} def get_peering_stats( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -763,7 +681,7 @@ def get_peering_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats' + url = self.get_peering_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -805,6 +723,7 @@ def get_peering_stats( return client_raw_response return deserialized + get_peering_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -826,7 +745,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -872,6 +791,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -891,7 +811,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -936,3 +856,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_service_providers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_service_providers_operations.py index f08e9d3ef2d6..4ed2d10f4e6a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_service_providers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/express_route_service_providers_operations.py @@ -22,7 +22,7 @@ class ExpressRouteServiceProvidersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/inbound_nat_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/inbound_nat_rules_operations.py index e1437add9365..a2d7fc0eab6c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/inbound_nat_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/inbound_nat_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class InboundNatRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -61,7 +61,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -108,12 +108,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules'} def _delete_initial( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -150,7 +151,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -160,12 +161,14 @@ def delete( :param inbound_nat_rule_name: The name of the inbound nat rule. :type inbound_nat_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -176,40 +179,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} def get( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -234,7 +217,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -278,12 +261,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -333,7 +317,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -347,13 +331,16 @@ def create_or_update( :type inbound_nat_rule_parameters: ~azure.mgmt.network.v2017_08_01.models.InboundNatRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - InboundNatRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns InboundNatRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.InboundNatRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.InboundNatRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -365,30 +352,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('InboundNatRule', response) if raw: @@ -397,9 +362,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_backend_address_pools_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_backend_address_pools_operations.py index 194c7c7d5a90..123378befaf3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_backend_address_pools_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_backend_address_pools_operations.py @@ -22,7 +22,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools'} def get( self, resource_group_name, load_balancer_name, backend_address_pool_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -171,3 +172,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_frontend_ip_configurations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_frontend_ip_configurations_operations.py index de0137fd3832..061e61e00bf4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_frontend_ip_configurations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_frontend_ip_configurations_operations.py @@ -22,7 +22,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations'} def get( self, resource_group_name, load_balancer_name, frontend_ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -171,3 +172,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_load_balancing_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_load_balancing_rules_operations.py index b5dc0f233c05..52c5c406b992 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_load_balancing_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_load_balancing_rules_operations.py @@ -22,7 +22,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules'} def get( self, resource_group_name, load_balancer_name, load_balancing_rule_name, custom_headers=None, raw=False, **operation_config): @@ -128,7 +129,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -170,3 +171,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_network_interfaces_operations.py index 71358f7e8d39..6eb185b8913f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_network_interfaces_operations.py @@ -22,7 +22,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,3 +106,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_probes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_probes_operations.py index bae47c48823c..6664265408d0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_probes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancer_probes_operations.py @@ -22,7 +22,7 @@ class LoadBalancerProbesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes'} def get( self, resource_group_name, load_balancer_name, probe_name, custom_headers=None, raw=False, **operation_config): @@ -128,7 +129,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -170,3 +171,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancers_operations.py index 048d5da96044..8318ad1e8421 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/load_balancers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param load_balancer_name: The name of the load balancer. :type load_balancer_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def get( self, resource_group_name, load_balancer_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( balancer operation. :type parameters: ~azure.mgmt.network.v2017_08_01.models.LoadBalancer :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns LoadBalancer - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.LoadBalancer] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.LoadBalancer]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LoadBalancer', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -340,7 +306,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -385,6 +351,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -406,7 +373,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -452,3 +419,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/local_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/local_network_gateways_operations.py index 1c409b1d5977..ec400f5939cf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/local_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/local_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LocalNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a local network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - LocalNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LocalNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def get( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def _delete_initial( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type local_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +309,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -389,3 +355,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_interface_ip_configurations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_interface_ip_configurations_operations.py index 844017e6dcac..7d22c4f95097 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_interface_ip_configurations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_interface_ip_configurations_operations.py @@ -22,7 +22,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations'} def get( self, resource_group_name, network_interface_name, ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -130,7 +131,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -172,3 +173,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_interface_load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_interface_load_balancers_operations.py index 1bd058f42e1f..edb9d744bc49 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_interface_load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_interface_load_balancers_operations.py @@ -22,7 +22,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -106,3 +106,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_interfaces_operations.py index 36ff50f1851d..9682866766f2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_interfaces_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ models = models @@ -43,7 +43,7 @@ def _delete_initial( api_version = "2017-08-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def get( self, resource_group_name, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( api_version = "2017-08-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -203,6 +185,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def _create_or_update_initial( @@ -210,7 +193,7 @@ def _create_or_update_initial( api_version = "2017-08-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_08_01.models.NetworkInterface :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkInterface or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.NetworkInterface] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.NetworkInterface]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkInterface', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -347,7 +313,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -392,6 +358,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -415,7 +382,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -461,6 +428,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} def _get_effective_route_table_initial( @@ -468,7 +436,7 @@ def _get_effective_route_table_initial( api_version = "2017-08-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable' + url = self.get_effective_route_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -511,7 +479,7 @@ def _get_effective_route_table_initial( return deserialized def get_effective_route_table( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -519,13 +487,17 @@ def get_effective_route_table( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveRouteListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.EffectiveRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.EffectiveRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_effective_route_table_initial( @@ -535,30 +507,8 @@ def get_effective_route_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveRouteListResult', response) if raw: @@ -567,12 +517,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_effective_route_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} def _list_effective_network_security_groups_initial( @@ -580,7 +532,7 @@ def _list_effective_network_security_groups_initial( api_version = "2017-08-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups' + url = self.list_effective_network_security_groups.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -623,7 +575,7 @@ def _list_effective_network_security_groups_initial( return deserialized def list_effective_network_security_groups( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -631,14 +583,18 @@ def list_effective_network_security_groups( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveNetworkSecurityGroupListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveNetworkSecurityGroupListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityGroupListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityGroupListResult]] :raises: :class:`CloudError` """ raw_result = self._list_effective_network_security_groups_initial( @@ -648,30 +604,8 @@ def list_effective_network_security_groups( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', response) if raw: @@ -680,12 +614,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_effective_network_security_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} def list_virtual_machine_scale_set_vm_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, custom_headers=None, raw=False, **operation_config): @@ -715,7 +651,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces' + url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -763,6 +699,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} def list_virtual_machine_scale_set_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -789,7 +726,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces' + url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -836,6 +773,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} def get_virtual_machine_scale_set_network_interface( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -865,7 +803,7 @@ def get_virtual_machine_scale_set_network_interface( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}' + url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -910,3 +848,4 @@ def get_virtual_machine_scale_set_network_interface( return client_raw_response return deserialized + get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_security_groups_operations.py index 573944b5ca0b..ba3d9c3555c8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_security_groups_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_security_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkSecurityGroupsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -88,12 +88,14 @@ def delete( group. :type network_security_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -103,40 +105,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def get( self, resource_group_name, network_security_group_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -203,12 +185,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -257,7 +240,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network security group in the specified resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkSecurityGroup', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -345,7 +311,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -390,6 +356,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -411,7 +378,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -457,3 +424,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_watchers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_watchers_operations.py index 3521b9e64e37..50a0fe66b9f3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_watchers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/network_watchers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkWatchersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -62,7 +62,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -109,6 +109,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def get( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -170,12 +171,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def _delete_initial( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -211,7 +213,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -219,12 +221,14 @@ def delete( :param network_watcher_name: The name of the network watcher. :type network_watcher_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -234,40 +238,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -289,7 +273,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -335,6 +319,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -354,7 +339,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -399,6 +384,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'} def get_topology( self, resource_group_name, network_watcher_name, target_resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -424,7 +410,7 @@ def get_topology( parameters = models.TopologyParameters(target_resource_group_name=target_resource_group_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology' + url = self.get_topology.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -469,12 +455,13 @@ def get_topology( return client_raw_response return deserialized + get_topology.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'} def _verify_ip_flow_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify' + url = self.verify_ip_flow.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -523,7 +510,7 @@ def _verify_ip_flow_initial( return deserialized def verify_ip_flow( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Verify IP flow from the specified VM to a location given the currently configured NSG rules. @@ -535,13 +522,17 @@ def verify_ip_flow( :type parameters: ~azure.mgmt.network.v2017_08_01.models.VerificationIPFlowParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VerificationIPFlowResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VerificationIPFlowResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.VerificationIPFlowResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.VerificationIPFlowResult]] :raises: :class:`CloudError` """ raw_result = self._verify_ip_flow_initial( @@ -552,30 +543,8 @@ def verify_ip_flow( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VerificationIPFlowResult', response) if raw: @@ -584,18 +553,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + verify_ip_flow.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} def _get_next_hop_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop' + url = self.get_next_hop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -644,7 +615,7 @@ def _get_next_hop_initial( return deserialized def get_next_hop( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -656,13 +627,16 @@ def get_next_hop( :type parameters: ~azure.mgmt.network.v2017_08_01.models.NextHopParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NextHopResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NextHopResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.NextHopResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.NextHopResult]] :raises: :class:`CloudError` """ raw_result = self._get_next_hop_initial( @@ -673,30 +647,8 @@ def get_next_hop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NextHopResult', response) if raw: @@ -705,12 +657,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_next_hop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} def _get_vm_security_rules_initial( @@ -718,7 +672,7 @@ def _get_vm_security_rules_initial( parameters = models.SecurityGroupViewParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView' + url = self.get_vm_security_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -767,7 +721,7 @@ def _get_vm_security_rules_initial( return deserialized def get_vm_security_rules( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the configured and effective security group rules on the specified VM. @@ -778,13 +732,16 @@ def get_vm_security_rules( :param target_resource_id: ID of the target VM. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - SecurityGroupViewResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityGroupViewResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.SecurityGroupViewResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.SecurityGroupViewResult]] :raises: :class:`CloudError` """ raw_result = self._get_vm_security_rules_initial( @@ -795,30 +752,8 @@ def get_vm_security_rules( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('SecurityGroupViewResult', response) if raw: @@ -827,18 +762,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vm_security_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} def _get_troubleshooting_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot' + url = self.get_troubleshooting.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -887,7 +824,7 @@ def _get_troubleshooting_initial( return deserialized def get_troubleshooting( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -899,13 +836,16 @@ def get_troubleshooting( :type parameters: ~azure.mgmt.network.v2017_08_01.models.TroubleshootingParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_initial( @@ -916,30 +856,8 @@ def get_troubleshooting( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -948,12 +866,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} def _get_troubleshooting_result_initial( @@ -961,7 +881,7 @@ def _get_troubleshooting_result_initial( parameters = models.QueryTroubleshootingParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult' + url = self.get_troubleshooting_result.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1010,7 +930,7 @@ def _get_troubleshooting_result_initial( return deserialized def get_troubleshooting_result( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1021,13 +941,16 @@ def get_troubleshooting_result( troubleshooting result. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_result_initial( @@ -1038,30 +961,8 @@ def get_troubleshooting_result( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -1070,18 +971,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} def _set_flow_log_configuration_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog' + url = self.set_flow_log_configuration.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1130,7 +1033,7 @@ def _set_flow_log_configuration_initial( return deserialized def set_flow_log_configuration( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1143,13 +1046,16 @@ def set_flow_log_configuration( :type parameters: ~azure.mgmt.network.v2017_08_01.models.FlowLogInformation :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._set_flow_log_configuration_initial( @@ -1160,30 +1066,8 @@ def set_flow_log_configuration( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1192,12 +1076,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_flow_log_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} def _get_flow_log_status_initial( @@ -1205,7 +1091,7 @@ def _get_flow_log_status_initial( parameters = models.FlowLogStatusParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus' + url = self.get_flow_log_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1254,7 +1140,7 @@ def _get_flow_log_status_initial( return deserialized def get_flow_log_status( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1266,13 +1152,16 @@ def get_flow_log_status( logging status. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._get_flow_log_status_initial( @@ -1283,30 +1172,8 @@ def get_flow_log_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1315,12 +1182,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_flow_log_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} def _check_connectivity_initial( @@ -1328,7 +1197,7 @@ def _check_connectivity_initial( parameters = models.ConnectivityParameters(source=source, destination=destination) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck' + url = self.check_connectivity.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1377,7 +1246,7 @@ def _check_connectivity_initial( return deserialized def check_connectivity( - self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, polling=True, **operation_config): """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1394,13 +1263,16 @@ def check_connectivity( :type destination: ~azure.mgmt.network.v2017_08_01.models.ConnectivityDestination :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectivityInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectivityInformation + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.ConnectivityInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.ConnectivityInformation]] :raises: :class:`CloudError` """ raw_result = self._check_connectivity_initial( @@ -1412,30 +1284,8 @@ def check_connectivity( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectivityInformation', response) if raw: @@ -1444,9 +1294,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + check_connectivity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/packet_captures_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/packet_captures_operations.py index 6f20b44ac4a1..4d53bdda9383 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/packet_captures_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/packet_captures_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PacketCapturesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -91,7 +91,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -104,13 +104,16 @@ def create( operation. :type parameters: ~azure.mgmt.network.v2017_08_01.models.PacketCapture :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PacketCaptureResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.PacketCaptureResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.PacketCaptureResult]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -122,30 +125,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureResult', response) if raw: @@ -154,12 +135,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def get( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -224,12 +207,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _delete_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -266,7 +250,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -276,12 +260,14 @@ def delete( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -292,46 +278,26 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _stop_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -368,7 +334,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -378,12 +344,14 @@ def stop( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -394,46 +362,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} def _get_status_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus' + url = self.get_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -479,7 +427,7 @@ def _get_status_initial( return deserialized def get_status( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -490,13 +438,17 @@ def get_status( session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureQueryStatusResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PacketCaptureQueryStatusResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.PacketCaptureQueryStatusResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.PacketCaptureQueryStatusResult]] :raises: :class:`CloudError` """ raw_result = self._get_status_initial( @@ -507,30 +459,8 @@ def get_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureQueryStatusResult', response) if raw: @@ -539,12 +469,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} def list( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -568,7 +500,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -615,3 +547,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/public_ip_addresses_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/public_ip_addresses_operations.py index f31c39b73f63..91ef570f5db8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/public_ip_addresses_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/public_ip_addresses_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PublicIPAddressesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ models = models @@ -43,7 +43,7 @@ def _delete_initial( api_version = "2017-08-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param public_ip_address_name: The name of the subnet. :type public_ip_address_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def get( self, resource_group_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( api_version = "2017-08-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -203,6 +185,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def _create_or_update_initial( @@ -210,7 +193,7 @@ def _create_or_update_initial( api_version = "2017-08-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PublicIPAddress or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.PublicIPAddress] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.PublicIPAddress]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('PublicIPAddress', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -347,7 +313,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -392,6 +358,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -415,7 +382,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -461,6 +428,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} def list_virtual_machine_scale_set_public_ip_addresses( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -488,7 +456,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses' + url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -535,6 +503,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses'} def list_virtual_machine_scale_set_vm_public_ip_addresses( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -568,7 +537,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses' + url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -618,6 +587,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses'} def get_virtual_machine_scale_set_public_ip_address( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -651,7 +621,7 @@ def get_virtual_machine_scale_set_public_ip_address( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}' + url = self.get_virtual_machine_scale_set_public_ip_address.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -698,3 +668,4 @@ def get_virtual_machine_scale_set_public_ip_address( return client_raw_response return deserialized + get_virtual_machine_scale_set_public_ip_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/route_filter_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/route_filter_rules_operations.py index cdf4b6a89aa8..7c5c8cc9f9f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/route_filter_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/route_filter_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFilterRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param rule_name: The name of the rule. :type rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def get( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -273,13 +256,16 @@ def create_or_update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_08_01.models.RouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -291,30 +277,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilterRule', response) if raw: @@ -323,18 +287,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -382,7 +348,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -396,13 +362,16 @@ def update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_08_01.models.PatchRouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -414,30 +383,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilterRule', response) if raw: @@ -446,12 +393,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def list_by_route_filter( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): @@ -475,7 +424,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules' + url = self.list_by_route_filter.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -522,3 +471,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_route_filter.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/route_filters_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/route_filters_operations.py index a8f94b9237bb..0befd722c605 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/route_filters_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/route_filters_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFiltersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_filter_name: The name of the route filter. :type route_filter_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def get( self, resource_group_name, route_filter_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type route_filter_parameters: ~azure.mgmt.network.v2017_08_01.models.RouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilter', response) if raw: @@ -316,18 +280,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -374,7 +340,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -386,13 +352,16 @@ def update( :type route_filter_parameters: ~azure.mgmt.network.v2017_08_01.models.PatchRouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -403,30 +372,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilter', response) if raw: @@ -435,12 +382,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -462,7 +411,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -508,6 +457,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -527,7 +477,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -572,3 +522,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/route_tables_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/route_tables_operations.py index aec475508870..19397314052e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/route_tables_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/route_tables_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteTablesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_table_name: The name of the route table. :type route_table_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def get( self, resource_group_name, route_table_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( table operation. :type parameters: ~azure.mgmt.network.v2017_08_01.models.RouteTable :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteTable - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.RouteTable] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.RouteTable]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteTable', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -342,7 +308,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -388,6 +354,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -452,3 +419,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/routes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/routes_operations.py index 9a85accff103..4473688b01e1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/routes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/routes_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RoutesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param route_name: The name of the route. :type route_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def get( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -272,13 +255,16 @@ def create_or_update( route operation. :type route_parameters: ~azure.mgmt.network.v2017_08_01.models.Route :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Route or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Route or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.Route] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.Route]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -290,30 +276,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Route', response) if raw: @@ -322,12 +286,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def list( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): @@ -351,7 +317,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -398,3 +364,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/security_rules_operations.py index 1b7022526ad9..caaf504bb8f8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/security_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( :param security_rule_name: The name of the security rule. :type security_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def get( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a security rule in the specified network security group. @@ -277,13 +260,16 @@ def create_or_update( :type security_rule_parameters: ~azure.mgmt.network.v2017_08_01.models.SecurityRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns SecurityRule - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.SecurityRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -295,30 +281,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('SecurityRule', response) if raw: @@ -327,12 +291,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def list( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +323,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -404,3 +370,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/subnets_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/subnets_operations.py index 46a3b3ae7672..3270afb5419c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/subnets_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/subnets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SubnetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param subnet_name: The name of the subnet. :type subnet_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def get( self, resource_group_name, virtual_network_name, subnet_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -276,13 +259,16 @@ def create_or_update( subnet operation. :type subnet_parameters: ~azure.mgmt.network.v2017_08_01.models.Subnet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Subnet or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Subnet or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.Subnet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.Subnet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -294,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Subnet', response) if raw: @@ -326,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -355,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -402,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/usages_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/usages_operations.py index 1d77588ff095..7f37b01b5f13 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/usages_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/usages_operations.py @@ -22,7 +22,7 @@ class UsagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_gateway_connections_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_gateway_connections_operations.py index df12a4fd1005..9c88aba75335 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_gateway_connections_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_gateway_connections_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway connection in the specified resource group. @@ -106,13 +106,17 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGatewayConnection or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnection or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +127,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGatewayConnection', response) if raw: @@ -155,12 +137,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def get( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -185,7 +169,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -226,12 +210,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -267,7 +252,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -276,12 +261,14 @@ def delete( virtual network gateway connection. :type virtual_network_gateway_connection_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -291,40 +278,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _set_shared_key_initial( @@ -332,7 +299,7 @@ def _set_shared_key_initial( parameters = models.ConnectionSharedKey(value=value) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.set_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -381,7 +348,7 @@ def _set_shared_key_initial( return deserialized def set_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, polling=True, **operation_config): """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -395,13 +362,16 @@ def set_shared_key( :param value: The virtual network connection shared key value. :type value: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectionSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.ConnectionSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.ConnectionSharedKey]] :raises: :class:`CloudError` """ raw_result = self._set_shared_key_initial( @@ -412,30 +382,8 @@ def set_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ConnectionSharedKey', response) if raw: @@ -444,12 +392,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def get_shared_key( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -473,7 +423,7 @@ def get_shared_key( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.get_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -514,6 +464,7 @@ def get_shared_key( return client_raw_response return deserialized + get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -536,7 +487,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -582,6 +533,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} def _reset_shared_key_initial( @@ -589,7 +541,7 @@ def _reset_shared_key_initial( parameters = models.ConnectionResetSharedKey(key_length=key_length) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset' + url = self.reset_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -636,7 +588,7 @@ def _reset_shared_key_initial( return deserialized def reset_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, polling=True, **operation_config): """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -651,13 +603,17 @@ def reset_shared_key( length, should between 1 and 128. :type key_length: int :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionResetSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConnectionResetSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.ConnectionResetSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.ConnectionResetSharedKey]] :raises: :class:`CloudError` """ raw_result = self._reset_shared_key_initial( @@ -668,30 +624,8 @@ def reset_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectionResetSharedKey', response) if raw: @@ -700,9 +634,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_gateways_operations.py index 02583659b426..ad5f9e309b99 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def get( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -343,7 +309,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -389,6 +355,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} def list_connections( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -414,7 +381,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections' + url = self.list_connections.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -461,12 +428,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections'} def _reset_initial( self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset' + url = self.reset.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -511,7 +479,7 @@ def _reset_initial( return deserialized def reset( - self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, polling=True, **operation_config): """Resets the primary of the virtual network gateway in the specified resource group. @@ -524,13 +492,16 @@ def reset( the begin reset of the active-active feature enabled gateway. :type gateway_vip: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._reset_initial( @@ -541,30 +512,8 @@ def reset( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -573,18 +522,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} def _generatevpnclientpackage_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage' + url = self.generatevpnclientpackage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -631,7 +582,7 @@ def _generatevpnclientpackage_initial( return deserialized def generatevpnclientpackage( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -645,12 +596,14 @@ def generatevpnclientpackage( :type parameters: ~azure.mgmt.network.v2017_08_01.models.VpnClientParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._generatevpnclientpackage_initial( @@ -661,30 +614,8 @@ def generatevpnclientpackage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -693,18 +624,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} def _generate_vpn_profile_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile' + url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -751,7 +684,7 @@ def _generate_vpn_profile_initial( return deserialized def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. @@ -766,12 +699,14 @@ def generate_vpn_profile( :type parameters: ~azure.mgmt.network.v2017_08_01.models.VpnClientParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._generate_vpn_profile_initial( @@ -782,30 +717,8 @@ def generate_vpn_profile( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -814,18 +727,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} def _get_vpn_profile_package_url_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl' + url = self.get_vpn_profile_package_url.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -868,7 +783,7 @@ def _get_vpn_profile_package_url_initial( return deserialized def get_vpn_profile_package_url( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. @@ -879,12 +794,14 @@ def get_vpn_profile_package_url( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._get_vpn_profile_package_url_initial( @@ -894,30 +811,8 @@ def get_vpn_profile_package_url( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -926,18 +821,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vpn_profile_package_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'} def _get_bgp_peer_status_initial( self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus' + url = self.get_bgp_peer_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -982,7 +879,7 @@ def _get_bgp_peer_status_initial( return deserialized def get_bgp_peer_status( - self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, polling=True, **operation_config): """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -993,13 +890,16 @@ def get_bgp_peer_status( :param peer: The IP address of the peer to retrieve the status of. :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - BgpPeerStatusListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BgpPeerStatusListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.BgpPeerStatusListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.BgpPeerStatusListResult]] :raises: :class:`CloudError` """ raw_result = self._get_bgp_peer_status_initial( @@ -1010,30 +910,8 @@ def get_bgp_peer_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('BgpPeerStatusListResult', response) if raw: @@ -1042,18 +920,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_bgp_peer_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} def _get_learned_routes_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes' + url = self.get_learned_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1096,7 +976,7 @@ def _get_learned_routes_initial( return deserialized def get_learned_routes( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1106,13 +986,16 @@ def get_learned_routes( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_learned_routes_initial( @@ -1122,30 +1005,8 @@ def get_learned_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -1154,18 +1015,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} def _get_advertised_routes_initial( self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes' + url = self.get_advertised_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1209,7 +1072,7 @@ def _get_advertised_routes_initial( return deserialized def get_advertised_routes( - self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1221,13 +1084,16 @@ def get_advertised_routes( :param peer: The IP address of the peer :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_advertised_routes_initial( @@ -1238,30 +1104,8 @@ def get_advertised_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -1270,9 +1114,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_peerings_operations.py index 11a699bf9ea8..aa8075b07880 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_network_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( peering. :type virtual_network_peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def get( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -275,13 +258,16 @@ def create_or_update( :type virtual_network_peering_parameters: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkPeering + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +279,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkPeering', response) if raw: @@ -325,12 +289,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +320,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -401,3 +367,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_networks_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_networks_operations.py index 6eda49acff8d..61f26fc2d5d8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_networks_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/virtual_networks_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworksOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-08-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param virtual_network_name: The name of the virtual network. :type virtual_network_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def get( self, resource_group_name, virtual_network_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_08_01.models.VirtualNetwork :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetwork or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetwork] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_08_01.models.VirtualNetwork]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetwork', response) if raw: @@ -316,12 +280,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -341,7 +307,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -386,6 +352,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +374,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -453,6 +420,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks'} def check_ip_address_availability( self, resource_group_name, virtual_network_name, ip_address=None, custom_headers=None, raw=False, **operation_config): @@ -476,7 +444,7 @@ def check_ip_address_availability( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability' + url = self.check_ip_address_availability.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -519,6 +487,7 @@ def check_ip_address_availability( return client_raw_response return deserialized + check_ip_address_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'} def list_usage( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -542,7 +511,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages' + url = self.list_usage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -589,3 +558,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/__init__.py index 479821a0e332..62ba4ca1bac9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/__init__.py @@ -9,179 +9,354 @@ # regenerated. # -------------------------------------------------------------------------- -from .sub_resource import SubResource -from .backend_address_pool import BackendAddressPool -from .inbound_nat_rule import InboundNatRule -from .application_security_group import ApplicationSecurityGroup -from .security_rule import SecurityRule -from .network_interface_dns_settings import NetworkInterfaceDnsSettings -from .network_interface import NetworkInterface -from .network_security_group import NetworkSecurityGroup -from .route import Route -from .route_table import RouteTable -from .service_endpoint_properties_format import ServiceEndpointPropertiesFormat -from .public_ip_address_sku import PublicIPAddressSku -from .public_ip_address_dns_settings import PublicIPAddressDnsSettings -from .public_ip_address import PublicIPAddress -from .ip_configuration import IPConfiguration -from .resource_navigation_link import ResourceNavigationLink -from .subnet import Subnet -from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration -from .application_gateway_backend_address import ApplicationGatewayBackendAddress -from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool -from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining -from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings -from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer -from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings -from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool -from .application_gateway_backend_health import ApplicationGatewayBackendHealth -from .application_gateway_sku import ApplicationGatewaySku -from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy -from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration -from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate -from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate -from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration -from .application_gateway_frontend_port import ApplicationGatewayFrontendPort -from .application_gateway_http_listener import ApplicationGatewayHttpListener -from .application_gateway_path_rule import ApplicationGatewayPathRule -from .application_gateway_probe_health_response_match import ApplicationGatewayProbeHealthResponseMatch -from .application_gateway_probe import ApplicationGatewayProbe -from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule -from .application_gateway_redirect_configuration import ApplicationGatewayRedirectConfiguration -from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap -from .application_gateway_firewall_disabled_rule_group import ApplicationGatewayFirewallDisabledRuleGroup -from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration -from .application_gateway import ApplicationGateway -from .application_gateway_firewall_rule import ApplicationGatewayFirewallRule -from .application_gateway_firewall_rule_group import ApplicationGatewayFirewallRuleGroup -from .application_gateway_firewall_rule_set import ApplicationGatewayFirewallRuleSet -from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult -from .application_gateway_available_ssl_options import ApplicationGatewayAvailableSslOptions -from .application_gateway_ssl_predefined_policy import ApplicationGatewaySslPredefinedPolicy -from .resource import Resource -from .tags_object import TagsObject -from .dns_name_availability_result import DnsNameAvailabilityResult -from .endpoint_service_result import EndpointServiceResult -from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization -from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig -from .route_filter_rule import RouteFilterRule -from .express_route_circuit_stats import ExpressRouteCircuitStats -from .express_route_circuit_peering import ExpressRouteCircuitPeering -from .route_filter import RouteFilter -from .ipv6_express_route_circuit_peering_config import Ipv6ExpressRouteCircuitPeeringConfig -from .express_route_circuit_sku import ExpressRouteCircuitSku -from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties -from .express_route_circuit import ExpressRouteCircuit -from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable -from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult -from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable -from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult -from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary -from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult -from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered -from .express_route_service_provider import ExpressRouteServiceProvider -from .load_balancer_sku import LoadBalancerSku -from .frontend_ip_configuration import FrontendIPConfiguration -from .load_balancing_rule import LoadBalancingRule -from .probe import Probe -from .inbound_nat_pool import InboundNatPool -from .outbound_nat_rule import OutboundNatRule -from .load_balancer import LoadBalancer -from .error_details import ErrorDetails -from .error import Error -from .azure_async_operation_result import AzureAsyncOperationResult -from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation -from .effective_network_security_rule import EffectiveNetworkSecurityRule -from .effective_network_security_group import EffectiveNetworkSecurityGroup -from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult -from .effective_route import EffectiveRoute -from .effective_route_list_result import EffectiveRouteListResult -from .network_watcher import NetworkWatcher -from .topology_parameters import TopologyParameters -from .topology_association import TopologyAssociation -from .topology_resource import TopologyResource -from .topology import Topology -from .verification_ip_flow_parameters import VerificationIPFlowParameters -from .verification_ip_flow_result import VerificationIPFlowResult -from .next_hop_parameters import NextHopParameters -from .next_hop_result import NextHopResult -from .security_group_view_parameters import SecurityGroupViewParameters -from .network_interface_association import NetworkInterfaceAssociation -from .subnet_association import SubnetAssociation -from .security_rule_associations import SecurityRuleAssociations -from .security_group_network_interface import SecurityGroupNetworkInterface -from .security_group_view_result import SecurityGroupViewResult -from .packet_capture_storage_location import PacketCaptureStorageLocation -from .packet_capture_filter import PacketCaptureFilter -from .packet_capture_parameters import PacketCaptureParameters -from .packet_capture import PacketCapture -from .packet_capture_result import PacketCaptureResult -from .packet_capture_query_status_result import PacketCaptureQueryStatusResult -from .troubleshooting_parameters import TroubleshootingParameters -from .query_troubleshooting_parameters import QueryTroubleshootingParameters -from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions -from .troubleshooting_details import TroubleshootingDetails -from .troubleshooting_result import TroubleshootingResult -from .retention_policy_parameters import RetentionPolicyParameters -from .flow_log_status_parameters import FlowLogStatusParameters -from .flow_log_information import FlowLogInformation -from .connectivity_source import ConnectivitySource -from .connectivity_destination import ConnectivityDestination -from .connectivity_parameters import ConnectivityParameters -from .connectivity_issue import ConnectivityIssue -from .connectivity_hop import ConnectivityHop -from .connectivity_information import ConnectivityInformation -from .azure_reachability_report_location import AzureReachabilityReportLocation -from .azure_reachability_report_parameters import AzureReachabilityReportParameters -from .azure_reachability_report_latency_info import AzureReachabilityReportLatencyInfo -from .azure_reachability_report_item import AzureReachabilityReportItem -from .azure_reachability_report import AzureReachabilityReport -from .available_providers_list_parameters import AvailableProvidersListParameters -from .available_providers_list_city import AvailableProvidersListCity -from .available_providers_list_state import AvailableProvidersListState -from .available_providers_list_country import AvailableProvidersListCountry -from .available_providers_list import AvailableProvidersList -from .operation_display import OperationDisplay -from .availability import Availability -from .dimension import Dimension -from .metric_specification import MetricSpecification -from .log_specification import LogSpecification -from .operation_properties_format_service_specification import OperationPropertiesFormatServiceSpecification -from .operation import Operation -from .patch_route_filter_rule import PatchRouteFilterRule -from .patch_route_filter import PatchRouteFilter -from .bgp_community import BGPCommunity -from .bgp_service_community import BgpServiceCommunity -from .usage_name import UsageName -from .usage import Usage -from .address_space import AddressSpace -from .virtual_network_peering import VirtualNetworkPeering -from .dhcp_options import DhcpOptions -from .virtual_network import VirtualNetwork -from .ip_address_availability_result import IPAddressAvailabilityResult -from .virtual_network_usage_name import VirtualNetworkUsageName -from .virtual_network_usage import VirtualNetworkUsage -from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration -from .virtual_network_gateway_sku import VirtualNetworkGatewaySku -from .vpn_client_root_certificate import VpnClientRootCertificate -from .vpn_client_revoked_certificate import VpnClientRevokedCertificate -from .vpn_client_configuration import VpnClientConfiguration -from .bgp_settings import BgpSettings -from .bgp_peer_status import BgpPeerStatus -from .gateway_route import GatewayRoute -from .virtual_network_gateway import VirtualNetworkGateway -from .vpn_client_parameters import VpnClientParameters -from .bgp_peer_status_list_result import BgpPeerStatusListResult -from .gateway_route_list_result import GatewayRouteListResult -from .tunnel_connection_health import TunnelConnectionHealth -from .local_network_gateway import LocalNetworkGateway -from .ipsec_policy import IpsecPolicy -from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection -from .connection_reset_shared_key import ConnectionResetSharedKey -from .connection_shared_key import ConnectionSharedKey -from .virtual_network_connection_gateway_reference import VirtualNetworkConnectionGatewayReference -from .virtual_network_gateway_connection_list_entity import VirtualNetworkGatewayConnectionListEntity -from .vpn_device_script_parameters import VpnDeviceScriptParameters +try: + from .sub_resource_py3 import SubResource + from .backend_address_pool_py3 import BackendAddressPool + from .inbound_nat_rule_py3 import InboundNatRule + from .application_security_group_py3 import ApplicationSecurityGroup + from .security_rule_py3 import SecurityRule + from .network_interface_dns_settings_py3 import NetworkInterfaceDnsSettings + from .network_interface_py3 import NetworkInterface + from .network_security_group_py3 import NetworkSecurityGroup + from .route_py3 import Route + from .route_table_py3 import RouteTable + from .service_endpoint_properties_format_py3 import ServiceEndpointPropertiesFormat + from .public_ip_address_sku_py3 import PublicIPAddressSku + from .public_ip_address_dns_settings_py3 import PublicIPAddressDnsSettings + from .public_ip_address_py3 import PublicIPAddress + from .ip_configuration_py3 import IPConfiguration + from .resource_navigation_link_py3 import ResourceNavigationLink + from .subnet_py3 import Subnet + from .network_interface_ip_configuration_py3 import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address_py3 import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool_py3 import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining_py3 import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings_py3 import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server_py3 import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings_py3 import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool_py3 import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health_py3 import ApplicationGatewayBackendHealth + from .application_gateway_sku_py3 import ApplicationGatewaySku + from .application_gateway_ssl_policy_py3 import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration_py3 import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate_py3 import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate_py3 import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration_py3 import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port_py3 import ApplicationGatewayFrontendPort + from .application_gateway_http_listener_py3 import ApplicationGatewayHttpListener + from .application_gateway_path_rule_py3 import ApplicationGatewayPathRule + from .application_gateway_probe_health_response_match_py3 import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_probe_py3 import ApplicationGatewayProbe + from .application_gateway_request_routing_rule_py3 import ApplicationGatewayRequestRoutingRule + from .application_gateway_redirect_configuration_py3 import ApplicationGatewayRedirectConfiguration + from .application_gateway_url_path_map_py3 import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group_py3 import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration_py3 import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway_py3 import ApplicationGateway + from .application_gateway_firewall_rule_py3 import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group_py3 import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set_py3 import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result_py3 import ApplicationGatewayAvailableWafRuleSetsResult + from .application_gateway_available_ssl_options_py3 import ApplicationGatewayAvailableSslOptions + from .application_gateway_ssl_predefined_policy_py3 import ApplicationGatewaySslPredefinedPolicy + from .resource_py3 import Resource + from .tags_object_py3 import TagsObject + from .dns_name_availability_result_py3 import DnsNameAvailabilityResult + from .endpoint_service_result_py3 import EndpointServiceResult + from .express_route_circuit_authorization_py3 import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config_py3 import ExpressRouteCircuitPeeringConfig + from .route_filter_rule_py3 import RouteFilterRule + from .express_route_circuit_stats_py3 import ExpressRouteCircuitStats + from .express_route_circuit_peering_py3 import ExpressRouteCircuitPeering + from .route_filter_py3 import RouteFilter + from .ipv6_express_route_circuit_peering_config_py3 import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku_py3 import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties_py3 import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit_py3 import ExpressRouteCircuit + from .express_route_circuit_arp_table_py3 import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result_py3 import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table_py3 import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result_py3 import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary_py3 import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result_py3 import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered_py3 import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider_py3 import ExpressRouteServiceProvider + from .load_balancer_sku_py3 import LoadBalancerSku + from .frontend_ip_configuration_py3 import FrontendIPConfiguration + from .load_balancing_rule_py3 import LoadBalancingRule + from .probe_py3 import Probe + from .inbound_nat_pool_py3 import InboundNatPool + from .outbound_nat_rule_py3 import OutboundNatRule + from .load_balancer_py3 import LoadBalancer + from .error_details_py3 import ErrorDetails + from .error_py3 import Error + from .azure_async_operation_result_py3 import AzureAsyncOperationResult + from .effective_network_security_group_association_py3 import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule_py3 import EffectiveNetworkSecurityRule + from .effective_network_security_group_py3 import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result_py3 import EffectiveNetworkSecurityGroupListResult + from .effective_route_py3 import EffectiveRoute + from .effective_route_list_result_py3 import EffectiveRouteListResult + from .network_watcher_py3 import NetworkWatcher + from .topology_parameters_py3 import TopologyParameters + from .topology_association_py3 import TopologyAssociation + from .topology_resource_py3 import TopologyResource + from .topology_py3 import Topology + from .verification_ip_flow_parameters_py3 import VerificationIPFlowParameters + from .verification_ip_flow_result_py3 import VerificationIPFlowResult + from .next_hop_parameters_py3 import NextHopParameters + from .next_hop_result_py3 import NextHopResult + from .security_group_view_parameters_py3 import SecurityGroupViewParameters + from .network_interface_association_py3 import NetworkInterfaceAssociation + from .subnet_association_py3 import SubnetAssociation + from .security_rule_associations_py3 import SecurityRuleAssociations + from .security_group_network_interface_py3 import SecurityGroupNetworkInterface + from .security_group_view_result_py3 import SecurityGroupViewResult + from .packet_capture_storage_location_py3 import PacketCaptureStorageLocation + from .packet_capture_filter_py3 import PacketCaptureFilter + from .packet_capture_parameters_py3 import PacketCaptureParameters + from .packet_capture_py3 import PacketCapture + from .packet_capture_result_py3 import PacketCaptureResult + from .packet_capture_query_status_result_py3 import PacketCaptureQueryStatusResult + from .troubleshooting_parameters_py3 import TroubleshootingParameters + from .query_troubleshooting_parameters_py3 import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions_py3 import TroubleshootingRecommendedActions + from .troubleshooting_details_py3 import TroubleshootingDetails + from .troubleshooting_result_py3 import TroubleshootingResult + from .retention_policy_parameters_py3 import RetentionPolicyParameters + from .flow_log_status_parameters_py3 import FlowLogStatusParameters + from .flow_log_information_py3 import FlowLogInformation + from .connectivity_source_py3 import ConnectivitySource + from .connectivity_destination_py3 import ConnectivityDestination + from .connectivity_parameters_py3 import ConnectivityParameters + from .connectivity_issue_py3 import ConnectivityIssue + from .connectivity_hop_py3 import ConnectivityHop + from .connectivity_information_py3 import ConnectivityInformation + from .azure_reachability_report_location_py3 import AzureReachabilityReportLocation + from .azure_reachability_report_parameters_py3 import AzureReachabilityReportParameters + from .azure_reachability_report_latency_info_py3 import AzureReachabilityReportLatencyInfo + from .azure_reachability_report_item_py3 import AzureReachabilityReportItem + from .azure_reachability_report_py3 import AzureReachabilityReport + from .available_providers_list_parameters_py3 import AvailableProvidersListParameters + from .available_providers_list_city_py3 import AvailableProvidersListCity + from .available_providers_list_state_py3 import AvailableProvidersListState + from .available_providers_list_country_py3 import AvailableProvidersListCountry + from .available_providers_list_py3 import AvailableProvidersList + from .operation_display_py3 import OperationDisplay + from .availability_py3 import Availability + from .dimension_py3 import Dimension + from .metric_specification_py3 import MetricSpecification + from .log_specification_py3 import LogSpecification + from .operation_properties_format_service_specification_py3 import OperationPropertiesFormatServiceSpecification + from .operation_py3 import Operation + from .patch_route_filter_rule_py3 import PatchRouteFilterRule + from .patch_route_filter_py3 import PatchRouteFilter + from .bgp_community_py3 import BGPCommunity + from .bgp_service_community_py3 import BgpServiceCommunity + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .address_space_py3 import AddressSpace + from .virtual_network_peering_py3 import VirtualNetworkPeering + from .dhcp_options_py3 import DhcpOptions + from .virtual_network_py3 import VirtualNetwork + from .ip_address_availability_result_py3 import IPAddressAvailabilityResult + from .virtual_network_usage_name_py3 import VirtualNetworkUsageName + from .virtual_network_usage_py3 import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration_py3 import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku_py3 import VirtualNetworkGatewaySku + from .vpn_client_root_certificate_py3 import VpnClientRootCertificate + from .vpn_client_revoked_certificate_py3 import VpnClientRevokedCertificate + from .vpn_client_configuration_py3 import VpnClientConfiguration + from .bgp_settings_py3 import BgpSettings + from .bgp_peer_status_py3 import BgpPeerStatus + from .gateway_route_py3 import GatewayRoute + from .virtual_network_gateway_py3 import VirtualNetworkGateway + from .vpn_client_parameters_py3 import VpnClientParameters + from .bgp_peer_status_list_result_py3 import BgpPeerStatusListResult + from .gateway_route_list_result_py3 import GatewayRouteListResult + from .tunnel_connection_health_py3 import TunnelConnectionHealth + from .local_network_gateway_py3 import LocalNetworkGateway + from .ipsec_policy_py3 import IpsecPolicy + from .virtual_network_gateway_connection_py3 import VirtualNetworkGatewayConnection + from .connection_reset_shared_key_py3 import ConnectionResetSharedKey + from .connection_shared_key_py3 import ConnectionSharedKey + from .virtual_network_connection_gateway_reference_py3 import VirtualNetworkConnectionGatewayReference + from .virtual_network_gateway_connection_list_entity_py3 import VirtualNetworkGatewayConnectionListEntity + from .vpn_device_script_parameters_py3 import VpnDeviceScriptParameters +except (SyntaxError, ImportError): + from .sub_resource import SubResource + from .backend_address_pool import BackendAddressPool + from .inbound_nat_rule import InboundNatRule + from .application_security_group import ApplicationSecurityGroup + from .security_rule import SecurityRule + from .network_interface_dns_settings import NetworkInterfaceDnsSettings + from .network_interface import NetworkInterface + from .network_security_group import NetworkSecurityGroup + from .route import Route + from .route_table import RouteTable + from .service_endpoint_properties_format import ServiceEndpointPropertiesFormat + from .public_ip_address_sku import PublicIPAddressSku + from .public_ip_address_dns_settings import PublicIPAddressDnsSettings + from .public_ip_address import PublicIPAddress + from .ip_configuration import IPConfiguration + from .resource_navigation_link import ResourceNavigationLink + from .subnet import Subnet + from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health import ApplicationGatewayBackendHealth + from .application_gateway_sku import ApplicationGatewaySku + from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port import ApplicationGatewayFrontendPort + from .application_gateway_http_listener import ApplicationGatewayHttpListener + from .application_gateway_path_rule import ApplicationGatewayPathRule + from .application_gateway_probe_health_response_match import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_probe import ApplicationGatewayProbe + from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule + from .application_gateway_redirect_configuration import ApplicationGatewayRedirectConfiguration + from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway import ApplicationGateway + from .application_gateway_firewall_rule import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult + from .application_gateway_available_ssl_options import ApplicationGatewayAvailableSslOptions + from .application_gateway_ssl_predefined_policy import ApplicationGatewaySslPredefinedPolicy + from .resource import Resource + from .tags_object import TagsObject + from .dns_name_availability_result import DnsNameAvailabilityResult + from .endpoint_service_result import EndpointServiceResult + from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig + from .route_filter_rule import RouteFilterRule + from .express_route_circuit_stats import ExpressRouteCircuitStats + from .express_route_circuit_peering import ExpressRouteCircuitPeering + from .route_filter import RouteFilter + from .ipv6_express_route_circuit_peering_config import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit import ExpressRouteCircuit + from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider import ExpressRouteServiceProvider + from .load_balancer_sku import LoadBalancerSku + from .frontend_ip_configuration import FrontendIPConfiguration + from .load_balancing_rule import LoadBalancingRule + from .probe import Probe + from .inbound_nat_pool import InboundNatPool + from .outbound_nat_rule import OutboundNatRule + from .load_balancer import LoadBalancer + from .error_details import ErrorDetails + from .error import Error + from .azure_async_operation_result import AzureAsyncOperationResult + from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule import EffectiveNetworkSecurityRule + from .effective_network_security_group import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult + from .effective_route import EffectiveRoute + from .effective_route_list_result import EffectiveRouteListResult + from .network_watcher import NetworkWatcher + from .topology_parameters import TopologyParameters + from .topology_association import TopologyAssociation + from .topology_resource import TopologyResource + from .topology import Topology + from .verification_ip_flow_parameters import VerificationIPFlowParameters + from .verification_ip_flow_result import VerificationIPFlowResult + from .next_hop_parameters import NextHopParameters + from .next_hop_result import NextHopResult + from .security_group_view_parameters import SecurityGroupViewParameters + from .network_interface_association import NetworkInterfaceAssociation + from .subnet_association import SubnetAssociation + from .security_rule_associations import SecurityRuleAssociations + from .security_group_network_interface import SecurityGroupNetworkInterface + from .security_group_view_result import SecurityGroupViewResult + from .packet_capture_storage_location import PacketCaptureStorageLocation + from .packet_capture_filter import PacketCaptureFilter + from .packet_capture_parameters import PacketCaptureParameters + from .packet_capture import PacketCapture + from .packet_capture_result import PacketCaptureResult + from .packet_capture_query_status_result import PacketCaptureQueryStatusResult + from .troubleshooting_parameters import TroubleshootingParameters + from .query_troubleshooting_parameters import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions + from .troubleshooting_details import TroubleshootingDetails + from .troubleshooting_result import TroubleshootingResult + from .retention_policy_parameters import RetentionPolicyParameters + from .flow_log_status_parameters import FlowLogStatusParameters + from .flow_log_information import FlowLogInformation + from .connectivity_source import ConnectivitySource + from .connectivity_destination import ConnectivityDestination + from .connectivity_parameters import ConnectivityParameters + from .connectivity_issue import ConnectivityIssue + from .connectivity_hop import ConnectivityHop + from .connectivity_information import ConnectivityInformation + from .azure_reachability_report_location import AzureReachabilityReportLocation + from .azure_reachability_report_parameters import AzureReachabilityReportParameters + from .azure_reachability_report_latency_info import AzureReachabilityReportLatencyInfo + from .azure_reachability_report_item import AzureReachabilityReportItem + from .azure_reachability_report import AzureReachabilityReport + from .available_providers_list_parameters import AvailableProvidersListParameters + from .available_providers_list_city import AvailableProvidersListCity + from .available_providers_list_state import AvailableProvidersListState + from .available_providers_list_country import AvailableProvidersListCountry + from .available_providers_list import AvailableProvidersList + from .operation_display import OperationDisplay + from .availability import Availability + from .dimension import Dimension + from .metric_specification import MetricSpecification + from .log_specification import LogSpecification + from .operation_properties_format_service_specification import OperationPropertiesFormatServiceSpecification + from .operation import Operation + from .patch_route_filter_rule import PatchRouteFilterRule + from .patch_route_filter import PatchRouteFilter + from .bgp_community import BGPCommunity + from .bgp_service_community import BgpServiceCommunity + from .usage_name import UsageName + from .usage import Usage + from .address_space import AddressSpace + from .virtual_network_peering import VirtualNetworkPeering + from .dhcp_options import DhcpOptions + from .virtual_network import VirtualNetwork + from .ip_address_availability_result import IPAddressAvailabilityResult + from .virtual_network_usage_name import VirtualNetworkUsageName + from .virtual_network_usage import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku import VirtualNetworkGatewaySku + from .vpn_client_root_certificate import VpnClientRootCertificate + from .vpn_client_revoked_certificate import VpnClientRevokedCertificate + from .vpn_client_configuration import VpnClientConfiguration + from .bgp_settings import BgpSettings + from .bgp_peer_status import BgpPeerStatus + from .gateway_route import GatewayRoute + from .virtual_network_gateway import VirtualNetworkGateway + from .vpn_client_parameters import VpnClientParameters + from .bgp_peer_status_list_result import BgpPeerStatusListResult + from .gateway_route_list_result import GatewayRouteListResult + from .tunnel_connection_health import TunnelConnectionHealth + from .local_network_gateway import LocalNetworkGateway + from .ipsec_policy import IpsecPolicy + from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection + from .connection_reset_shared_key import ConnectionResetSharedKey + from .connection_shared_key import ConnectionSharedKey + from .virtual_network_connection_gateway_reference import VirtualNetworkConnectionGatewayReference + from .virtual_network_gateway_connection_list_entity import VirtualNetworkGatewayConnectionListEntity + from .vpn_device_script_parameters import VpnDeviceScriptParameters from .application_gateway_paged import ApplicationGatewayPaged from .application_gateway_ssl_predefined_policy_paged import ApplicationGatewaySslPredefinedPolicyPaged from .application_security_group_paged import ApplicationSecurityGroupPaged diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/address_space.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/address_space.py index d7050c78a457..fbf42c9e0ade 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/address_space.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/address_space.py @@ -25,6 +25,6 @@ class AddressSpace(Model): 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, } - def __init__(self, address_prefixes=None): - super(AddressSpace, self).__init__() - self.address_prefixes = address_prefixes + def __init__(self, **kwargs): + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = kwargs.get('address_prefixes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/address_space_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/address_space_py3.py new file mode 100644 index 000000000000..9794cc805efa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/address_space_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AddressSpace(Model): + """AddressSpace contains an array of IP address ranges that can be used by + subnets of the virtual network. + + :param address_prefixes: A list of address blocks reserved for this + virtual network in CIDR notation. + :type address_prefixes: list[str] + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__(self, *, address_prefixes=None, **kwargs) -> None: + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = address_prefixes diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway.py index 153a59ed6666..4ae46748c26a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway.py @@ -130,24 +130,24 @@ class ApplicationGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, redirect_configurations=None, web_application_firewall_configuration=None, resource_guid=None, provisioning_state=None, etag=None): - super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.ssl_policy = ssl_policy + def __init__(self, **kwargs): + super(ApplicationGateway, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.ssl_policy = kwargs.get('ssl_policy', None) self.operational_state = None - self.gateway_ip_configurations = gateway_ip_configurations - self.authentication_certificates = authentication_certificates - self.ssl_certificates = ssl_certificates - self.frontend_ip_configurations = frontend_ip_configurations - self.frontend_ports = frontend_ports - self.probes = probes - self.backend_address_pools = backend_address_pools - self.backend_http_settings_collection = backend_http_settings_collection - self.http_listeners = http_listeners - self.url_path_maps = url_path_maps - self.request_routing_rules = request_routing_rules - self.redirect_configurations = redirect_configurations - self.web_application_firewall_configuration = web_application_firewall_configuration - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.gateway_ip_configurations = kwargs.get('gateway_ip_configurations', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.ssl_certificates = kwargs.get('ssl_certificates', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.frontend_ports = kwargs.get('frontend_ports', None) + self.probes = kwargs.get('probes', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) + self.http_listeners = kwargs.get('http_listeners', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.redirect_configurations = kwargs.get('redirect_configurations', None) + self.web_application_firewall_configuration = kwargs.get('web_application_firewall_configuration', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_authentication_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_authentication_certificate.py index 18f36b7401a7..dff594340e59 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_authentication_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_authentication_certificate.py @@ -42,10 +42,10 @@ class ApplicationGatewayAuthenticationCertificate(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, data=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id) - self.data = data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayAuthenticationCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_authentication_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_authentication_certificate_py3.py new file mode 100644 index 000000000000..f31145eb222c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_authentication_certificate_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayAuthenticationCertificate(SubResource): + """Authentication certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Certificate public data. + :type data: str + :param provisioning_state: Provisioning state of the authentication + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_ssl_options.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_ssl_options.py index c808c4cd86a2..89b7a19aa7fc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_ssl_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_ssl_options.py @@ -62,9 +62,9 @@ class ApplicationGatewayAvailableSslOptions(Resource): 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, } - def __init__(self, id=None, location=None, tags=None, predefined_policies=None, default_policy=None, available_cipher_suites=None, available_protocols=None): - super(ApplicationGatewayAvailableSslOptions, self).__init__(id=id, location=location, tags=tags) - self.predefined_policies = predefined_policies - self.default_policy = default_policy - self.available_cipher_suites = available_cipher_suites - self.available_protocols = available_protocols + def __init__(self, **kwargs): + super(ApplicationGatewayAvailableSslOptions, self).__init__(**kwargs) + self.predefined_policies = kwargs.get('predefined_policies', None) + self.default_policy = kwargs.get('default_policy', None) + self.available_cipher_suites = kwargs.get('available_cipher_suites', None) + self.available_protocols = kwargs.get('available_protocols', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_ssl_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_ssl_options_py3.py new file mode 100644 index 000000000000..ff338da2219f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_ssl_options_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayAvailableSslOptions(Resource): + """Response for ApplicationGatewayAvailableSslOptions API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param predefined_policies: List of available Ssl predefined policy. + :type predefined_policies: + list[~azure.mgmt.network.v2017_09_01.models.SubResource] + :param default_policy: Name of the Ssl predefined policy applied by + default to application gateway. Possible values include: + 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type default_policy: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslPolicyName + :param available_cipher_suites: List of available Ssl cipher suites. + :type available_cipher_suites: list[str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslCipherSuite] + :param available_protocols: List of available Ssl protocols. + :type available_protocols: list[str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslProtocol] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'predefined_policies': {'key': 'properties.predefinedPolicies', 'type': '[SubResource]'}, + 'default_policy': {'key': 'properties.defaultPolicy', 'type': 'str'}, + 'available_cipher_suites': {'key': 'properties.availableCipherSuites', 'type': '[str]'}, + 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, predefined_policies=None, default_policy=None, available_cipher_suites=None, available_protocols=None, **kwargs) -> None: + super(ApplicationGatewayAvailableSslOptions, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.predefined_policies = predefined_policies + self.default_policy = default_policy + self.available_cipher_suites = available_cipher_suites + self.available_protocols = available_protocols diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_waf_rule_sets_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_waf_rule_sets_result.py index 06a59afb03d9..82146d1a1808 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_waf_rule_sets_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_waf_rule_sets_result.py @@ -24,6 +24,6 @@ class ApplicationGatewayAvailableWafRuleSetsResult(Model): 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, } - def __init__(self, value=None): - super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_waf_rule_sets_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_waf_rule_sets_result_py3.py new file mode 100644 index 000000000000..1d90cb1f1470 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_available_waf_rule_sets_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayAvailableWafRuleSetsResult(Model): + """Response for ApplicationGatewayAvailableWafRuleSets API service call. + + :param value: The list of application gateway rule sets. + :type value: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayFirewallRuleSet] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address.py index 6005027d0845..e7a61fe1705c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address.py @@ -26,7 +26,7 @@ class ApplicationGatewayBackendAddress(Model): 'ip_address': {'key': 'ipAddress', 'type': 'str'}, } - def __init__(self, fqdn=None, ip_address=None): - super(ApplicationGatewayBackendAddress, self).__init__() - self.fqdn = fqdn - self.ip_address = ip_address + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = kwargs.get('fqdn', None) + self.ip_address = kwargs.get('ip_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address_pool.py index dd064799aeb8..b6640d8c1b4e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address_pool.py @@ -47,11 +47,11 @@ class ApplicationGatewayBackendAddressPool(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayBackendAddressPool, self).__init__(id=id) - self.backend_ip_configurations = backend_ip_configurations - self.backend_addresses = backend_addresses - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddressPool, self).__init__(**kwargs) + self.backend_ip_configurations = kwargs.get('backend_ip_configurations', None) + self.backend_addresses = kwargs.get('backend_addresses', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address_pool_py3.py new file mode 100644 index 000000000000..0d2b224771d0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address_pool_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + :param id: Resource ID. + :type id: str + :param backend_ip_configurations: Collection of references to IPs defined + in network interfaces. + :type backend_ip_configurations: + list[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses + :type backend_addresses: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendAddress] + :param provisioning_state: Provisioning state of the backend address pool + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Resource that is unique within a resource group. This name + can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = backend_ip_configurations + self.backend_addresses = backend_addresses + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address_py3.py new file mode 100644 index 000000000000..d18e476244d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_address_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendAddress(Model): + """Backend address of an application gateway. + + :param fqdn: Fully qualified domain name (FQDN). + :type fqdn: str + :param ip_address: IP address + :type ip_address: str + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__(self, *, fqdn: str=None, ip_address: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = fqdn + self.ip_address = ip_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health.py index 4a08c2278fa7..c55f75ff03bd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health.py @@ -24,6 +24,6 @@ class ApplicationGatewayBackendHealth(Model): 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, } - def __init__(self, backend_address_pools=None): - super(ApplicationGatewayBackendHealth, self).__init__() - self.backend_address_pools = backend_address_pools + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = kwargs.get('backend_address_pools', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_http_settings.py index 7af768cecf1f..12d320992ce7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_http_settings.py @@ -29,7 +29,7 @@ class ApplicationGatewayBackendHealthHttpSettings(Model): 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, } - def __init__(self, backend_http_settings=None, servers=None): - super(ApplicationGatewayBackendHealthHttpSettings, self).__init__() - self.backend_http_settings = backend_http_settings - self.servers = servers + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.servers = kwargs.get('servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_http_settings_py3.py new file mode 100644 index 000000000000..2ec7b8e77c19 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_http_settings_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthHttpSettings(Model): + """Application gateway BackendHealthHttp settings. + + :param backend_http_settings: Reference of an + ApplicationGatewayBackendHttpSettings resource. + :type backend_http_settings: + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendHealthServer] + """ + + _attribute_map = { + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, + 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, + } + + def __init__(self, *, backend_http_settings=None, servers=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = backend_http_settings + self.servers = servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_pool.py index a1fc3ad643cd..c7ea51a8dc5b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_pool.py @@ -30,7 +30,7 @@ class ApplicationGatewayBackendHealthPool(Model): 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, } - def __init__(self, backend_address_pool=None, backend_http_settings_collection=None): - super(ApplicationGatewayBackendHealthPool, self).__init__() - self.backend_address_pool = backend_address_pool - self.backend_http_settings_collection = backend_http_settings_collection + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_pool_py3.py new file mode 100644 index 000000000000..cfc035286ef8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_pool_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthPool(Model): + """Application gateway BackendHealth pool. + + :param backend_address_pool: Reference of an + ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of + ApplicationGatewayBackendHealthHttpSettings resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, + } + + def __init__(self, *, backend_address_pool=None, backend_http_settings_collection=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_http_settings_collection = backend_http_settings_collection diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_py3.py new file mode 100644 index 000000000000..74e8e17bf6d1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealth(Model): + """List of ApplicationGatewayBackendHealthPool resources. + + :param backend_address_pools: + :type backend_address_pools: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendHealthPool] + """ + + _attribute_map = { + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, + } + + def __init__(self, *, backend_address_pools=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = backend_address_pools diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_server.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_server.py index 1ad5b654c6b2..c90e3c8f62f4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_server.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_server.py @@ -32,8 +32,8 @@ class ApplicationGatewayBackendHealthServer(Model): 'health': {'key': 'health', 'type': 'str'}, } - def __init__(self, address=None, ip_configuration=None, health=None): - super(ApplicationGatewayBackendHealthServer, self).__init__() - self.address = address - self.ip_configuration = ip_configuration - self.health = health + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + self.ip_configuration = kwargs.get('ip_configuration', None) + self.health = kwargs.get('health', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_server_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_server_py3.py new file mode 100644 index 000000000000..4b992cfb298b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_health_server_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthServer(Model): + """Application gateway backendhealth http settings. + + :param address: IP address or FQDN of backend server. + :type address: str + :param ip_configuration: Reference of IP configuration of backend server. + :type ip_configuration: + ~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceIPConfiguration + :param health: Health of backend server. Possible values include: + 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + :type health: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendHealthServerHealth + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'health': {'key': 'health', 'type': 'str'}, + } + + def __init__(self, *, address: str=None, ip_configuration=None, health=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = address + self.ip_configuration = ip_configuration + self.health = health diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_http_settings.py index f99353acd6da..5a5692864d1b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_http_settings.py @@ -87,21 +87,21 @@ class ApplicationGatewayBackendHttpSettings(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, port=None, protocol=None, cookie_based_affinity=None, request_timeout=None, probe=None, authentication_certificates=None, connection_draining=None, host_name=None, pick_host_name_from_backend_address=None, affinity_cookie_name=None, probe_enabled=None, path=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id) - self.port = port - self.protocol = protocol - self.cookie_based_affinity = cookie_based_affinity - self.request_timeout = request_timeout - self.probe = probe - self.authentication_certificates = authentication_certificates - self.connection_draining = connection_draining - self.host_name = host_name - self.pick_host_name_from_backend_address = pick_host_name_from_backend_address - self.affinity_cookie_name = affinity_cookie_name - self.probe_enabled = probe_enabled - self.path = path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHttpSettings, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.protocol = kwargs.get('protocol', None) + self.cookie_based_affinity = kwargs.get('cookie_based_affinity', None) + self.request_timeout = kwargs.get('request_timeout', None) + self.probe = kwargs.get('probe', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.connection_draining = kwargs.get('connection_draining', None) + self.host_name = kwargs.get('host_name', None) + self.pick_host_name_from_backend_address = kwargs.get('pick_host_name_from_backend_address', None) + self.affinity_cookie_name = kwargs.get('affinity_cookie_name', None) + self.probe_enabled = kwargs.get('probe_enabled', None) + self.path = kwargs.get('path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_http_settings_py3.py new file mode 100644 index 000000000000..06805d721f60 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_http_settings_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendHttpSettings(SubResource): + """Backend address pool settings of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Port + :type port: int + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayProtocol + :param cookie_based_affinity: Cookie based affinity. Possible values + include: 'Enabled', 'Disabled' + :type cookie_based_affinity: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayCookieBasedAffinity + :param request_timeout: Request timeout in seconds. Application Gateway + will fail the request if response is not received within RequestTimeout. + Acceptable values are from 1 second to 86400 seconds. + :type request_timeout: int + :param probe: Probe resource of an application gateway. + :type probe: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param authentication_certificates: Array of references to application + gateway authentication certificates. + :type authentication_certificates: + list[~azure.mgmt.network.v2017_09_01.models.SubResource] + :param connection_draining: Connection draining of the backend http + settings resource. + :type connection_draining: + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayConnectionDraining + :param host_name: Host header to be sent to the backend servers. + :type host_name: str + :param pick_host_name_from_backend_address: Whether to pick host header + should be picked from the host name of the backend server. Default value + is false. + :type pick_host_name_from_backend_address: bool + :param affinity_cookie_name: Cookie name to use for the affinity cookie. + :type affinity_cookie_name: str + :param probe_enabled: Whether the probe is enabled. Default value is + false. + :type probe_enabled: bool + :param path: Path which should be used as a prefix for all HTTP requests. + Null means no path will be prefixed. Default value is null. + :type path: str + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, + 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, + 'connection_draining': {'key': 'properties.connectionDraining', 'type': 'ApplicationGatewayConnectionDraining'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'pick_host_name_from_backend_address': {'key': 'properties.pickHostNameFromBackendAddress', 'type': 'bool'}, + 'affinity_cookie_name': {'key': 'properties.affinityCookieName', 'type': 'str'}, + 'probe_enabled': {'key': 'properties.probeEnabled', 'type': 'bool'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, protocol=None, cookie_based_affinity=None, request_timeout: int=None, probe=None, authentication_certificates=None, connection_draining=None, host_name: str=None, pick_host_name_from_backend_address: bool=None, affinity_cookie_name: str=None, probe_enabled: bool=None, path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id, **kwargs) + self.port = port + self.protocol = protocol + self.cookie_based_affinity = cookie_based_affinity + self.request_timeout = request_timeout + self.probe = probe + self.authentication_certificates = authentication_certificates + self.connection_draining = connection_draining + self.host_name = host_name + self.pick_host_name_from_backend_address = pick_host_name_from_backend_address + self.affinity_cookie_name = affinity_cookie_name + self.probe_enabled = probe_enabled + self.path = path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_connection_draining.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_connection_draining.py index 8f9b88b571e2..531b3cb05dd3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_connection_draining.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_connection_draining.py @@ -17,10 +17,12 @@ class ApplicationGatewayConnectionDraining(Model): active for a specified time after the backend server got removed from the configuration. - :param enabled: Whether connection draining is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. :type enabled: bool - :param drain_timeout_in_sec: The number of seconds connection draining is - active. Acceptable values are from 1 second to 3600 seconds. + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. :type drain_timeout_in_sec: int """ @@ -34,7 +36,7 @@ class ApplicationGatewayConnectionDraining(Model): 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, } - def __init__(self, enabled, drain_timeout_in_sec): - super(ApplicationGatewayConnectionDraining, self).__init__() - self.enabled = enabled - self.drain_timeout_in_sec = drain_timeout_in_sec + def __init__(self, **kwargs): + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.drain_timeout_in_sec = kwargs.get('drain_timeout_in_sec', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_connection_draining_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_connection_draining_py3.py new file mode 100644 index 000000000000..c46fb01cae72 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_connection_draining_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayConnectionDraining(Model): + """Connection draining allows open connections to a backend server to be + active for a specified time after the backend server got removed from the + configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. + :type enabled: bool + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. + :type drain_timeout_in_sec: int + """ + + _validation = { + 'enabled': {'required': True}, + 'drain_timeout_in_sec': {'required': True, 'maximum': 3600, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool, drain_timeout_in_sec: int, **kwargs) -> None: + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = enabled + self.drain_timeout_in_sec = drain_timeout_in_sec diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_disabled_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_disabled_rule_group.py index 02c88980e857..085ae3d78c5c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_disabled_rule_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_disabled_rule_group.py @@ -15,7 +15,10 @@ class ApplicationGatewayFirewallDisabledRuleGroup(Model): """Allows to disable rules within a rule group or an entire rule group. - :param rule_group_name: The name of the rule group that will be disabled. + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. :type rule_group_name: str :param rules: The list of rules that will be disabled. If null, all rules of the rule group will be disabled. @@ -31,7 +34,7 @@ class ApplicationGatewayFirewallDisabledRuleGroup(Model): 'rules': {'key': 'rules', 'type': '[int]'}, } - def __init__(self, rule_group_name, rules=None): - super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__() - self.rule_group_name = rule_group_name - self.rules = rules + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_disabled_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_disabled_rule_group_py3.py new file mode 100644 index 000000000000..44ac696b801c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_disabled_rule_group_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallDisabledRuleGroup(Model): + """Allows to disable rules within a rule group or an entire rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. + :type rule_group_name: str + :param rules: The list of rules that will be disabled. If null, all rules + of the rule group will be disabled. + :type rules: list[int] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[int]'}, + } + + def __init__(self, *, rule_group_name: str, rules=None, **kwargs) -> None: + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule.py index f3f7da7cc11b..661b0d146e16 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule.py @@ -15,7 +15,10 @@ class ApplicationGatewayFirewallRule(Model): """A web application firewall rule. - :param rule_id: The identifier of the web application firewall rule. + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. :type rule_id: int :param description: The description of the web application firewall rule. :type description: str @@ -30,7 +33,7 @@ class ApplicationGatewayFirewallRule(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, rule_id, description=None): - super(ApplicationGatewayFirewallRule, self).__init__() - self.rule_id = rule_id - self.description = description + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_group.py index e9ff97e069ea..1e1872d49bd8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_group.py @@ -15,13 +15,16 @@ class ApplicationGatewayFirewallRuleGroup(Model): """A web application firewall rule group. - :param rule_group_name: The name of the web application firewall rule - group. + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. :type rule_group_name: str :param description: The description of the web application firewall rule group. :type description: str - :param rules: The rules of the web application firewall rule group. + :param rules: Required. The rules of the web application firewall rule + group. :type rules: list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayFirewallRule] """ @@ -37,8 +40,8 @@ class ApplicationGatewayFirewallRuleGroup(Model): 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, } - def __init__(self, rule_group_name, rules, description=None): - super(ApplicationGatewayFirewallRuleGroup, self).__init__() - self.rule_group_name = rule_group_name - self.description = description - self.rules = rules + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.description = kwargs.get('description', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_group_py3.py new file mode 100644 index 000000000000..42a4aa22119a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_group_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRuleGroup(Model): + """A web application firewall rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. + :type rule_group_name: str + :param description: The description of the web application firewall rule + group. + :type description: str + :param rules: Required. The rules of the web application firewall rule + group. + :type rules: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayFirewallRule] + """ + + _validation = { + 'rule_group_name': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, + } + + def __init__(self, *, rule_group_name: str, rules, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.description = description + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_py3.py new file mode 100644 index 000000000000..e332fbd16853 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRule(Model): + """A web application firewall rule. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. + :type rule_id: int + :param description: The description of the web application firewall rule. + :type description: str + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, rule_id: int, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = rule_id + self.description = description diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_set.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_set.py index 177275e3a400..51ac567e1814 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_set.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_set.py @@ -18,6 +18,8 @@ class ApplicationGatewayFirewallRuleSet(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -31,13 +33,14 @@ class ApplicationGatewayFirewallRuleSet(Resource): :param provisioning_state: The provisioning state of the web application firewall rule set. :type provisioning_state: str - :param rule_set_type: The type of the web application firewall rule set. + :param rule_set_type: Required. The type of the web application firewall + rule set. :type rule_set_type: str - :param rule_set_version: The version of the web application firewall rule - set type. + :param rule_set_version: Required. The version of the web application + firewall rule set type. :type rule_set_version: str - :param rule_groups: The rule groups of the web application firewall rule - set. + :param rule_groups: Required. The rule groups of the web application + firewall rule set. :type rule_groups: list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayFirewallRuleGroup] """ @@ -62,9 +65,9 @@ class ApplicationGatewayFirewallRuleSet(Resource): 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, } - def __init__(self, rule_set_type, rule_set_version, rule_groups, id=None, location=None, tags=None, provisioning_state=None): - super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags) - self.provisioning_state = provisioning_state - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.rule_groups = rule_groups + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleSet, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.rule_groups = kwargs.get('rule_groups', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_set_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_set_py3.py new file mode 100644 index 000000000000..a2f4f5b5efee --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_firewall_rule_set_py3.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayFirewallRuleSet(Resource): + """A web application firewall rule set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param provisioning_state: The provisioning state of the web application + firewall rule set. + :type provisioning_state: str + :param rule_set_type: Required. The type of the web application firewall + rule set. + :type rule_set_type: str + :param rule_set_version: Required. The version of the web application + firewall rule set type. + :type rule_set_version: str + :param rule_groups: Required. The rule groups of the web application + firewall rule set. + :type rule_groups: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayFirewallRuleGroup] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'rule_groups': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, + } + + def __init__(self, *, rule_set_type: str, rule_set_version: str, rule_groups, id: str=None, location: str=None, tags=None, provisioning_state: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.rule_groups = rule_groups diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_ip_configuration.py index de6b89de6926..91d83d248f30 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_ip_configuration.py @@ -54,13 +54,13 @@ class ApplicationGatewayFrontendIPConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..187c7fbfba47 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_ip_configuration_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): + """Frontend IP configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param private_ip_address: PrivateIPAddress of the network interface IP + Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: PrivateIP allocation method. Possible + values include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_09_01.models.IPAllocationMethod + :param subnet: Reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param provisioning_state: Provisioning state of the public IP resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_port.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_port.py index 2b1b32d1b79e..318c0554db0a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_port.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_port.py @@ -41,10 +41,10 @@ class ApplicationGatewayFrontendPort(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, port=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayFrontendPort, self).__init__(id=id) - self.port = port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendPort, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_port_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_port_py3.py new file mode 100644 index 000000000000..03c6c0a31e9c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_frontend_port_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Frontend port + :type port: int + :param provisioning_state: Provisioning state of the frontend port + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendPort, self).__init__(id=id, **kwargs) + self.port = port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_http_listener.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_http_listener.py index 2dd92c80826f..96083ffbbc5d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_http_listener.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_http_listener.py @@ -61,15 +61,15 @@ class ApplicationGatewayHttpListener(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name=None, ssl_certificate=None, require_server_name_indication=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayHttpListener, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.frontend_port = frontend_port - self.protocol = protocol - self.host_name = host_name - self.ssl_certificate = ssl_certificate - self.require_server_name_indication = require_server_name_indication - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayHttpListener, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.protocol = kwargs.get('protocol', None) + self.host_name = kwargs.get('host_name', None) + self.ssl_certificate = kwargs.get('ssl_certificate', None) + self.require_server_name_indication = kwargs.get('require_server_name_indication', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_http_listener_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_http_listener_py3.py new file mode 100644 index 000000000000..7f7af7a0592b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_http_listener_py3.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayHttpListener(SubResource): + """Http listener of an application gateway. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: Frontend IP configuration resource of an + application gateway. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayProtocol + :param host_name: Host name of HTTP listener. + :type host_name: str + :param ssl_certificate: SSL certificate resource of an application + gateway. + :type ssl_certificate: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param require_server_name_indication: Applicable only if protocol is + https. Enables SNI for multi-hosting. + :type require_server_name_indication: bool + :param provisioning_state: Provisioning state of the HTTP listener + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, + 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name: str=None, ssl_certificate=None, require_server_name_indication: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayHttpListener, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.frontend_port = frontend_port + self.protocol = protocol + self.host_name = host_name + self.ssl_certificate = ssl_certificate + self.require_server_name_indication = require_server_name_indication + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ip_configuration.py index b6f50e5d361d..f5b46e1a00b5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ip_configuration.py @@ -44,10 +44,10 @@ class ApplicationGatewayIPConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, subnet=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayIPConfiguration, self).__init__(id=id) - self.subnet = subnet - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayIPConfiguration, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..aeacbf3f68a7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ip_configuration_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 + private IP configuration is allowed. + + :param id: Resource ID. + :type id: str + :param subnet: Reference of the subnet resource. A subnet from where + application gateway gets its private address. + :type subnet: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param provisioning_state: Provisioning state of the application gateway + subnet resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, subnet=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.subnet = subnet + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_path_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_path_rule.py index ed70b680ae2c..c98db70547bc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_path_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_path_rule.py @@ -56,13 +56,13 @@ class ApplicationGatewayPathRule(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, paths=None, backend_address_pool=None, backend_http_settings=None, redirect_configuration=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayPathRule, self).__init__(id=id) - self.paths = paths - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.redirect_configuration = redirect_configuration - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayPathRule, self).__init__(**kwargs) + self.paths = kwargs.get('paths', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_path_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_path_rule_py3.py new file mode 100644 index 000000000000..2cfc26f7da13 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_path_rule_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayPathRule(SubResource): + """Path rule of URL path map of an application gateway. + + :param id: Resource ID. + :type id: str + :param paths: Path rules of URL path map. + :type paths: list[str] + :param backend_address_pool: Backend address pool resource of URL path map + path rule. + :type backend_address_pool: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param backend_http_settings: Backend http settings resource of URL path + map path rule. + :type backend_http_settings: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of URL path + map path rule. + :type redirect_configuration: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param provisioning_state: Path rule of URL path map resource. Possible + values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'paths': {'key': 'properties.paths', 'type': '[str]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, paths=None, backend_address_pool=None, backend_http_settings=None, redirect_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayPathRule, self).__init__(id=id, **kwargs) + self.paths = paths + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.redirect_configuration = redirect_configuration + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe.py index 5f26a572294f..5f490d709ce6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe.py @@ -76,18 +76,18 @@ class ApplicationGatewayProbe(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, protocol=None, host=None, path=None, interval=None, timeout=None, unhealthy_threshold=None, pick_host_name_from_backend_http_settings=None, min_servers=None, match=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayProbe, self).__init__(id=id) - self.protocol = protocol - self.host = host - self.path = path - self.interval = interval - self.timeout = timeout - self.unhealthy_threshold = unhealthy_threshold - self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings - self.min_servers = min_servers - self.match = match - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayProbe, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.host = kwargs.get('host', None) + self.path = kwargs.get('path', None) + self.interval = kwargs.get('interval', None) + self.timeout = kwargs.get('timeout', None) + self.unhealthy_threshold = kwargs.get('unhealthy_threshold', None) + self.pick_host_name_from_backend_http_settings = kwargs.get('pick_host_name_from_backend_http_settings', None) + self.min_servers = kwargs.get('min_servers', None) + self.match = kwargs.get('match', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe_health_response_match.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe_health_response_match.py index beaef556eb99..b439b9677f8b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe_health_response_match.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe_health_response_match.py @@ -28,7 +28,7 @@ class ApplicationGatewayProbeHealthResponseMatch(Model): 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, } - def __init__(self, body=None, status_codes=None): - super(ApplicationGatewayProbeHealthResponseMatch, self).__init__() - self.body = body - self.status_codes = status_codes + def __init__(self, **kwargs): + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = kwargs.get('body', None) + self.status_codes = kwargs.get('status_codes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe_health_response_match_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe_health_response_match_py3.py new file mode 100644 index 000000000000..6ed2ee8c04ed --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe_health_response_match_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayProbeHealthResponseMatch(Model): + """Application gateway probe health response match. + + :param body: Body that must be contained in the health response. Default + value is empty. + :type body: str + :param status_codes: Allowed ranges of healthy status codes. Default range + of healthy status codes is 200-399. + :type status_codes: list[str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'str'}, + 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, + } + + def __init__(self, *, body: str=None, status_codes=None, **kwargs) -> None: + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = body + self.status_codes = status_codes diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe_py3.py new file mode 100644 index 000000000000..8b2f64a4d329 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayProbe(SubResource): + """Probe of the application gateway. + + :param id: Resource ID. + :type id: str + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is + sent to ://: + :type path: str + :param interval: The probing interval in seconds. This is the time + interval between two consecutive probes. Acceptable values are from 1 + second to 86400 seconds. + :type interval: int + :param timeout: the probe timeout in seconds. Probe marked as failed if + valid response is not received with this timeout period. Acceptable values + are from 1 second to 86400 seconds. + :type timeout: int + :param unhealthy_threshold: The probe retry count. Backend server is + marked down after consecutive probe failure count reaches + UnhealthyThreshold. Acceptable values are from 1 second to 20. + :type unhealthy_threshold: int + :param pick_host_name_from_backend_http_settings: Whether the host header + should be picked from the backend http settings. Default value is false. + :type pick_host_name_from_backend_http_settings: bool + :param min_servers: Minimum number of servers that are always marked + healthy. Default value is 0. + :type min_servers: int + :param match: Criterion for classifying a healthy probe response. + :type match: + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayProbeHealthResponseMatch + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host': {'key': 'properties.host', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, + 'pick_host_name_from_backend_http_settings': {'key': 'properties.pickHostNameFromBackendHttpSettings', 'type': 'bool'}, + 'min_servers': {'key': 'properties.minServers', 'type': 'int'}, + 'match': {'key': 'properties.match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, protocol=None, host: str=None, path: str=None, interval: int=None, timeout: int=None, unhealthy_threshold: int=None, pick_host_name_from_backend_http_settings: bool=None, min_servers: int=None, match=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayProbe, self).__init__(id=id, **kwargs) + self.protocol = protocol + self.host = host + self.path = path + self.interval = interval + self.timeout = timeout + self.unhealthy_threshold = unhealthy_threshold + self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings + self.min_servers = min_servers + self.match = match + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_py3.py new file mode 100644 index 000000000000..6fa599782c1f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_py3.py @@ -0,0 +1,153 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGateway(Resource): + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslPolicy + :ivar operational_state: Operational state of the application gateway + resource. Possible values include: 'Stopped', 'Starting', 'Running', + 'Stopping' + :vartype operational_state: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayOperationalState + :param gateway_ip_configurations: Subnets of application the gateway + resource. + :type gateway_ip_configurations: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayIPConfiguration] + :param authentication_certificates: Authentication certificates of the + application gateway resource. + :type authentication_certificates: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayAuthenticationCertificate] + :param ssl_certificates: SSL certificates of the application gateway + resource. + :type ssl_certificates: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslCertificate] + :param frontend_ip_configurations: Frontend IP addresses of the + application gateway resource. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayFrontendIPConfiguration] + :param frontend_ports: Frontend ports of the application gateway resource. + :type frontend_ports: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayProbe] + :param backend_address_pools: Backend address pool of the application + gateway resource. + :type backend_address_pools: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendAddressPool] + :param backend_http_settings_collection: Backend http settings of the + application gateway resource. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendHttpSettings] + :param http_listeners: Http listeners of the application gateway resource. + :type http_listeners: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayHttpListener] + :param url_path_maps: URL path map of the application gateway resource. + :type url_path_maps: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application + gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayRequestRoutingRule] + :param redirect_configurations: Redirect configurations of the application + gateway resource. + :type redirect_configurations: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayRedirectConfiguration] + :param web_application_firewall_configuration: Web application firewall + configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param resource_guid: Resource GUID property of the application gateway + resource. + :type resource_guid: str + :param provisioning_state: Provisioning state of the application gateway + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operational_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, + 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, + 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, + 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, + 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, + 'redirect_configurations': {'key': 'properties.redirectConfigurations', 'type': '[ApplicationGatewayRedirectConfiguration]'}, + 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, redirect_configurations=None, web_application_firewall_configuration=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.ssl_policy = ssl_policy + self.operational_state = None + self.gateway_ip_configurations = gateway_ip_configurations + self.authentication_certificates = authentication_certificates + self.ssl_certificates = ssl_certificates + self.frontend_ip_configurations = frontend_ip_configurations + self.frontend_ports = frontend_ports + self.probes = probes + self.backend_address_pools = backend_address_pools + self.backend_http_settings_collection = backend_http_settings_collection + self.http_listeners = http_listeners + self.url_path_maps = url_path_maps + self.request_routing_rules = request_routing_rules + self.redirect_configurations = redirect_configurations + self.web_application_firewall_configuration = web_application_firewall_configuration + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_redirect_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_redirect_configuration.py index 3e2e5c2f96a0..7b6223cce85a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_redirect_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_redirect_configuration.py @@ -66,16 +66,16 @@ class ApplicationGatewayRedirectConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, redirect_type=None, target_listener=None, target_url=None, include_path=None, include_query_string=None, request_routing_rules=None, url_path_maps=None, path_rules=None, name=None, etag=None, type=None): - super(ApplicationGatewayRedirectConfiguration, self).__init__(id=id) - self.redirect_type = redirect_type - self.target_listener = target_listener - self.target_url = target_url - self.include_path = include_path - self.include_query_string = include_query_string - self.request_routing_rules = request_routing_rules - self.url_path_maps = url_path_maps - self.path_rules = path_rules - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayRedirectConfiguration, self).__init__(**kwargs) + self.redirect_type = kwargs.get('redirect_type', None) + self.target_listener = kwargs.get('target_listener', None) + self.target_url = kwargs.get('target_url', None) + self.include_path = kwargs.get('include_path', None) + self.include_query_string = kwargs.get('include_query_string', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.path_rules = kwargs.get('path_rules', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_redirect_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_redirect_configuration_py3.py new file mode 100644 index 000000000000..3af203bf4222 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_redirect_configuration_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRedirectConfiguration(SubResource): + """Redirect configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param redirect_type: Supported http redirection types - Permanent, + Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', + 'SeeOther', 'Temporary' + :type redirect_type: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayRedirectType + :param target_listener: Reference to a listener to redirect the request + to. + :type target_listener: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param target_url: Url to redirect the request to. + :type target_url: str + :param include_path: Include path in the redirected url. + :type include_path: bool + :param include_query_string: Include query string in the redirected url. + :type include_query_string: bool + :param request_routing_rules: Request routing specifying redirect + configuration. + :type request_routing_rules: + list[~azure.mgmt.network.v2017_09_01.models.SubResource] + :param url_path_maps: Url path maps specifying default redirect + configuration. + :type url_path_maps: + list[~azure.mgmt.network.v2017_09_01.models.SubResource] + :param path_rules: Path rules specifying redirect configuration. + :type path_rules: list[~azure.mgmt.network.v2017_09_01.models.SubResource] + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'redirect_type': {'key': 'properties.redirectType', 'type': 'str'}, + 'target_listener': {'key': 'properties.targetListener', 'type': 'SubResource'}, + 'target_url': {'key': 'properties.targetUrl', 'type': 'str'}, + 'include_path': {'key': 'properties.includePath', 'type': 'bool'}, + 'include_query_string': {'key': 'properties.includeQueryString', 'type': 'bool'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[SubResource]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[SubResource]'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[SubResource]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, redirect_type=None, target_listener=None, target_url: str=None, include_path: bool=None, include_query_string: bool=None, request_routing_rules=None, url_path_maps=None, path_rules=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayRedirectConfiguration, self).__init__(id=id, **kwargs) + self.redirect_type = redirect_type + self.target_listener = target_listener + self.target_url = target_url + self.include_path = include_path + self.include_query_string = include_query_string + self.request_routing_rules = request_routing_rules + self.url_path_maps = url_path_maps + self.path_rules = path_rules + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_request_routing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_request_routing_rule.py index 8f159c21f3a8..865fc3614d51 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_request_routing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_request_routing_rule.py @@ -64,15 +64,15 @@ class ApplicationGatewayRequestRoutingRule(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, redirect_configuration=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id) - self.rule_type = rule_type - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.http_listener = http_listener - self.url_path_map = url_path_map - self.redirect_configuration = redirect_configuration - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayRequestRoutingRule, self).__init__(**kwargs) + self.rule_type = kwargs.get('rule_type', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.http_listener = kwargs.get('http_listener', None) + self.url_path_map = kwargs.get('url_path_map', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_request_routing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_request_routing_rule_py3.py new file mode 100644 index 000000000000..418e12151485 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_request_routing_rule_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRequestRoutingRule(SubResource): + """Request routing rule of an application gateway. + + :param id: Resource ID. + :type id: str + :param rule_type: Rule type. Possible values include: 'Basic', + 'PathBasedRouting' + :type rule_type: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayRequestRoutingRuleType + :param backend_address_pool: Backend address pool resource of the + application gateway. + :type backend_address_pool: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param backend_http_settings: Frontend port resource of the application + gateway. + :type backend_http_settings: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of the + application gateway. + :type redirect_configuration: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param provisioning_state: Provisioning state of the request routing rule + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, + 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, redirect_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id, **kwargs) + self.rule_type = rule_type + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.http_listener = http_listener + self.url_path_map = url_path_map + self.redirect_configuration = redirect_configuration + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_sku.py index c3e40e10155c..b762927f97a0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_sku.py @@ -34,8 +34,8 @@ class ApplicationGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(ApplicationGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_sku_py3.py new file mode 100644 index 000000000000..f0096c1296f1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_sku_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySku(Model): + """SKU of an application gateway. + + :param name: Name of an application gateway SKU. Possible values include: + 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', + 'WAF_Large' + :type name: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySkuName + :param tier: Tier of an application gateway. Possible values include: + 'Standard', 'WAF' + :type tier: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayTier + :param capacity: Capacity (instance count) of an application gateway. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_certificate.py index 104629e84a5c..1dfedd4908df 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_certificate.py @@ -50,12 +50,12 @@ class ApplicationGatewaySslCertificate(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, data=None, password=None, public_cert_data=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewaySslCertificate, self).__init__(id=id) - self.data = data - self.password = password - self.public_cert_data = public_cert_data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewaySslCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.password = kwargs.get('password', None) + self.public_cert_data = kwargs.get('public_cert_data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_certificate_py3.py new file mode 100644 index 000000000000..ddb6745c9005 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_certificate_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Base-64 encoded pfx certificate. Only applicable in PUT + Request. + :type data: str + :param password: Password for the pfx file specified in data. Only + applicable in PUT request. + :type password: str + :param public_cert_data: Base-64 encoded Public cert data corresponding to + pfx specified in data. Only applicable in GET request. + :type public_cert_data: str + :param provisioning_state: Provisioning state of the SSL certificate + resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, password: str=None, public_cert_data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewaySslCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.password = password + self.public_cert_data = public_cert_data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_policy.py index d823a25c4b8b..06bf7ace735f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_policy.py @@ -47,10 +47,10 @@ class ApplicationGatewaySslPolicy(Model): 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, } - def __init__(self, disabled_ssl_protocols=None, policy_type=None, policy_name=None, cipher_suites=None, min_protocol_version=None): - super(ApplicationGatewaySslPolicy, self).__init__() - self.disabled_ssl_protocols = disabled_ssl_protocols - self.policy_type = policy_type - self.policy_name = policy_name - self.cipher_suites = cipher_suites - self.min_protocol_version = min_protocol_version + def __init__(self, **kwargs): + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = kwargs.get('disabled_ssl_protocols', None) + self.policy_type = kwargs.get('policy_type', None) + self.policy_name = kwargs.get('policy_name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_policy_py3.py new file mode 100644 index 000000000000..62f1c0af3eda --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_policy_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySslPolicy(Model): + """Application Gateway Ssl policy. + + :param disabled_ssl_protocols: Ssl protocols to be disabled on application + gateway. + :type disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslProtocol] + :param policy_type: Type of Ssl Policy. Possible values include: + 'Predefined', 'Custom' + :type policy_type: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslPolicyType + :param policy_name: Name of Ssl predefined policy. Possible values + include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type policy_name: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslPolicyName + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order to application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, + 'policy_type': {'key': 'policyType', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'cipher_suites': {'key': 'cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, *, disabled_ssl_protocols=None, policy_type=None, policy_name=None, cipher_suites=None, min_protocol_version=None, **kwargs) -> None: + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = disabled_ssl_protocols + self.policy_type = policy_type + self.policy_name = policy_name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_predefined_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_predefined_policy.py index 7c2465625c60..1f7c571ff58e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_predefined_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_predefined_policy.py @@ -37,8 +37,8 @@ class ApplicationGatewaySslPredefinedPolicy(SubResource): 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, } - def __init__(self, id=None, name=None, cipher_suites=None, min_protocol_version=None): - super(ApplicationGatewaySslPredefinedPolicy, self).__init__(id=id) - self.name = name - self.cipher_suites = cipher_suites - self.min_protocol_version = min_protocol_version + def __init__(self, **kwargs): + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_predefined_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_predefined_policy_py3.py new file mode 100644 index 000000000000..3a7eca6a7b00 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_ssl_predefined_policy_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslPredefinedPolicy(SubResource): + """An Ssl predefined policy. + + :param id: Resource ID. + :type id: str + :param name: Name of Ssl predefined policy. + :type name: str + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order for application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, cipher_suites=None, min_protocol_version=None, **kwargs) -> None: + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(id=id, **kwargs) + self.name = name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_url_path_map.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_url_path_map.py index d856412fccb3..4ea88e862358 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_url_path_map.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_url_path_map.py @@ -58,13 +58,13 @@ class ApplicationGatewayUrlPathMap(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, default_backend_address_pool=None, default_backend_http_settings=None, default_redirect_configuration=None, path_rules=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayUrlPathMap, self).__init__(id=id) - self.default_backend_address_pool = default_backend_address_pool - self.default_backend_http_settings = default_backend_http_settings - self.default_redirect_configuration = default_redirect_configuration - self.path_rules = path_rules - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayUrlPathMap, self).__init__(**kwargs) + self.default_backend_address_pool = kwargs.get('default_backend_address_pool', None) + self.default_backend_http_settings = kwargs.get('default_backend_http_settings', None) + self.default_redirect_configuration = kwargs.get('default_redirect_configuration', None) + self.path_rules = kwargs.get('path_rules', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_url_path_map_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_url_path_map_py3.py new file mode 100644 index 000000000000..a49be9736c42 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_url_path_map_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayUrlPathMap(SubResource): + """UrlPathMaps give a url path to the backend mapping information for + PathBasedRouting. + + :param id: Resource ID. + :type id: str + :param default_backend_address_pool: Default backend address pool resource + of URL path map. + :type default_backend_address_pool: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param default_backend_http_settings: Default backend http settings + resource of URL path map. + :type default_backend_http_settings: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param default_redirect_configuration: Default redirect configuration + resource of URL path map. + :type default_redirect_configuration: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayPathRule] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, + 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, + 'default_redirect_configuration': {'key': 'properties.defaultRedirectConfiguration', 'type': 'SubResource'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, default_backend_address_pool=None, default_backend_http_settings=None, default_redirect_configuration=None, path_rules=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayUrlPathMap, self).__init__(id=id, **kwargs) + self.default_backend_address_pool = default_backend_address_pool + self.default_backend_http_settings = default_backend_http_settings + self.default_redirect_configuration = default_redirect_configuration + self.path_rules = path_rules + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_web_application_firewall_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_web_application_firewall_configuration.py index fb125a903d76..a652fae7ae72 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_web_application_firewall_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_web_application_firewall_configuration.py @@ -15,16 +15,19 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): """Application gateway web application firewall configuration. - :param enabled: Whether the web application firewall is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. :type enabled: bool - :param firewall_mode: Web application firewall mode. Possible values - include: 'Detection', 'Prevention' + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' :type firewall_mode: str or ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayFirewallMode - :param rule_set_type: The type of the web application firewall rule set. - Possible values are: 'OWASP'. + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. :type rule_set_type: str - :param rule_set_version: The version of the rule set type. + :param rule_set_version: Required. The version of the rule set type. :type rule_set_version: str :param disabled_rule_groups: The disabled rule groups. :type disabled_rule_groups: @@ -46,10 +49,10 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, } - def __init__(self, enabled, firewall_mode, rule_set_type, rule_set_version, disabled_rule_groups=None): - super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__() - self.enabled = enabled - self.firewall_mode = firewall_mode - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.disabled_rule_groups = disabled_rule_groups + def __init__(self, **kwargs): + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.firewall_mode = kwargs.get('firewall_mode', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.disabled_rule_groups = kwargs.get('disabled_rule_groups', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_web_application_firewall_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_web_application_firewall_configuration_py3.py new file mode 100644 index 000000000000..2774aea4b81f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_web_application_firewall_configuration_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayWebApplicationFirewallConfiguration(Model): + """Application gateway web application firewall configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. + :type enabled: bool + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' + :type firewall_mode: str or + ~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayFirewallMode + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. + :type rule_set_type: str + :param rule_set_version: Required. The version of the rule set type. + :type rule_set_version: str + :param disabled_rule_groups: The disabled rule groups. + :type disabled_rule_groups: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayFirewallDisabledRuleGroup] + """ + + _validation = { + 'enabled': {'required': True}, + 'firewall_mode': {'required': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, + } + + def __init__(self, *, enabled: bool, firewall_mode, rule_set_type: str, rule_set_version: str, disabled_rule_groups=None, **kwargs) -> None: + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = enabled + self.firewall_mode = firewall_mode + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.disabled_rule_groups = disabled_rule_groups diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_security_group.py index 302abc528319..1372f778ae62 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_security_group.py @@ -61,8 +61,8 @@ class ApplicationSecurityGroup(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None): - super(ApplicationSecurityGroup, self).__init__(id=id, location=location, tags=tags) + def __init__(self, **kwargs): + super(ApplicationSecurityGroup, self).__init__(**kwargs) self.resource_guid = None self.provisioning_state = None self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_security_group_py3.py new file mode 100644 index 000000000000..f14f84e29b86 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_security_group_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationSecurityGroup(Resource): + """An application security group in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar resource_guid: The resource GUID property of the application + security group resource. It uniquely identifies a resource, even if the + user changes its name or migrate the resource across subscriptions or + resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the application + security group resource. Possible values are: 'Succeeded', 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(ApplicationSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.resource_guid = None + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/availability.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/availability.py index c45356ed4847..16b7cfa04955 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/availability.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/availability.py @@ -29,8 +29,8 @@ class Availability(Model): 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, } - def __init__(self, time_grain=None, retention=None, blob_duration=None): - super(Availability, self).__init__() - self.time_grain = time_grain - self.retention = retention - self.blob_duration = blob_duration + def __init__(self, **kwargs): + super(Availability, self).__init__(**kwargs) + self.time_grain = kwargs.get('time_grain', None) + self.retention = kwargs.get('retention', None) + self.blob_duration = kwargs.get('blob_duration', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/availability_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/availability_py3.py new file mode 100644 index 000000000000..874d8878184f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/availability_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Availability(Model): + """Availability of the metric. + + :param time_grain: The time grain of the availability. + :type time_grain: str + :param retention: The retention of the availability. + :type retention: str + :param blob_duration: Duration of the availability blob. + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, time_grain: str=None, retention: str=None, blob_duration: str=None, **kwargs) -> None: + super(Availability, self).__init__(**kwargs) + self.time_grain = time_grain + self.retention = retention + self.blob_duration = blob_duration diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list.py index 4b616286885e..c24396af5e86 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list.py @@ -15,7 +15,9 @@ class AvailableProvidersList(Model): """List of available countries with details. - :param countries: List of available countries. + All required parameters must be populated in order to send to Azure. + + :param countries: Required. List of available countries. :type countries: list[~azure.mgmt.network.v2017_09_01.models.AvailableProvidersListCountry] """ @@ -28,6 +30,6 @@ class AvailableProvidersList(Model): 'countries': {'key': 'countries', 'type': '[AvailableProvidersListCountry]'}, } - def __init__(self, countries): - super(AvailableProvidersList, self).__init__() - self.countries = countries + def __init__(self, **kwargs): + super(AvailableProvidersList, self).__init__(**kwargs) + self.countries = kwargs.get('countries', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_city.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_city.py index cfd9fa55e297..5f9aa271b981 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_city.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_city.py @@ -26,7 +26,7 @@ class AvailableProvidersListCity(Model): 'providers': {'key': 'providers', 'type': '[str]'}, } - def __init__(self, city_name=None, providers=None): - super(AvailableProvidersListCity, self).__init__() - self.city_name = city_name - self.providers = providers + def __init__(self, **kwargs): + super(AvailableProvidersListCity, self).__init__(**kwargs) + self.city_name = kwargs.get('city_name', None) + self.providers = kwargs.get('providers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_city_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_city_py3.py new file mode 100644 index 000000000000..888aa46a7cfc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_city_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListCity(Model): + """City or town details. + + :param city_name: The city or town name. + :type city_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + """ + + _attribute_map = { + 'city_name': {'key': 'cityName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + } + + def __init__(self, *, city_name: str=None, providers=None, **kwargs) -> None: + super(AvailableProvidersListCity, self).__init__(**kwargs) + self.city_name = city_name + self.providers = providers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_country.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_country.py index f5652ff427a9..6a585f4e7621 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_country.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_country.py @@ -30,8 +30,8 @@ class AvailableProvidersListCountry(Model): 'states': {'key': 'states', 'type': '[AvailableProvidersListState]'}, } - def __init__(self, country_name=None, providers=None, states=None): - super(AvailableProvidersListCountry, self).__init__() - self.country_name = country_name - self.providers = providers - self.states = states + def __init__(self, **kwargs): + super(AvailableProvidersListCountry, self).__init__(**kwargs) + self.country_name = kwargs.get('country_name', None) + self.providers = kwargs.get('providers', None) + self.states = kwargs.get('states', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_country_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_country_py3.py new file mode 100644 index 000000000000..9116e65afec3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_country_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListCountry(Model): + """Country details. + + :param country_name: The country name. + :type country_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param states: List of available states in the country. + :type states: + list[~azure.mgmt.network.v2017_09_01.models.AvailableProvidersListState] + """ + + _attribute_map = { + 'country_name': {'key': 'countryName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'states': {'key': 'states', 'type': '[AvailableProvidersListState]'}, + } + + def __init__(self, *, country_name: str=None, providers=None, states=None, **kwargs) -> None: + super(AvailableProvidersListCountry, self).__init__(**kwargs) + self.country_name = country_name + self.providers = providers + self.states = states diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_parameters.py index 4eb335e056b6..152b3b787c2b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_parameters.py @@ -33,9 +33,9 @@ class AvailableProvidersListParameters(Model): 'city': {'key': 'city', 'type': 'str'}, } - def __init__(self, azure_locations=None, country=None, state=None, city=None): - super(AvailableProvidersListParameters, self).__init__() - self.azure_locations = azure_locations - self.country = country - self.state = state - self.city = city + def __init__(self, **kwargs): + super(AvailableProvidersListParameters, self).__init__(**kwargs) + self.azure_locations = kwargs.get('azure_locations', None) + self.country = kwargs.get('country', None) + self.state = kwargs.get('state', None) + self.city = kwargs.get('city', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_parameters_py3.py new file mode 100644 index 000000000000..d5c541a7fcb6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_parameters_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListParameters(Model): + """Constraints that determine the list of available Internet service + providers. + + :param azure_locations: A list of Azure regions. + :type azure_locations: list[str] + :param country: The country for available providers list. + :type country: str + :param state: The state for available providers list. + :type state: str + :param city: The city or town for available providers list. + :type city: str + """ + + _attribute_map = { + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__(self, *, azure_locations=None, country: str=None, state: str=None, city: str=None, **kwargs) -> None: + super(AvailableProvidersListParameters, self).__init__(**kwargs) + self.azure_locations = azure_locations + self.country = country + self.state = state + self.city = city diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_py3.py new file mode 100644 index 000000000000..be3c5377101d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersList(Model): + """List of available countries with details. + + All required parameters must be populated in order to send to Azure. + + :param countries: Required. List of available countries. + :type countries: + list[~azure.mgmt.network.v2017_09_01.models.AvailableProvidersListCountry] + """ + + _validation = { + 'countries': {'required': True}, + } + + _attribute_map = { + 'countries': {'key': 'countries', 'type': '[AvailableProvidersListCountry]'}, + } + + def __init__(self, *, countries, **kwargs) -> None: + super(AvailableProvidersList, self).__init__(**kwargs) + self.countries = countries diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_state.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_state.py index f956b545b19b..0151377b4f63 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_state.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_state.py @@ -30,8 +30,8 @@ class AvailableProvidersListState(Model): 'cities': {'key': 'cities', 'type': '[AvailableProvidersListCity]'}, } - def __init__(self, state_name=None, providers=None, cities=None): - super(AvailableProvidersListState, self).__init__() - self.state_name = state_name - self.providers = providers - self.cities = cities + def __init__(self, **kwargs): + super(AvailableProvidersListState, self).__init__(**kwargs) + self.state_name = kwargs.get('state_name', None) + self.providers = kwargs.get('providers', None) + self.cities = kwargs.get('cities', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_state_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_state_py3.py new file mode 100644 index 000000000000..e5cec4047e45 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/available_providers_list_state_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListState(Model): + """State details. + + :param state_name: The state name. + :type state_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param cities: List of available cities or towns in the state. + :type cities: + list[~azure.mgmt.network.v2017_09_01.models.AvailableProvidersListCity] + """ + + _attribute_map = { + 'state_name': {'key': 'stateName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'cities': {'key': 'cities', 'type': '[AvailableProvidersListCity]'}, + } + + def __init__(self, *, state_name: str=None, providers=None, cities=None, **kwargs) -> None: + super(AvailableProvidersListState, self).__init__(**kwargs) + self.state_name = state_name + self.providers = providers + self.cities = cities diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_async_operation_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_async_operation_result.py index 77ed5c1aef8a..15fd977345a7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_async_operation_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_async_operation_result.py @@ -36,7 +36,7 @@ class AzureAsyncOperationResult(Model): 'error': {'key': 'error', 'type': 'Error'}, } - def __init__(self, status=None, error=None): - super(AzureAsyncOperationResult, self).__init__() - self.status = status - self.error = error + def __init__(self, **kwargs): + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_async_operation_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_async_operation_result_py3.py new file mode 100644 index 000000000000..440e0a49e203 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_async_operation_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureAsyncOperationResult(Model): + """The response body contains the status of the specified asynchronous + operation, indicating whether it has succeeded, is in progress, or has + failed. Note that this status is distinct from the HTTP status code + returned for the Get Operation Status operation itself. If the asynchronous + operation succeeded, the response body includes the HTTP status code for + the successful request. If the asynchronous operation failed, the response + body includes the HTTP status code for the failed request and error + information regarding the failure. + + :param status: Status of the Azure async operation. Possible values are: + 'InProgress', 'Succeeded', and 'Failed'. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or + ~azure.mgmt.network.v2017_09_01.models.NetworkOperationStatus + :param error: + :type error: ~azure.mgmt.network.v2017_09_01.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, status=None, error=None, **kwargs) -> None: + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report.py index 20e5fce5f1b4..015e43e7d506 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report.py @@ -15,13 +15,16 @@ class AzureReachabilityReport(Model): """Azure reachability report details. - :param aggregation_level: The aggregation level of Azure reachability - report. Can be Country, State or City. + All required parameters must be populated in order to send to Azure. + + :param aggregation_level: Required. The aggregation level of Azure + reachability report. Can be Country, State or City. :type aggregation_level: str - :param provider_location: + :param provider_location: Required. :type provider_location: ~azure.mgmt.network.v2017_09_01.models.AzureReachabilityReportLocation - :param reachability_report: List of Azure reachability report items. + :param reachability_report: Required. List of Azure reachability report + items. :type reachability_report: list[~azure.mgmt.network.v2017_09_01.models.AzureReachabilityReportItem] """ @@ -38,8 +41,8 @@ class AzureReachabilityReport(Model): 'reachability_report': {'key': 'reachabilityReport', 'type': '[AzureReachabilityReportItem]'}, } - def __init__(self, aggregation_level, provider_location, reachability_report): - super(AzureReachabilityReport, self).__init__() - self.aggregation_level = aggregation_level - self.provider_location = provider_location - self.reachability_report = reachability_report + def __init__(self, **kwargs): + super(AzureReachabilityReport, self).__init__(**kwargs) + self.aggregation_level = kwargs.get('aggregation_level', None) + self.provider_location = kwargs.get('provider_location', None) + self.reachability_report = kwargs.get('reachability_report', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_item.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_item.py index c87d4b22cd3b..74896655b874 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_item.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_item.py @@ -30,8 +30,8 @@ class AzureReachabilityReportItem(Model): 'latencies': {'key': 'latencies', 'type': '[AzureReachabilityReportLatencyInfo]'}, } - def __init__(self, provider=None, azure_location=None, latencies=None): - super(AzureReachabilityReportItem, self).__init__() - self.provider = provider - self.azure_location = azure_location - self.latencies = latencies + def __init__(self, **kwargs): + super(AzureReachabilityReportItem, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.azure_location = kwargs.get('azure_location', None) + self.latencies = kwargs.get('latencies', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_item_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_item_py3.py new file mode 100644 index 000000000000..5c3e886f477f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_item_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportItem(Model): + """Azure reachability report details for a given provider location. + + :param provider: The Internet service provider. + :type provider: str + :param azure_location: The Azure region. + :type azure_location: str + :param latencies: List of latency details for each of the time series. + :type latencies: + list[~azure.mgmt.network.v2017_09_01.models.AzureReachabilityReportLatencyInfo] + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'azure_location': {'key': 'azureLocation', 'type': 'str'}, + 'latencies': {'key': 'latencies', 'type': '[AzureReachabilityReportLatencyInfo]'}, + } + + def __init__(self, *, provider: str=None, azure_location: str=None, latencies=None, **kwargs) -> None: + super(AzureReachabilityReportItem, self).__init__(**kwargs) + self.provider = provider + self.azure_location = azure_location + self.latencies = latencies diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_latency_info.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_latency_info.py index c4920ffb64be..e5f77641a138 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_latency_info.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_latency_info.py @@ -31,7 +31,7 @@ class AzureReachabilityReportLatencyInfo(Model): 'score': {'key': 'score', 'type': 'int'}, } - def __init__(self, time_stamp=None, score=None): - super(AzureReachabilityReportLatencyInfo, self).__init__() - self.time_stamp = time_stamp - self.score = score + def __init__(self, **kwargs): + super(AzureReachabilityReportLatencyInfo, self).__init__(**kwargs) + self.time_stamp = kwargs.get('time_stamp', None) + self.score = kwargs.get('score', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_latency_info_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_latency_info_py3.py new file mode 100644 index 000000000000..dd9d8fda369c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_latency_info_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportLatencyInfo(Model): + """Details on latency for a time series. + + :param time_stamp: The time stamp. + :type time_stamp: datetime + :param score: The relative latency score between 1 and 100, higher values + indicating a faster connection. + :type score: int + """ + + _validation = { + 'score': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, + 'score': {'key': 'score', 'type': 'int'}, + } + + def __init__(self, *, time_stamp=None, score: int=None, **kwargs) -> None: + super(AzureReachabilityReportLatencyInfo, self).__init__(**kwargs) + self.time_stamp = time_stamp + self.score = score diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_location.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_location.py index 0da63a04e016..76c132e89575 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_location.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_location.py @@ -15,7 +15,9 @@ class AzureReachabilityReportLocation(Model): """Parameters that define a geographic location. - :param country: The name of the country. + All required parameters must be populated in order to send to Azure. + + :param country: Required. The name of the country. :type country: str :param state: The name of the state. :type state: str @@ -33,8 +35,8 @@ class AzureReachabilityReportLocation(Model): 'city': {'key': 'city', 'type': 'str'}, } - def __init__(self, country, state=None, city=None): - super(AzureReachabilityReportLocation, self).__init__() - self.country = country - self.state = state - self.city = city + def __init__(self, **kwargs): + super(AzureReachabilityReportLocation, self).__init__(**kwargs) + self.country = kwargs.get('country', None) + self.state = kwargs.get('state', None) + self.city = kwargs.get('city', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_location_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_location_py3.py new file mode 100644 index 000000000000..1db868eab46f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_location_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportLocation(Model): + """Parameters that define a geographic location. + + All required parameters must be populated in order to send to Azure. + + :param country: Required. The name of the country. + :type country: str + :param state: The name of the state. + :type state: str + :param city: The name of the city or town. + :type city: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__(self, *, country: str, state: str=None, city: str=None, **kwargs) -> None: + super(AzureReachabilityReportLocation, self).__init__(**kwargs) + self.country = country + self.state = state + self.city = city diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_parameters.py index fe254690b246..c4afef801e0e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_parameters.py @@ -15,16 +15,19 @@ class AzureReachabilityReportParameters(Model): """Geographic and time constraints for Azure reachability report. - :param provider_location: + All required parameters must be populated in order to send to Azure. + + :param provider_location: Required. :type provider_location: ~azure.mgmt.network.v2017_09_01.models.AzureReachabilityReportLocation :param providers: List of Internet service providers. :type providers: list[str] :param azure_locations: Optional Azure regions to scope the query to. :type azure_locations: list[str] - :param start_time: The start time for the Azure reachability report. + :param start_time: Required. The start time for the Azure reachability + report. :type start_time: datetime - :param end_time: The end time for the Azure reachability report. + :param end_time: Required. The end time for the Azure reachability report. :type end_time: datetime """ @@ -42,10 +45,10 @@ class AzureReachabilityReportParameters(Model): 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, } - def __init__(self, provider_location, start_time, end_time, providers=None, azure_locations=None): - super(AzureReachabilityReportParameters, self).__init__() - self.provider_location = provider_location - self.providers = providers - self.azure_locations = azure_locations - self.start_time = start_time - self.end_time = end_time + def __init__(self, **kwargs): + super(AzureReachabilityReportParameters, self).__init__(**kwargs) + self.provider_location = kwargs.get('provider_location', None) + self.providers = kwargs.get('providers', None) + self.azure_locations = kwargs.get('azure_locations', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_parameters_py3.py new file mode 100644 index 000000000000..794a752312a1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_parameters_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportParameters(Model): + """Geographic and time constraints for Azure reachability report. + + All required parameters must be populated in order to send to Azure. + + :param provider_location: Required. + :type provider_location: + ~azure.mgmt.network.v2017_09_01.models.AzureReachabilityReportLocation + :param providers: List of Internet service providers. + :type providers: list[str] + :param azure_locations: Optional Azure regions to scope the query to. + :type azure_locations: list[str] + :param start_time: Required. The start time for the Azure reachability + report. + :type start_time: datetime + :param end_time: Required. The end time for the Azure reachability report. + :type end_time: datetime + """ + + _validation = { + 'provider_location': {'required': True}, + 'start_time': {'required': True}, + 'end_time': {'required': True}, + } + + _attribute_map = { + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, provider_location, start_time, end_time, providers=None, azure_locations=None, **kwargs) -> None: + super(AzureReachabilityReportParameters, self).__init__(**kwargs) + self.provider_location = provider_location + self.providers = providers + self.azure_locations = azure_locations + self.start_time = start_time + self.end_time = end_time diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_py3.py new file mode 100644 index 000000000000..92fd2088240c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReport(Model): + """Azure reachability report details. + + All required parameters must be populated in order to send to Azure. + + :param aggregation_level: Required. The aggregation level of Azure + reachability report. Can be Country, State or City. + :type aggregation_level: str + :param provider_location: Required. + :type provider_location: + ~azure.mgmt.network.v2017_09_01.models.AzureReachabilityReportLocation + :param reachability_report: Required. List of Azure reachability report + items. + :type reachability_report: + list[~azure.mgmt.network.v2017_09_01.models.AzureReachabilityReportItem] + """ + + _validation = { + 'aggregation_level': {'required': True}, + 'provider_location': {'required': True}, + 'reachability_report': {'required': True}, + } + + _attribute_map = { + 'aggregation_level': {'key': 'aggregationLevel', 'type': 'str'}, + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'reachability_report': {'key': 'reachabilityReport', 'type': '[AzureReachabilityReportItem]'}, + } + + def __init__(self, *, aggregation_level: str, provider_location, reachability_report, **kwargs) -> None: + super(AzureReachabilityReport, self).__init__(**kwargs) + self.aggregation_level = aggregation_level + self.provider_location = provider_location + self.reachability_report = reachability_report diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/backend_address_pool.py index 079c25e29006..597d8918e27b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/backend_address_pool.py @@ -59,11 +59,11 @@ class BackendAddressPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, provisioning_state=None, name=None, etag=None): - super(BackendAddressPool, self).__init__(id=id) + def __init__(self, **kwargs): + super(BackendAddressPool, self).__init__(**kwargs) self.backend_ip_configurations = None self.load_balancing_rules = None self.outbound_nat_rule = None - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/backend_address_pool_py3.py new file mode 100644 index 000000000000..c8d1cc10bcc7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/backend_address_pool_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class BackendAddressPool(SubResource): + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar backend_ip_configurations: Gets collection of references to IP + addresses defined in network interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: Gets load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_09_01.models.SubResource] + :ivar outbound_nat_rule: Gets outbound rules that use this backend address + pool. + :vartype outbound_nat_rule: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param provisioning_state: Get provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configurations': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'outbound_nat_rule': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'outbound_nat_rule': {'key': 'properties.outboundNatRule', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(BackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = None + self.load_balancing_rules = None + self.outbound_nat_rule = None + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_community.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_community.py index 8275a0e4048c..472a170e9ceb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_community.py @@ -42,11 +42,11 @@ class BGPCommunity(Model): 'service_group': {'key': 'serviceGroup', 'type': 'str'}, } - def __init__(self, service_supported_region=None, community_name=None, community_value=None, community_prefixes=None, is_authorized_to_use=None, service_group=None): - super(BGPCommunity, self).__init__() - self.service_supported_region = service_supported_region - self.community_name = community_name - self.community_value = community_value - self.community_prefixes = community_prefixes - self.is_authorized_to_use = is_authorized_to_use - self.service_group = service_group + def __init__(self, **kwargs): + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = kwargs.get('service_supported_region', None) + self.community_name = kwargs.get('community_name', None) + self.community_value = kwargs.get('community_value', None) + self.community_prefixes = kwargs.get('community_prefixes', None) + self.is_authorized_to_use = kwargs.get('is_authorized_to_use', None) + self.service_group = kwargs.get('service_group', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_community_py3.py new file mode 100644 index 000000000000..86b740c84404 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_community_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BGPCommunity(Model): + """Contains bgp community information offered in Service Community resources. + + :param service_supported_region: The region which the service support. + e.g. For O365, region is Global. + :type service_supported_region: str + :param community_name: The name of the bgp community. e.g. Skype. + :type community_name: str + :param community_value: The value of the bgp community. For more + information: + https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + :type community_value: str + :param community_prefixes: The prefixes that the bgp community contains. + :type community_prefixes: list[str] + :param is_authorized_to_use: Customer is authorized to use bgp community + or not. + :type is_authorized_to_use: bool + :param service_group: The service group of the bgp community contains. + :type service_group: str + """ + + _attribute_map = { + 'service_supported_region': {'key': 'serviceSupportedRegion', 'type': 'str'}, + 'community_name': {'key': 'communityName', 'type': 'str'}, + 'community_value': {'key': 'communityValue', 'type': 'str'}, + 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, + 'is_authorized_to_use': {'key': 'isAuthorizedToUse', 'type': 'bool'}, + 'service_group': {'key': 'serviceGroup', 'type': 'str'}, + } + + def __init__(self, *, service_supported_region: str=None, community_name: str=None, community_value: str=None, community_prefixes=None, is_authorized_to_use: bool=None, service_group: str=None, **kwargs) -> None: + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = service_supported_region + self.community_name = community_name + self.community_value = community_value + self.community_prefixes = community_prefixes + self.is_authorized_to_use = is_authorized_to_use + self.service_group = service_group diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status.py index 187036110092..9a9f6fa4bdbf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status.py @@ -59,8 +59,8 @@ class BgpPeerStatus(Model): 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, } - def __init__(self): - super(BgpPeerStatus, self).__init__() + def __init__(self, **kwargs): + super(BgpPeerStatus, self).__init__(**kwargs) self.local_address = None self.neighbor = None self.asn = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status_list_result.py index 0eb7e3a6137c..1d7b3b177fa0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status_list_result.py @@ -23,6 +23,6 @@ class BgpPeerStatusListResult(Model): 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, } - def __init__(self, value=None): - super(BgpPeerStatusListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status_list_result_py3.py new file mode 100644 index 000000000000..75b1e2f70cc3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatusListResult(Model): + """Response for list BGP peer status API service call. + + :param value: List of BGP peers + :type value: list[~azure.mgmt.network.v2017_09_01.models.BgpPeerStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status_py3.py new file mode 100644 index 000000000000..b7527fe75fc6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_peer_status_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatus(Model): + """BGP peer status details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The virtual network gateway's local address + :vartype local_address: str + :ivar neighbor: The remote BGP peer + :vartype neighbor: str + :ivar asn: The autonomous system number of the remote BGP peer + :vartype asn: int + :ivar state: The BGP peer state. Possible values include: 'Unknown', + 'Stopped', 'Idle', 'Connecting', 'Connected' + :vartype state: str or ~azure.mgmt.network.v2017_09_01.models.BgpPeerState + :ivar connected_duration: For how long the peering has been up + :vartype connected_duration: str + :ivar routes_received: The number of routes learned from this peer + :vartype routes_received: long + :ivar messages_sent: The number of BGP messages sent + :vartype messages_sent: long + :ivar messages_received: The number of BGP messages received + :vartype messages_received: long + """ + + _validation = { + 'local_address': {'readonly': True}, + 'neighbor': {'readonly': True}, + 'asn': {'readonly': True}, + 'state': {'readonly': True}, + 'connected_duration': {'readonly': True}, + 'routes_received': {'readonly': True}, + 'messages_sent': {'readonly': True}, + 'messages_received': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'str'}, + 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, + 'routes_received': {'key': 'routesReceived', 'type': 'long'}, + 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, + 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(BgpPeerStatus, self).__init__(**kwargs) + self.local_address = None + self.neighbor = None + self.asn = None + self.state = None + self.connected_duration = None + self.routes_received = None + self.messages_sent = None + self.messages_received = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_service_community.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_service_community.py index da3d1c839aed..07aef6f2d505 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_service_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_service_community.py @@ -50,7 +50,7 @@ class BgpServiceCommunity(Resource): 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, } - def __init__(self, id=None, location=None, tags=None, service_name=None, bgp_communities=None): - super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags) - self.service_name = service_name - self.bgp_communities = bgp_communities + def __init__(self, **kwargs): + super(BgpServiceCommunity, self).__init__(**kwargs) + self.service_name = kwargs.get('service_name', None) + self.bgp_communities = kwargs.get('bgp_communities', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_service_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_service_community_py3.py new file mode 100644 index 000000000000..8e361deedbfd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_service_community_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BgpServiceCommunity(Resource): + """Service Community Properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param service_name: The name of the bgp community. e.g. Skype. + :type service_name: str + :param bgp_communities: Get a list of bgp communities. + :type bgp_communities: + list[~azure.mgmt.network.v2017_09_01.models.BGPCommunity] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, + 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, service_name: str=None, bgp_communities=None, **kwargs) -> None: + super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.service_name = service_name + self.bgp_communities = bgp_communities diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_settings.py index c5730da2e43e..e6e8d1b90aa6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_settings.py @@ -31,8 +31,8 @@ class BgpSettings(Model): 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, } - def __init__(self, asn=None, bgp_peering_address=None, peer_weight=None): - super(BgpSettings, self).__init__() - self.asn = asn - self.bgp_peering_address = bgp_peering_address - self.peer_weight = peer_weight + def __init__(self, **kwargs): + super(BgpSettings, self).__init__(**kwargs) + self.asn = kwargs.get('asn', None) + self.bgp_peering_address = kwargs.get('bgp_peering_address', None) + self.peer_weight = kwargs.get('peer_weight', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_settings_py3.py new file mode 100644 index 000000000000..cb3b3e6795f7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/bgp_settings_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpSettings(Model): + """BGP settings details. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of + this BGP speaker. + :type bgp_peering_address: str + :param peer_weight: The weight added to routes learned from this BGP + speaker. + :type peer_weight: int + """ + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, + } + + def __init__(self, *, asn: int=None, bgp_peering_address: str=None, peer_weight: int=None, **kwargs) -> None: + super(BgpSettings, self).__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + self.peer_weight = peer_weight diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_reset_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_reset_shared_key.py index 3338112a7fe7..1ade077795ed 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_reset_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_reset_shared_key.py @@ -15,8 +15,10 @@ class ConnectionResetSharedKey(Model): """The virtual network connection reset shared key. - :param key_length: The virtual network connection reset shared key length, - should between 1 and 128. + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. :type key_length: int """ @@ -28,6 +30,6 @@ class ConnectionResetSharedKey(Model): 'key_length': {'key': 'keyLength', 'type': 'int'}, } - def __init__(self, key_length): - super(ConnectionResetSharedKey, self).__init__() - self.key_length = key_length + def __init__(self, **kwargs): + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = kwargs.get('key_length', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_reset_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_reset_shared_key_py3.py new file mode 100644 index 000000000000..47326d4c2082 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_reset_shared_key_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionResetSharedKey(Model): + """The virtual network connection reset shared key. + + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. + :type key_length: int + """ + + _validation = { + 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, + } + + _attribute_map = { + 'key_length': {'key': 'keyLength', 'type': 'int'}, + } + + def __init__(self, *, key_length: int, **kwargs) -> None: + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = key_length diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_shared_key.py index 2c1b0ed9a914..742f1cb15126 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_shared_key.py @@ -15,7 +15,9 @@ class ConnectionSharedKey(Model): """Response for GetConnectionSharedKey API service call. - :param value: The virtual network connection shared key value. + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. :type value: str """ @@ -27,6 +29,6 @@ class ConnectionSharedKey(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, value): - super(ConnectionSharedKey, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_shared_key_py3.py new file mode 100644 index 000000000000..11b88da35e17 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connection_shared_key_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionSharedKey(Model): + """Response for GetConnectionSharedKey API service call. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, **kwargs) -> None: + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_destination.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_destination.py index cd0e8818b591..964c425a29d3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_destination.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_destination.py @@ -31,8 +31,8 @@ class ConnectivityDestination(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id=None, address=None, port=None): - super(ConnectivityDestination, self).__init__() - self.resource_id = resource_id - self.address = address - self.port = port + def __init__(self, **kwargs): + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_destination_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_destination_py3.py new file mode 100644 index 000000000000..c51619081ed6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_destination_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityDestination(Model): + """Parameters that define destination of connection. + + :param resource_id: The ID of the resource to which a connection attempt + will be made. + :type resource_id: str + :param address: The IP address or URI the resource to which a connection + attempt will be made. + :type address: str + :param port: Port on which check connectivity will be performed. + :type port: int + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str=None, address: str=None, port: int=None, **kwargs) -> None: + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_hop.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_hop.py index b0e9873cf1b8..82a36aebb693 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_hop.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_hop.py @@ -51,8 +51,8 @@ class ConnectivityHop(Model): 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, } - def __init__(self): - super(ConnectivityHop, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityHop, self).__init__(**kwargs) self.type = None self.id = None self.address = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_hop_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_hop_py3.py new file mode 100644 index 000000000000..be0719003d18 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_hop_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityHop(Model): + """Information about a hop between the source and the destination. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the hop. + :vartype type: str + :ivar id: The ID of the hop. + :vartype id: str + :ivar address: The IP address of the hop. + :vartype address: str + :ivar resource_id: The ID of the resource corresponding to this hop. + :vartype resource_id: str + :ivar next_hop_ids: List of next hop identifiers. + :vartype next_hop_ids: list[str] + :ivar issues: List of issues. + :vartype issues: + list[~azure.mgmt.network.v2017_09_01.models.ConnectivityIssue] + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'address': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'next_hop_ids': {'readonly': True}, + 'issues': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'next_hop_ids': {'key': 'nextHopIds', 'type': '[str]'}, + 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityHop, self).__init__(**kwargs) + self.type = None + self.id = None + self.address = None + self.resource_id = None + self.next_hop_ids = None + self.issues = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_information.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_information.py index 5a17ac8364cc..49a68c7a58be 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_information.py @@ -57,8 +57,8 @@ class ConnectivityInformation(Model): 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, } - def __init__(self): - super(ConnectivityInformation, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityInformation, self).__init__(**kwargs) self.hops = None self.connection_status = None self.avg_latency_in_ms = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_information_py3.py new file mode 100644 index 000000000000..62a79594122c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_information_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityInformation(Model): + """Information on the connectivity status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar hops: List of hops between the source and the destination. + :vartype hops: + list[~azure.mgmt.network.v2017_09_01.models.ConnectivityHop] + :ivar connection_status: The connection status. Possible values include: + 'Unknown', 'Connected', 'Disconnected', 'Degraded' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_09_01.models.ConnectionStatus + :ivar avg_latency_in_ms: Average latency in milliseconds. + :vartype avg_latency_in_ms: int + :ivar min_latency_in_ms: Minimum latency in milliseconds. + :vartype min_latency_in_ms: int + :ivar max_latency_in_ms: Maximum latency in milliseconds. + :vartype max_latency_in_ms: int + :ivar probes_sent: Total number of probes sent. + :vartype probes_sent: int + :ivar probes_failed: Number of failed probes. + :vartype probes_failed: int + """ + + _validation = { + 'hops': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'avg_latency_in_ms': {'readonly': True}, + 'min_latency_in_ms': {'readonly': True}, + 'max_latency_in_ms': {'readonly': True}, + 'probes_sent': {'readonly': True}, + 'probes_failed': {'readonly': True}, + } + + _attribute_map = { + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, + 'probes_sent': {'key': 'probesSent', 'type': 'int'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityInformation, self).__init__(**kwargs) + self.hops = None + self.connection_status = None + self.avg_latency_in_ms = None + self.min_latency_in_ms = None + self.max_latency_in_ms = None + self.probes_sent = None + self.probes_failed = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_issue.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_issue.py index 75337cdc7472..5105587b1864 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_issue.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_issue.py @@ -47,8 +47,8 @@ class ConnectivityIssue(Model): 'context': {'key': 'context', 'type': '[{str}]'}, } - def __init__(self): - super(ConnectivityIssue, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityIssue, self).__init__(**kwargs) self.origin = None self.severity = None self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_issue_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_issue_py3.py new file mode 100644 index 000000000000..441d34f08770 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_issue_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityIssue(Model): + """Information about an issue encountered in the process of checking for + connectivity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar origin: The origin of the issue. Possible values include: 'Local', + 'Inbound', 'Outbound' + :vartype origin: str or ~azure.mgmt.network.v2017_09_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: + 'Error', 'Warning' + :vartype severity: str or ~azure.mgmt.network.v2017_09_01.models.Severity + :ivar type: The type of issue. Possible values include: 'Unknown', + 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', + 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform' + :vartype type: str or ~azure.mgmt.network.v2017_09_01.models.IssueType + :ivar context: Provides additional context on the issue. + :vartype context: list[dict[str, str]] + """ + + _validation = { + 'origin': {'readonly': True}, + 'severity': {'readonly': True}, + 'type': {'readonly': True}, + 'context': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'context': {'key': 'context', 'type': '[{str}]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityIssue, self).__init__(**kwargs) + self.origin = None + self.severity = None + self.type = None + self.context = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_parameters.py index 12c552a2a53c..c303ad764cd7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_parameters.py @@ -15,9 +15,11 @@ class ConnectivityParameters(Model): """Parameters that determine how the connectivity check will be performed. - :param source: + All required parameters must be populated in order to send to Azure. + + :param source: Required. :type source: ~azure.mgmt.network.v2017_09_01.models.ConnectivitySource - :param destination: + :param destination: Required. :type destination: ~azure.mgmt.network.v2017_09_01.models.ConnectivityDestination """ @@ -32,7 +34,7 @@ class ConnectivityParameters(Model): 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, } - def __init__(self, source, destination): - super(ConnectivityParameters, self).__init__() - self.source = source - self.destination = destination + def __init__(self, **kwargs): + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_parameters_py3.py new file mode 100644 index 000000000000..08d338f6ad9b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_parameters_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityParameters(Model): + """Parameters that determine how the connectivity check will be performed. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. + :type source: ~azure.mgmt.network.v2017_09_01.models.ConnectivitySource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2017_09_01.models.ConnectivityDestination + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectivitySource'}, + 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, + } + + def __init__(self, *, source, destination, **kwargs) -> None: + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = source + self.destination = destination diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_source.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_source.py index c42bfc0aa09d..3fd82793f8d7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_source.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_source.py @@ -15,8 +15,10 @@ class ConnectivitySource(Model): """Parameters that define the source of the connection. - :param resource_id: The ID of the resource from which a connectivity check - will be initiated. + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. :type resource_id: str :param port: The source port from which a connectivity check will be performed. @@ -32,7 +34,7 @@ class ConnectivitySource(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id, port=None): - super(ConnectivitySource, self).__init__() - self.resource_id = resource_id - self.port = port + def __init__(self, **kwargs): + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_source_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_source_py3.py new file mode 100644 index 000000000000..f7833d1bef76 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/connectivity_source_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivitySource(Model): + """Parameters that define the source of the connection. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. + :type resource_id: str + :param port: The source port from which a connectivity check will be + performed. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str, port: int=None, **kwargs) -> None: + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = resource_id + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dhcp_options.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dhcp_options.py index 8744ba6fc9b1..93b68a7f037c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dhcp_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dhcp_options.py @@ -25,6 +25,6 @@ class DhcpOptions(Model): 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, } - def __init__(self, dns_servers=None): - super(DhcpOptions, self).__init__() - self.dns_servers = dns_servers + def __init__(self, **kwargs): + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dhcp_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dhcp_options_py3.py new file mode 100644 index 000000000000..7dc4651973a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dhcp_options_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DhcpOptions(Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in + the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + options. + + :param dns_servers: The list of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = dns_servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dimension.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dimension.py index f18204215221..e9c8cd977a54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dimension.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dimension.py @@ -29,8 +29,8 @@ class Dimension(Model): 'internal_name': {'key': 'internalName', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, internal_name=None): - super(Dimension, self).__init__() - self.name = name - self.display_name = display_name - self.internal_name = internal_name + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.internal_name = kwargs.get('internal_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dimension_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dimension_py3.py new file mode 100644 index 000000000000..20743b6424c1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dimension_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dimension(Model): + """Dimension of the metric. + + :param name: The name of the dimension. + :type name: str + :param display_name: The display name of the dimension. + :type display_name: str + :param internal_name: The internal name of the dimension. + :type internal_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, internal_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dns_name_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dns_name_availability_result.py index 15a0238e49a7..86ba19eb407b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dns_name_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dns_name_availability_result.py @@ -23,6 +23,6 @@ class DnsNameAvailabilityResult(Model): 'available': {'key': 'available', 'type': 'bool'}, } - def __init__(self, available=None): - super(DnsNameAvailabilityResult, self).__init__() - self.available = available + def __init__(self, **kwargs): + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dns_name_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dns_name_availability_result_py3.py new file mode 100644 index 000000000000..de0117c27715 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/dns_name_availability_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DnsNameAvailabilityResult(Model): + """Response for the CheckDnsNameAvailability API service call. + + :param available: Domain availability (True/False). + :type available: bool + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + } + + def __init__(self, *, available: bool=None, **kwargs) -> None: + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = available diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group.py index 78481ed79d28..6d90c43f55a4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group.py @@ -37,9 +37,9 @@ class EffectiveNetworkSecurityGroup(Model): 'tag_map': {'key': 'tagMap', 'type': '{[str]}'}, } - def __init__(self, network_security_group=None, association=None, effective_security_rules=None, tag_map=None): - super(EffectiveNetworkSecurityGroup, self).__init__() - self.network_security_group = network_security_group - self.association = association - self.effective_security_rules = effective_security_rules - self.tag_map = tag_map + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = kwargs.get('network_security_group', None) + self.association = kwargs.get('association', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) + self.tag_map = kwargs.get('tag_map', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_association.py index 2cf439cbdb37..8564a9c78ff1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_association.py @@ -27,7 +27,7 @@ class EffectiveNetworkSecurityGroupAssociation(Model): 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, } - def __init__(self, subnet=None, network_interface=None): - super(EffectiveNetworkSecurityGroupAssociation, self).__init__() - self.subnet = subnet - self.network_interface = network_interface + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.network_interface = kwargs.get('network_interface', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_association_py3.py new file mode 100644 index 000000000000..f1e817ba784f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_association_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupAssociation(Model): + """The effective network security group association. + + :param subnet: The ID of the subnet if assigned. + :type subnet: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: + ~azure.mgmt.network.v2017_09_01.models.SubResource + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, + } + + def __init__(self, *, subnet=None, network_interface=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = subnet + self.network_interface = network_interface diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_list_result.py index ec04622670cc..87338560a085 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_list_result.py @@ -34,7 +34,7 @@ class EffectiveNetworkSecurityGroupListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None): - super(EffectiveNetworkSecurityGroupListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_list_result_py3.py new file mode 100644 index 000000000000..c0401f084689 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_list_result_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupListResult(Model): + """Response for list effective network security groups API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective network security groups. + :type value: + list[~azure.mgmt.network.v2017_09_01.models.EffectiveNetworkSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_py3.py new file mode 100644 index 000000000000..3ed27bcb97b9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_group_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroup(Model): + """Effective network security group. + + :param network_security_group: The ID of network security group that is + applied. + :type network_security_group: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param association: Associated resources. + :type association: + ~azure.mgmt.network.v2017_09_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2017_09_01.models.EffectiveNetworkSecurityRule] + :param tag_map: Mapping of tags to list of IP Addresses included within + the tag. + :type tag_map: dict[str, list[str]] + """ + + _attribute_map = { + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, + 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + 'tag_map': {'key': 'tagMap', 'type': '{[str]}'}, + } + + def __init__(self, *, network_security_group=None, association=None, effective_security_rules=None, tag_map=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = network_security_group + self.association = association + self.effective_security_rules = effective_security_rules + self.tag_map = tag_map diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_rule.py index cef084bc8b18..8481a0229ca9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_rule.py @@ -82,20 +82,20 @@ class EffectiveNetworkSecurityRule(Model): 'direction': {'key': 'direction', 'type': 'str'}, } - def __init__(self, name=None, protocol=None, source_port_range=None, destination_port_range=None, source_port_ranges=None, destination_port_ranges=None, source_address_prefix=None, destination_address_prefix=None, source_address_prefixes=None, destination_address_prefixes=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority=None, direction=None): - super(EffectiveNetworkSecurityRule, self).__init__() - self.name = name - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_port_ranges = source_port_ranges - self.destination_port_ranges = destination_port_ranges - self.source_address_prefix = source_address_prefix - self.destination_address_prefix = destination_address_prefix - self.source_address_prefixes = source_address_prefixes - self.destination_address_prefixes = destination_address_prefixes - self.expanded_source_address_prefix = expanded_source_address_prefix - self.expanded_destination_address_prefix = expanded_destination_address_prefix - self.access = access - self.priority = priority - self.direction = direction + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.expanded_source_address_prefix = kwargs.get('expanded_source_address_prefix', None) + self.expanded_destination_address_prefix = kwargs.get('expanded_destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_rule_py3.py new file mode 100644 index 000000000000..07332669b2ef --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_network_security_rule_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityRule(Model): + """Effective network security rules. + + :param name: The name of the security rule specified by the user (if + created by the user). + :type name: str + :param protocol: The network protocol this rule applies to. Possible + values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', + 'Udp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_09_01.models.EffectiveSecurityRuleProtocol + :param source_port_range: The source port or range. + :type source_port_range: str + :param destination_port_range: The destination port or range. + :type destination_port_range: str + :param source_port_ranges: The source port ranges. Expected values include + a single integer between 0 and 65535, a range using '-' as seperator (e.g. + 100-400), or an asterix (*) + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. Expected + values include a single integer between 0 and 65535, a range using '-' as + seperator (e.g. 100-400), or an asterix (*) + :type destination_port_ranges: list[str] + :param source_address_prefix: The source address prefix. + :type source_address_prefix: str + :param destination_address_prefix: The destination address prefix. + :type destination_address_prefix: str + :param source_address_prefixes: The source address prefixes. Expected + values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type source_address_prefixes: list[str] + :param destination_address_prefixes: The destination address prefixes. + Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type destination_address_prefixes: list[str] + :param expanded_source_address_prefix: The expanded source address prefix. + :type expanded_source_address_prefix: list[str] + :param expanded_destination_address_prefix: Expanded destination address + prefix. + :type expanded_destination_address_prefix: list[str] + :param access: Whether network traffic is allowed or denied. Possible + values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or + ~azure.mgmt.network.v2017_09_01.models.SecurityRuleAccess + :param priority: The priority of the rule. + :type priority: int + :param direction: The direction of the rule. Possible values are: 'Inbound + and Outbound'. Possible values include: 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2017_09_01.models.SecurityRuleDirection + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'source_port_ranges': {'key': 'sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'destinationPortRanges', 'type': '[str]'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'sourceAddressPrefixes', 'type': '[str]'}, + 'destination_address_prefixes': {'key': 'destinationAddressPrefixes', 'type': '[str]'}, + 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, + 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, + 'access': {'key': 'access', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, protocol=None, source_port_range: str=None, destination_port_range: str=None, source_port_ranges=None, destination_port_ranges=None, source_address_prefix: str=None, destination_address_prefix: str=None, source_address_prefixes=None, destination_address_prefixes=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority: int=None, direction=None, **kwargs) -> None: + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = name + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.source_address_prefixes = source_address_prefixes + self.destination_address_prefixes = destination_address_prefixes + self.expanded_source_address_prefix = expanded_source_address_prefix + self.expanded_destination_address_prefix = expanded_destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route.py index c76f86173777..dd5fb2f4ac08 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route.py @@ -50,11 +50,11 @@ class EffectiveRoute(Model): 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, } - def __init__(self, name=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None): - super(EffectiveRoute, self).__init__() - self.name = name - self.source = source - self.state = state - self.address_prefix = address_prefix - self.next_hop_ip_address = next_hop_ip_address - self.next_hop_type = next_hop_type + def __init__(self, **kwargs): + super(EffectiveRoute, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.next_hop_type = kwargs.get('next_hop_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route_list_result.py index e5acb20d180d..4608b578db1f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route_list_result.py @@ -33,7 +33,7 @@ class EffectiveRouteListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None): - super(EffectiveRouteListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route_list_result_py3.py new file mode 100644 index 000000000000..47ab0857d010 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route_list_result_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRouteListResult(Model): + """Response for list effective route API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective routes. + :type value: list[~azure.mgmt.network.v2017_09_01.models.EffectiveRoute] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route_py3.py new file mode 100644 index 000000000000..f61272bd0bcf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/effective_route_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRoute(Model): + """Effective Route. + + :param name: The name of the user defined route. This is optional. + :type name: str + :param source: Who created the route. Possible values are: 'Unknown', + 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: + 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' + :type source: str or + ~azure.mgmt.network.v2017_09_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values are: 'Active' + and 'Invalid'. Possible values include: 'Active', 'Invalid' + :type state: str or + ~azure.mgmt.network.v2017_09_01.models.EffectiveRouteState + :param address_prefix: The address prefixes of the effective routes in + CIDR notation. + :type address_prefix: list[str] + :param next_hop_ip_address: The IP address of the next hop of the + effective route. + :type next_hop_ip_address: list[str] + :param next_hop_type: The type of Azure hop the packet should be sent to. + Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_09_01.models.RouteNextHopType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None, **kwargs) -> None: + super(EffectiveRoute, self).__init__(**kwargs) + self.name = name + self.source = source + self.state = state + self.address_prefix = address_prefix + self.next_hop_ip_address = next_hop_ip_address + self.next_hop_type = next_hop_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/endpoint_service_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/endpoint_service_result.py index 9098a41ff164..9ca0e203a834 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/endpoint_service_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/endpoint_service_result.py @@ -37,7 +37,7 @@ class EndpointServiceResult(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None): - super(EndpointServiceResult, self).__init__(id=id) + def __init__(self, **kwargs): + super(EndpointServiceResult, self).__init__(**kwargs) self.name = None self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/endpoint_service_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/endpoint_service_result_py3.py new file mode 100644 index 000000000000..c45df94a6533 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/endpoint_service_result_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class EndpointServiceResult(SubResource): + """Endpoint service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Name of the endpoint service. + :vartype name: str + :ivar type: Type of the endpoint service. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(EndpointServiceResult, self).__init__(id=id, **kwargs) + self.name = None + self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error.py index 7667a0ee38db..264d30ff5129 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error.py @@ -35,10 +35,10 @@ class Error(Model): 'inner_error': {'key': 'innerError', 'type': 'str'}, } - def __init__(self, code=None, message=None, target=None, details=None, inner_error=None): - super(Error, self).__init__() - self.code = code - self.message = message - self.target = target - self.details = details - self.inner_error = inner_error + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error_details.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error_details.py index 40bea00aa2fb..a8c4da6ba955 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error_details.py @@ -29,8 +29,8 @@ class ErrorDetails(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ErrorDetails, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error_details_py3.py new file mode 100644 index 000000000000..d791f0895345 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error_details_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """ErrorDetails. + + :param code: + :type code: str + :param target: + :type target: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error_py3.py new file mode 100644 index 000000000000..ea216ea8f8fa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(Model): + """Error. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.network.v2017_09_01.models.ErrorDetails] + :param inner_error: + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, inner_error: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit.py index 7ba4c458f865..2d69d9633da3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit.py @@ -91,17 +91,17 @@ class ExpressRouteCircuit(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, allow_classic_operations=None, circuit_provisioning_state=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key=None, service_provider_notes=None, service_provider_properties=None, provisioning_state=None, gateway_manager_etag=None): - super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.allow_classic_operations = allow_classic_operations - self.circuit_provisioning_state = circuit_provisioning_state - self.service_provider_provisioning_state = service_provider_provisioning_state - self.authorizations = authorizations - self.peerings = peerings - self.service_key = service_key - self.service_provider_notes = service_provider_notes - self.service_provider_properties = service_provider_properties - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag + def __init__(self, **kwargs): + super(ExpressRouteCircuit, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.allow_classic_operations = kwargs.get('allow_classic_operations', None) + self.circuit_provisioning_state = kwargs.get('circuit_provisioning_state', None) + self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) + self.authorizations = kwargs.get('authorizations', None) + self.peerings = kwargs.get('peerings', None) + self.service_key = kwargs.get('service_key', None) + self.service_provider_notes = kwargs.get('service_provider_notes', None) + self.service_provider_properties = kwargs.get('service_provider_properties', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_arp_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_arp_table.py index ace325747ee5..826796619769 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_arp_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_arp_table.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitArpTable(Model): 'mac_address': {'key': 'macAddress', 'type': 'str'}, } - def __init__(self, age=None, interface=None, ip_address=None, mac_address=None): - super(ExpressRouteCircuitArpTable, self).__init__() - self.age = age - self.interface = interface - self.ip_address = ip_address - self.mac_address = mac_address + def __init__(self, **kwargs): + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = kwargs.get('age', None) + self.interface = kwargs.get('interface', None) + self.ip_address = kwargs.get('ip_address', None) + self.mac_address = kwargs.get('mac_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_arp_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_arp_table_py3.py new file mode 100644 index 000000000000..4401108c6001 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_arp_table_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitArpTable(Model): + """The ARP table associated with the ExpressRouteCircuit. + + :param age: Age + :type age: int + :param interface: Interface + :type interface: str + :param ip_address: The IP address. + :type ip_address: str + :param mac_address: The MAC address. + :type mac_address: str + """ + + _attribute_map = { + 'age': {'key': 'age', 'type': 'int'}, + 'interface': {'key': 'interface', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, *, age: int=None, interface: str=None, ip_address: str=None, mac_address: str=None, **kwargs) -> None: + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = age + self.interface = interface + self.ip_address = ip_address + self.mac_address = mac_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_authorization.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_authorization.py index 81b71ef8bf47..1918e5fd695b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_authorization.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_authorization.py @@ -51,10 +51,10 @@ class ExpressRouteCircuitAuthorization(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, authorization_key=None, authorization_use_status=None, provisioning_state=None, name=None): - super(ExpressRouteCircuitAuthorization, self).__init__(id=id) - self.authorization_key = authorization_key - self.authorization_use_status = authorization_use_status - self.provisioning_state = provisioning_state - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitAuthorization, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.authorization_use_status = kwargs.get('authorization_use_status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_authorization_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_authorization_py3.py new file mode 100644 index 000000000000..7209c9c41899 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_authorization_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param authorization_use_status: AuthorizationUseStatus. Possible values + are: 'Available' and 'InUse'. Possible values include: 'Available', + 'InUse' + :type authorization_use_status: str or + ~azure.mgmt.network.v2017_09_01.models.AuthorizationUseStatus + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, authorization_key: str=None, authorization_use_status=None, provisioning_state: str=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitAuthorization, self).__init__(id=id, **kwargs) + self.authorization_key = authorization_key + self.authorization_use_status = authorization_use_status + self.provisioning_state = provisioning_state + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering.py index ef70c15f8ecf..19a9c106c577 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering.py @@ -100,24 +100,24 @@ class ExpressRouteCircuitPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, peering_type=None, state=None, azure_asn=None, peer_asn=None, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, primary_azure_port=None, secondary_azure_port=None, shared_key=None, vlan_id=None, microsoft_peering_config=None, stats=None, provisioning_state=None, gateway_manager_etag=None, last_modified_by=None, route_filter=None, ipv6_peering_config=None, name=None): - super(ExpressRouteCircuitPeering, self).__init__(id=id) - self.peering_type = peering_type - self.state = state - self.azure_asn = azure_asn - self.peer_asn = peer_asn - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.primary_azure_port = primary_azure_port - self.secondary_azure_port = secondary_azure_port - self.shared_key = shared_key - self.vlan_id = vlan_id - self.microsoft_peering_config = microsoft_peering_config - self.stats = stats - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag - self.last_modified_by = last_modified_by - self.route_filter = route_filter - self.ipv6_peering_config = ipv6_peering_config - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeering, self).__init__(**kwargs) + self.peering_type = kwargs.get('peering_type', None) + self.state = kwargs.get('state', None) + self.azure_asn = kwargs.get('azure_asn', None) + self.peer_asn = kwargs.get('peer_asn', None) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.primary_azure_port = kwargs.get('primary_azure_port', None) + self.secondary_azure_port = kwargs.get('secondary_azure_port', None) + self.shared_key = kwargs.get('shared_key', None) + self.vlan_id = kwargs.get('vlan_id', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.stats = kwargs.get('stats', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.route_filter = kwargs.get('route_filter', None) + self.ipv6_peering_config = kwargs.get('ipv6_peering_config', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering_config.py index ba5cbb597272..9c3cdb8f7677 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering_config.py @@ -45,11 +45,11 @@ class ExpressRouteCircuitPeeringConfig(Model): 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, } - def __init__(self, advertised_public_prefixes=None, advertised_communities=None, advertised_public_prefixes_state=None, legacy_mode=None, customer_asn=None, routing_registry_name=None): - super(ExpressRouteCircuitPeeringConfig, self).__init__() - self.advertised_public_prefixes = advertised_public_prefixes - self.advertised_communities = advertised_communities - self.advertised_public_prefixes_state = advertised_public_prefixes_state - self.legacy_mode = legacy_mode - self.customer_asn = customer_asn - self.routing_registry_name = routing_registry_name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = kwargs.get('advertised_public_prefixes', None) + self.advertised_communities = kwargs.get('advertised_communities', None) + self.advertised_public_prefixes_state = kwargs.get('advertised_public_prefixes_state', None) + self.legacy_mode = kwargs.get('legacy_mode', None) + self.customer_asn = kwargs.get('customer_asn', None) + self.routing_registry_name = kwargs.get('routing_registry_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..19d62646d798 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering_config_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitPeeringConfig(Model): + """Specifies the peering configuration. + + :param advertised_public_prefixes: The reference of + AdvertisedPublicPrefixes. + :type advertised_public_prefixes: list[str] + :param advertised_communities: The communities of bgp peering. Spepcified + for microsoft peering + :type advertised_communities: list[str] + :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of + the Peering resource. Possible values are 'NotConfigured', 'Configuring', + 'Configured', and 'ValidationNeeded'. Possible values include: + 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' + :type advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :param legacy_mode: The legacy mode of the peering. + :type legacy_mode: int + :param customer_asn: The CustomerASN of the peering. + :type customer_asn: int + :param routing_registry_name: The RoutingRegistryName of the + configuration. + :type routing_registry_name: str + """ + + _attribute_map = { + 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, + 'advertised_communities': {'key': 'advertisedCommunities', 'type': '[str]'}, + 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, + 'legacy_mode': {'key': 'legacyMode', 'type': 'int'}, + 'customer_asn': {'key': 'customerASN', 'type': 'int'}, + 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, + } + + def __init__(self, *, advertised_public_prefixes=None, advertised_communities=None, advertised_public_prefixes_state=None, legacy_mode: int=None, customer_asn: int=None, routing_registry_name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = advertised_public_prefixes + self.advertised_communities = advertised_communities + self.advertised_public_prefixes_state = advertised_public_prefixes_state + self.legacy_mode = legacy_mode + self.customer_asn = customer_asn + self.routing_registry_name = routing_registry_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering_py3.py new file mode 100644 index 000000000000..e3efa3352fe6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_peering_py3.py @@ -0,0 +1,123 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitPeering(SubResource): + """Peering in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param peering_type: The PeeringType. Possible values are: + 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. + Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + 'MicrosoftPeering' + :type peering_type: str or + ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeeringType + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeeringState + :param azure_asn: The Azure ASN. + :type azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: int + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param primary_azure_port: The primary port. + :type primary_azure_port: str + :param secondary_azure_port: The secondary port. + :type secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeeringConfig + :param stats: Gets peering stats. + :type stats: + ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitStats + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :param last_modified_by: Gets whether the provider or the customer last + modified the peering. + :type last_modified_by: str + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2017_09_01.models.RouteFilter + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2017_09_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'int'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'route_filter': {'key': 'properties.routeFilter', 'type': 'RouteFilter'}, + 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, peering_type=None, state=None, azure_asn: int=None, peer_asn: int=None, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, primary_azure_port: str=None, secondary_azure_port: str=None, shared_key: str=None, vlan_id: int=None, microsoft_peering_config=None, stats=None, provisioning_state: str=None, gateway_manager_etag: str=None, last_modified_by: str=None, route_filter=None, ipv6_peering_config=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeering, self).__init__(id=id, **kwargs) + self.peering_type = peering_type + self.state = state + self.azure_asn = azure_asn + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = primary_azure_port + self.secondary_azure_port = secondary_azure_port + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.stats = stats + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.last_modified_by = last_modified_by + self.route_filter = route_filter + self.ipv6_peering_config = ipv6_peering_config + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_py3.py new file mode 100644 index 000000000000..44c0eb97c81b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteCircuit(Resource): + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The SKU. + :type sku: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitSku + :param allow_classic_operations: Allow classic operations + :type allow_classic_operations: bool + :param circuit_provisioning_state: The CircuitProvisioningState state of + the resource. + :type circuit_provisioning_state: str + :param service_provider_provisioning_state: The + ServiceProviderProvisioningState state of the resource. Possible values + are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + 'Deprovisioning' + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2017_09_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: + list[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeering] + :param service_key: The ServiceKey. + :type service_key: str + :param service_provider_notes: The ServiceProviderNotes. + :type service_provider_notes: str + :param service_provider_properties: The ServiceProviderProperties. + :type service_provider_properties: + ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitServiceProviderProperties + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, + 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, + 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, allow_classic_operations: bool=None, circuit_provisioning_state: str=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key: str=None, service_provider_notes: str=None, service_provider_properties=None, provisioning_state: str=None, gateway_manager_etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.allow_classic_operations = allow_classic_operations + self.circuit_provisioning_state = circuit_provisioning_state + self.service_provider_provisioning_state = service_provider_provisioning_state + self.authorizations = authorizations + self.peerings = peerings + self.service_key = service_key + self.service_provider_notes = service_provider_notes + self.service_provider_properties = service_provider_properties + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table.py index 804d29a2f9bb..7517e9867cfb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table.py @@ -35,10 +35,10 @@ class ExpressRouteCircuitRoutesTable(Model): 'path': {'key': 'path', 'type': 'str'}, } - def __init__(self, network=None, next_hop=None, loc_prf=None, weight=None, path=None): - super(ExpressRouteCircuitRoutesTable, self).__init__() - self.network = network - self.next_hop = next_hop - self.loc_prf = loc_prf - self.weight = weight - self.path = path + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = kwargs.get('network', None) + self.next_hop = kwargs.get('next_hop', None) + self.loc_prf = kwargs.get('loc_prf', None) + self.weight = kwargs.get('weight', None) + self.path = kwargs.get('path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table_py3.py new file mode 100644 index 000000000000..38ea85cf642d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTable(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param network: network + :type network: str + :param next_hop: nextHop + :type next_hop: str + :param loc_prf: locPrf + :type loc_prf: str + :param weight: weight. + :type weight: int + :param path: path + :type path: str + """ + + _attribute_map = { + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'loc_prf': {'key': 'locPrf', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, *, network: str=None, next_hop: str=None, loc_prf: str=None, weight: int=None, path: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = network + self.next_hop = next_hop + self.loc_prf = loc_prf + self.weight = weight + self.path = path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table_summary.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table_summary.py index 6f5f89764dd4..577c3c2edd45 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table_summary.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table_summary.py @@ -37,10 +37,10 @@ class ExpressRouteCircuitRoutesTableSummary(Model): 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, } - def __init__(self, neighbor=None, v=None, as_property=None, up_down=None, state_pfx_rcd=None): - super(ExpressRouteCircuitRoutesTableSummary, self).__init__() - self.neighbor = neighbor - self.v = v - self.as_property = as_property - self.up_down = up_down - self.state_pfx_rcd = state_pfx_rcd + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = kwargs.get('neighbor', None) + self.v = kwargs.get('v', None) + self.as_property = kwargs.get('as_property', None) + self.up_down = kwargs.get('up_down', None) + self.state_pfx_rcd = kwargs.get('state_pfx_rcd', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table_summary_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table_summary_py3.py new file mode 100644 index 000000000000..e18d0051d218 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_routes_table_summary_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTableSummary(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: Neighbor + :type neighbor: str + :param v: BGP version number spoken to the neighbor. + :type v: int + :param as_property: Autonomous system number. + :type as_property: int + :param up_down: The length of time that the BGP session has been in the + Established state, or the current status if not in the Established state. + :type up_down: str + :param state_pfx_rcd: Current state of the BGP session, and the number of + prefixes that have been received from a neighbor or peer group. + :type state_pfx_rcd: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'v': {'key': 'v', 'type': 'int'}, + 'as_property': {'key': 'as', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, + } + + def __init__(self, *, neighbor: str=None, v: int=None, as_property: int=None, up_down: str=None, state_pfx_rcd: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = neighbor + self.v = v + self.as_property = as_property + self.up_down = up_down + self.state_pfx_rcd = state_pfx_rcd diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_service_provider_properties.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_service_provider_properties.py index 7a6b4ba96061..c51e6d8d653b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_service_provider_properties.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_service_provider_properties.py @@ -29,8 +29,8 @@ class ExpressRouteCircuitServiceProviderProperties(Model): 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, } - def __init__(self, service_provider_name=None, peering_location=None, bandwidth_in_mbps=None): - super(ExpressRouteCircuitServiceProviderProperties, self).__init__() - self.service_provider_name = service_provider_name - self.peering_location = peering_location - self.bandwidth_in_mbps = bandwidth_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = kwargs.get('service_provider_name', None) + self.peering_location = kwargs.get('peering_location', None) + self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_service_provider_properties_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_service_provider_properties_py3.py new file mode 100644 index 000000000000..ea701a54c3fe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_service_provider_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitServiceProviderProperties(Model): + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :param service_provider_name: The serviceProviderName. + :type service_provider_name: str + :param peering_location: The peering location. + :type peering_location: str + :param bandwidth_in_mbps: The BandwidthInMbps. + :type bandwidth_in_mbps: int + """ + + _attribute_map = { + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + } + + def __init__(self, *, service_provider_name: str=None, peering_location: str=None, bandwidth_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = service_provider_name + self.peering_location = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_sku.py index bb23ff0b326f..71ea015622cf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_sku.py @@ -33,8 +33,8 @@ class ExpressRouteCircuitSku(Model): 'family': {'key': 'family', 'type': 'str'}, } - def __init__(self, name=None, tier=None, family=None): - super(ExpressRouteCircuitSku, self).__init__() - self.name = name - self.tier = tier - self.family = family + def __init__(self, **kwargs): + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.family = kwargs.get('family', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_sku_py3.py new file mode 100644 index 000000000000..2f878509e7b6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_sku_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitSku(Model): + """Contains SKU in an ExpressRouteCircuit. + + :param name: The name of the SKU. + :type name: str + :param tier: The tier of the SKU. Possible values are 'Standard' and + 'Premium'. Possible values include: 'Standard', 'Premium' + :type tier: str or + ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values are: 'UnlimitedData' + and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' + :type family: str or + ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, tier=None, family=None, **kwargs) -> None: + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.family = family diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_stats.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_stats.py index e26f6f7d2f74..41c45ae2b19a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_stats.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_stats.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitStats(Model): 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, } - def __init__(self, primarybytes_in=None, primarybytes_out=None, secondarybytes_in=None, secondarybytes_out=None): - super(ExpressRouteCircuitStats, self).__init__() - self.primarybytes_in = primarybytes_in - self.primarybytes_out = primarybytes_out - self.secondarybytes_in = secondarybytes_in - self.secondarybytes_out = secondarybytes_out + def __init__(self, **kwargs): + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = kwargs.get('primarybytes_in', None) + self.primarybytes_out = kwargs.get('primarybytes_out', None) + self.secondarybytes_in = kwargs.get('secondarybytes_in', None) + self.secondarybytes_out = kwargs.get('secondarybytes_out', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_stats_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_stats_py3.py new file mode 100644 index 000000000000..f78335343544 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuit_stats_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitStats(Model): + """Contains stats associated with the peering. + + :param primarybytes_in: Gets BytesIn of the peering. + :type primarybytes_in: long + :param primarybytes_out: Gets BytesOut of the peering. + :type primarybytes_out: long + :param secondarybytes_in: Gets BytesIn of the peering. + :type secondarybytes_in: long + :param secondarybytes_out: Gets BytesOut of the peering. + :type secondarybytes_out: long + """ + + _attribute_map = { + 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, + 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, + 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, + 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, + } + + def __init__(self, *, primarybytes_in: int=None, primarybytes_out: int=None, secondarybytes_in: int=None, secondarybytes_out: int=None, **kwargs) -> None: + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = primarybytes_in + self.primarybytes_out = primarybytes_out + self.secondarybytes_in = secondarybytes_in + self.secondarybytes_out = secondarybytes_out diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_arp_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_arp_table_list_result.py index 0564ea379360..ee1d0e691cc7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_arp_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_arp_table_list_result.py @@ -27,7 +27,7 @@ class ExpressRouteCircuitsArpTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsArpTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_arp_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_arp_table_list_result_py3.py new file mode 100644 index 000000000000..394004559601 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_arp_table_list_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsArpTableListResult(Model): + """Response for ListArpTable associated with the Express Route Circuits API. + + :param value: Gets list of the ARP table. + :type value: + list[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitArpTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_list_result.py index aedef95b8745..57301712950d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_list_result_py3.py new file mode 100644 index 000000000000..d5f4ecd85374 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: The list of routes table. + :type value: + list[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitRoutesTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_summary_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_summary_list_result.py index ade34ebbff65..f58294c41741 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_summary_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_summary_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_summary_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_summary_list_result_py3.py new file mode 100644 index 000000000000..482e22cbc1ff --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_circuits_routes_table_summary_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: A list of the routes table. + :type value: + list[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitRoutesTableSummary] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider.py index 096114c19a2a..43be581dba2f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider.py @@ -53,8 +53,8 @@ class ExpressRouteServiceProvider(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state=None): - super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags) - self.peering_locations = peering_locations - self.bandwidths_offered = bandwidths_offered - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ExpressRouteServiceProvider, self).__init__(**kwargs) + self.peering_locations = kwargs.get('peering_locations', None) + self.bandwidths_offered = kwargs.get('bandwidths_offered', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider_bandwidths_offered.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider_bandwidths_offered.py index 9cbba2fcfe97..b27622af42d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider_bandwidths_offered.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider_bandwidths_offered.py @@ -26,7 +26,7 @@ class ExpressRouteServiceProviderBandwidthsOffered(Model): 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, } - def __init__(self, offer_name=None, value_in_mbps=None): - super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__() - self.offer_name = offer_name - self.value_in_mbps = value_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = kwargs.get('offer_name', None) + self.value_in_mbps = kwargs.get('value_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider_bandwidths_offered_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider_bandwidths_offered_py3.py new file mode 100644 index 000000000000..88516a0dfcf8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider_bandwidths_offered_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteServiceProviderBandwidthsOffered(Model): + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :param offer_name: The OfferName. + :type offer_name: str + :param value_in_mbps: The ValueInMbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__(self, *, offer_name: str=None, value_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = offer_name + self.value_in_mbps = value_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider_py3.py new file mode 100644 index 000000000000..fca28086a42d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/express_route_service_provider_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param peering_locations: Get a list of peering locations. + :type peering_locations: list[str] + :param bandwidths_offered: Gets bandwidths offered. + :type bandwidths_offered: + list[~azure.mgmt.network.v2017_09_01.models.ExpressRouteServiceProviderBandwidthsOffered] + :param provisioning_state: Gets the provisioning state of the resource. + :type provisioning_state: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, + 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state: str=None, **kwargs) -> None: + super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.peering_locations = peering_locations + self.bandwidths_offered = bandwidths_offered + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_information.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_information.py index 640405eec9d5..af6af2c3f2ef 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_information.py @@ -15,13 +15,15 @@ class FlowLogInformation(Model): """Information on the configuration of flow log. - :param target_resource_id: The ID of the resource to configure for flow - logging. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. :type target_resource_id: str - :param storage_id: ID of the storage account which is used to store the - flow log. + :param storage_id: Required. ID of the storage account which is used to + store the flow log. :type storage_id: str - :param enabled: Flag to enable/disable flow logging. + :param enabled: Required. Flag to enable/disable flow logging. :type enabled: bool :param retention_policy: :type retention_policy: @@ -41,9 +43,9 @@ class FlowLogInformation(Model): 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, } - def __init__(self, target_resource_id, storage_id, enabled, retention_policy=None): - super(FlowLogInformation, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.enabled = enabled - self.retention_policy = retention_policy + def __init__(self, **kwargs): + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.enabled = kwargs.get('enabled', None) + self.retention_policy = kwargs.get('retention_policy', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_information_py3.py new file mode 100644 index 000000000000..943bfe3b821c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_information_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogInformation(Model): + """Information on the configuration of flow log. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. + :type target_resource_id: str + :param storage_id: Required. ID of the storage account which is used to + store the flow log. + :type storage_id: str + :param enabled: Required. Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: + :type retention_policy: + ~azure.mgmt.network.v2017_09_01.models.RetentionPolicyParameters + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, enabled: bool, retention_policy=None, **kwargs) -> None: + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.enabled = enabled + self.retention_policy = retention_policy diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_status_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_status_parameters.py index 4cd22222bb45..5a48e938f2d6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_status_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_status_parameters.py @@ -15,8 +15,10 @@ class FlowLogStatusParameters(Model): """Parameters that define a resource to query flow log status. - :param target_resource_id: The target resource where getting the flow - logging status. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class FlowLogStatusParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(FlowLogStatusParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_status_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_status_parameters_py3.py new file mode 100644 index 000000000000..0768d2495150 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/flow_log_status_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogStatusParameters(Model): + """Parameters that define a resource to query flow log status. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/frontend_ip_configuration.py index f2365e76161e..ba7a81489fa8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/frontend_ip_configuration.py @@ -85,17 +85,17 @@ class FrontendIPConfiguration(SubResource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None, zones=None): - super(FrontendIPConfiguration, self).__init__(id=id) + def __init__(self, **kwargs): + super(FrontendIPConfiguration, self).__init__(**kwargs) self.inbound_nat_rules = None self.inbound_nat_pools = None self.outbound_nat_rules = None self.load_balancing_rules = None - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.zones = zones + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..e2040c34a2b2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/frontend_ip_configuration_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class FrontendIPConfiguration(SubResource): + """Frontend IP address of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar inbound_nat_rules: Read only. Inbound rules URIs that use this + frontend IP. + :vartype inbound_nat_rules: + list[~azure.mgmt.network.v2017_09_01.models.SubResource] + :ivar inbound_nat_pools: Read only. Inbound pools URIs that use this + frontend IP. + :vartype inbound_nat_pools: + list[~azure.mgmt.network.v2017_09_01.models.SubResource] + :ivar outbound_nat_rules: Read only. Outbound rules URIs that use this + frontend IP. + :vartype outbound_nat_rules: + list[~azure.mgmt.network.v2017_09_01.models.SubResource] + :ivar load_balancing_rules: Gets load balancing rules URIs that use this + frontend IP. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_09_01.models.SubResource] + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The Private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_09_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_09_01.models.Subnet + :param public_ip_address: The reference of the Public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_09_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'inbound_nat_rules': {'readonly': True}, + 'inbound_nat_pools': {'readonly': True}, + 'outbound_nat_rules': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[SubResource]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, zones=None, **kwargs) -> None: + super(FrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.inbound_nat_rules = None + self.inbound_nat_pools = None + self.outbound_nat_rules = None + self.load_balancing_rules = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.zones = zones diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route.py index 64a53f146c0b..0b96cb661e70 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route.py @@ -54,8 +54,8 @@ class GatewayRoute(Model): 'weight': {'key': 'weight', 'type': 'int'}, } - def __init__(self): - super(GatewayRoute, self).__init__() + def __init__(self, **kwargs): + super(GatewayRoute, self).__init__(**kwargs) self.local_address = None self.network = None self.next_hop = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route_list_result.py index ad588f75f0d9..ebc4ee132e6b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route_list_result.py @@ -23,6 +23,6 @@ class GatewayRouteListResult(Model): 'value': {'key': 'value', 'type': '[GatewayRoute]'}, } - def __init__(self, value=None): - super(GatewayRouteListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route_list_result_py3.py new file mode 100644 index 000000000000..ebf447bd7698 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRouteListResult(Model): + """List of virtual network gateway routes. + + :param value: List of gateway routes + :type value: list[~azure.mgmt.network.v2017_09_01.models.GatewayRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayRoute]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route_py3.py new file mode 100644 index 000000000000..1aa3ba60605f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/gateway_route_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRoute(Model): + """Gateway routing details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The gateway's local address + :vartype local_address: str + :ivar network: The route's network prefix + :vartype network: str + :ivar next_hop: The route's next hop + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from + :vartype source_peer: str + :ivar origin: The source this route was learned from + :vartype origin: str + :ivar as_path: The route's AS path sequence + :vartype as_path: str + :ivar weight: The route's weight + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(GatewayRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_pool.py index 33e62cecbffb..a8d45a02da8a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_pool.py @@ -15,24 +15,28 @@ class InboundNatPool(SubResource): """Inbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. :type frontend_ip_configuration: ~azure.mgmt.network.v2017_09_01.models.SubResource - :param protocol: Possible values include: 'Udp', 'Tcp', 'All' + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' :type protocol: str or ~azure.mgmt.network.v2017_09_01.models.TransportProtocol - :param frontend_port_range_start: The first port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65534. + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. :type frontend_port_range_start: int - :param frontend_port_range_end: The last port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65535. + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. :type frontend_port_range_end: int - :param backend_port: The port used for internal connections on the - endpoint. Acceptable values are between 1 and 65535. + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. :type backend_port: int :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. @@ -64,13 +68,13 @@ class InboundNatPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port_range_start, frontend_port_range_end, backend_port, id=None, frontend_ip_configuration=None, provisioning_state=None, name=None, etag=None): - super(InboundNatPool, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.protocol = protocol - self.frontend_port_range_start = frontend_port_range_start - self.frontend_port_range_end = frontend_port_range_end - self.backend_port = backend_port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(InboundNatPool, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.protocol = kwargs.get('protocol', None) + self.frontend_port_range_start = kwargs.get('frontend_port_range_start', None) + self.frontend_port_range_end = kwargs.get('frontend_port_range_end', None) + self.backend_port = kwargs.get('backend_port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_pool_py3.py new file mode 100644 index 000000000000..81eec2265317 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_pool_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatPool(SubResource): + """Inbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_09_01.models.TransportProtocol + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. + :type frontend_port_range_start: int + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. + :type frontend_port_range_end: int + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port_range_start': {'required': True}, + 'frontend_port_range_end': {'required': True}, + 'backend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, + 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port_range_start: int, frontend_port_range_end: int, backend_port: int, id: str=None, frontend_ip_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatPool, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.protocol = protocol + self.frontend_port_range_start = frontend_port_range_start + self.frontend_port_range_end = frontend_port_range_end + self.backend_port = backend_port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_rule.py index d29661098116..5eccbb7d5ffd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_rule.py @@ -77,15 +77,15 @@ class InboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, protocol=None, frontend_port=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(InboundNatRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration + def __init__(self, **kwargs): + super(InboundNatRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) self.backend_ip_configuration = None - self.protocol = protocol - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_rule_py3.py new file mode 100644 index 000000000000..950e88ccd816 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/inbound_nat_rule_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatRule(SubResource): + """Inbound NAT rule of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :ivar backend_ip_configuration: A reference to a private IP address + defined on a network interface of a VM. Traffic sent to the frontend port + of each of the frontend IP configurations is forwarded to the backend IP. + :vartype backend_ip_configuration: + ~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceIPConfiguration + :param protocol: Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_09_01.models.TransportProtocol + :param frontend_port: The port for the external endpoint. Port numbers for + each rule must be unique within the Load Balancer. Acceptable values range + from 1 to 65534. + :type frontend_port: int + :param backend_port: The port used for the internal endpoint. Acceptable + values range from 1 to 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, protocol=None, frontend_port: int=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_ip_configuration = None + self.protocol = protocol + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_address_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_address_availability_result.py index f2cb36a550ec..6bcf52275711 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_address_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_address_availability_result.py @@ -27,7 +27,7 @@ class IPAddressAvailabilityResult(Model): 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, } - def __init__(self, available=None, available_ip_addresses=None): - super(IPAddressAvailabilityResult, self).__init__() - self.available = available - self.available_ip_addresses = available_ip_addresses + def __init__(self, **kwargs): + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) + self.available_ip_addresses = kwargs.get('available_ip_addresses', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_address_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_address_availability_result_py3.py new file mode 100644 index 000000000000..e5fc4340d370 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_address_availability_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPAddressAvailabilityResult(Model): + """Response for CheckIPAddressAvailability API service call. + + :param available: Private IP address availability. + :type available: bool + :param available_ip_addresses: Contains other available private IP + addresses if the asked for address is taken. + :type available_ip_addresses: list[str] + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, + } + + def __init__(self, *, available: bool=None, available_ip_addresses=None, **kwargs) -> None: + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = available + self.available_ip_addresses = available_ip_addresses diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_configuration.py index 1b350b8b30b9..e9229b69f2ea 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_configuration.py @@ -51,12 +51,12 @@ class IPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(IPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(IPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_configuration_py3.py new file mode 100644 index 000000000000..d60a431e85b5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ip_configuration_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class IPConfiguration(SubResource): + """IP configuration. + + :param id: Resource ID. + :type id: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_09_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_09_01.models.Subnet + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_09_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(IPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipsec_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipsec_policy.py index a86aa77a27d0..e7471934cd99 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipsec_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipsec_policy.py @@ -15,39 +15,41 @@ class IpsecPolicy(Model): """An IPSec Policy configuration for a virtual network gateway connection. - :param sa_life_time_seconds: The IPSec Security Association (also called - Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN - tunnel. + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. :type sa_life_time_seconds: int - :param sa_data_size_kilobytes: The IPSec Security Association (also called - Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN - tunnel. + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. :type sa_data_size_kilobytes: int - :param ipsec_encryption: The IPSec encryption algorithm (IKE phase 1). - Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', - 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' :type ipsec_encryption: str or ~azure.mgmt.network.v2017_09_01.models.IpsecEncryption - :param ipsec_integrity: The IPSec integrity algorithm (IKE phase 1). - Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256' :type ipsec_integrity: str or ~azure.mgmt.network.v2017_09_01.models.IpsecIntegrity - :param ike_encryption: The IKE encryption algorithm (IKE phase 2). - Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' :type ike_encryption: str or ~azure.mgmt.network.v2017_09_01.models.IkeEncryption - :param ike_integrity: The IKE integrity algorithm (IKE phase 2). Possible - values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' :type ike_integrity: str or ~azure.mgmt.network.v2017_09_01.models.IkeIntegrity - :param dh_group: The DH Groups used in IKE Phase 1 for initial SA. - Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' :type dh_group: str or ~azure.mgmt.network.v2017_09_01.models.DhGroup - :param pfs_group: The DH Groups used in IKE Phase 2 for new child SA. - Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', - 'ECP384', 'PFS24' + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' :type pfs_group: str or ~azure.mgmt.network.v2017_09_01.models.PfsGroup """ @@ -73,13 +75,13 @@ class IpsecPolicy(Model): 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, } - def __init__(self, sa_life_time_seconds, sa_data_size_kilobytes, ipsec_encryption, ipsec_integrity, ike_encryption, ike_integrity, dh_group, pfs_group): - super(IpsecPolicy, self).__init__() - self.sa_life_time_seconds = sa_life_time_seconds - self.sa_data_size_kilobytes = sa_data_size_kilobytes - self.ipsec_encryption = ipsec_encryption - self.ipsec_integrity = ipsec_integrity - self.ike_encryption = ike_encryption - self.ike_integrity = ike_integrity - self.dh_group = dh_group - self.pfs_group = pfs_group + def __init__(self, **kwargs): + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = kwargs.get('sa_life_time_seconds', None) + self.sa_data_size_kilobytes = kwargs.get('sa_data_size_kilobytes', None) + self.ipsec_encryption = kwargs.get('ipsec_encryption', None) + self.ipsec_integrity = kwargs.get('ipsec_integrity', None) + self.ike_encryption = kwargs.get('ike_encryption', None) + self.ike_integrity = kwargs.get('ike_integrity', None) + self.dh_group = kwargs.get('dh_group', None) + self.pfs_group = kwargs.get('pfs_group', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipsec_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipsec_policy_py3.py new file mode 100644 index 000000000000..b077999e39d2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipsec_policy_py3.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IpsecPolicy(Model): + """An IPSec Policy configuration for a virtual network gateway connection. + + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. + :type sa_life_time_seconds: int + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. + :type sa_data_size_kilobytes: int + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :type ipsec_encryption: str or + ~azure.mgmt.network.v2017_09_01.models.IpsecEncryption + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + 'GCMAES192', 'GCMAES256' + :type ipsec_integrity: str or + ~azure.mgmt.network.v2017_09_01.models.IpsecIntegrity + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :type ike_encryption: str or + ~azure.mgmt.network.v2017_09_01.models.IkeEncryption + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :type ike_integrity: str or + ~azure.mgmt.network.v2017_09_01.models.IkeIntegrity + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + :type dh_group: str or ~azure.mgmt.network.v2017_09_01.models.DhGroup + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' + :type pfs_group: str or ~azure.mgmt.network.v2017_09_01.models.PfsGroup + """ + + _validation = { + 'sa_life_time_seconds': {'required': True}, + 'sa_data_size_kilobytes': {'required': True}, + 'ipsec_encryption': {'required': True}, + 'ipsec_integrity': {'required': True}, + 'ike_encryption': {'required': True}, + 'ike_integrity': {'required': True}, + 'dh_group': {'required': True}, + 'pfs_group': {'required': True}, + } + + _attribute_map = { + 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, + 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, + 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, + 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, + 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, + 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, + 'dh_group': {'key': 'dhGroup', 'type': 'str'}, + 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, + } + + def __init__(self, *, sa_life_time_seconds: int, sa_data_size_kilobytes: int, ipsec_encryption, ipsec_integrity, ike_encryption, ike_integrity, dh_group, pfs_group, **kwargs) -> None: + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = sa_life_time_seconds + self.sa_data_size_kilobytes = sa_data_size_kilobytes + self.ipsec_encryption = ipsec_encryption + self.ipsec_integrity = ipsec_integrity + self.ike_encryption = ike_encryption + self.ike_integrity = ike_integrity + self.dh_group = dh_group + self.pfs_group = pfs_group diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipv6_express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipv6_express_route_circuit_peering_config.py index 1fa5ead2f79b..9041b822f727 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipv6_express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipv6_express_route_circuit_peering_config.py @@ -38,10 +38,10 @@ class Ipv6ExpressRouteCircuitPeeringConfig(Model): 'state': {'key': 'state', 'type': 'str'}, } - def __init__(self, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, microsoft_peering_config=None, route_filter=None, state=None): - super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__() - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.microsoft_peering_config = microsoft_peering_config - self.route_filter = route_filter - self.state = state + def __init__(self, **kwargs): + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.route_filter = kwargs.get('route_filter', None) + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipv6_express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipv6_express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..3c8f2be7f122 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipv6_express_route_circuit_peering_config_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv6ExpressRouteCircuitPeeringConfig(Model): + """Contains IPv6 peering config. + + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2017_09_01.models.RouteFilter + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeeringState + """ + + _attribute_map = { + 'primary_peer_address_prefix': {'key': 'primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'secondaryPeerAddressPrefix', 'type': 'str'}, + 'microsoft_peering_config': {'key': 'microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'route_filter': {'key': 'routeFilter', 'type': 'RouteFilter'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, microsoft_peering_config=None, route_filter=None, state=None, **kwargs) -> None: + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.microsoft_peering_config = microsoft_peering_config + self.route_filter = route_filter + self.state = state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer.py index 8d1f89dfeb5c..584d9d973773 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer.py @@ -100,16 +100,16 @@ class LoadBalancer(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(LoadBalancer, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pools = backend_address_pools - self.load_balancing_rules = load_balancing_rules - self.probes = probes - self.inbound_nat_rules = inbound_nat_rules - self.inbound_nat_pools = inbound_nat_pools - self.outbound_nat_rules = outbound_nat_rules - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancer, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.load_balancing_rules = kwargs.get('load_balancing_rules', None) + self.probes = kwargs.get('probes', None) + self.inbound_nat_rules = kwargs.get('inbound_nat_rules', None) + self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) + self.outbound_nat_rules = kwargs.get('outbound_nat_rules', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer_py3.py new file mode 100644 index 000000000000..a851ea4ae200 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer_py3.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LoadBalancer(Resource): + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The load balancer SKU. + :type sku: ~azure.mgmt.network.v2017_09_01.models.LoadBalancerSku + :param frontend_ip_configurations: Object representing the frontend IPs to + be used for the load balancer + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_09_01.models.FrontendIPConfiguration] + :param backend_address_pools: Collection of backend address pools used by + a load balancer + :type backend_address_pools: + list[~azure.mgmt.network.v2017_09_01.models.BackendAddressPool] + :param load_balancing_rules: Object collection representing the load + balancing rules Gets the provisioning + :type load_balancing_rules: + list[~azure.mgmt.network.v2017_09_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer + :type probes: list[~azure.mgmt.network.v2017_09_01.models.Probe] + :param inbound_nat_rules: Collection of inbound NAT Rules used by a load + balancer. Defining inbound NAT rules on your load balancer is mutually + exclusive with defining an inbound NAT pool. Inbound NAT pools are + referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an Inbound NAT pool. They + have to reference individual inbound NAT rules. + :type inbound_nat_rules: + list[~azure.mgmt.network.v2017_09_01.models.InboundNatRule] + :param inbound_nat_pools: Defines an external port range for inbound NAT + to a single backend port on NICs associated with a load balancer. Inbound + NAT rules are created automatically for each NIC associated with the Load + Balancer using an external port from this range. Defining an Inbound NAT + pool on your Load Balancer is mutually exclusive with defining inbound Nat + rules. Inbound NAT pools are referenced from virtual machine scale sets. + NICs that are associated with individual virtual machines cannot reference + an inbound NAT pool. They have to reference individual inbound NAT rules. + :type inbound_nat_pools: + list[~azure.mgmt.network.v2017_09_01.models.InboundNatPool] + :param outbound_nat_rules: The outbound NAT rules. + :type outbound_nat_rules: + list[~azure.mgmt.network.v2017_09_01.models.OutboundNatRule] + :param resource_guid: The resource GUID property of the load balancer + resource. + :type resource_guid: str + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'LoadBalancerSku'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, + 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[OutboundNatRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancer, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pools = backend_address_pools + self.load_balancing_rules = load_balancing_rules + self.probes = probes + self.inbound_nat_rules = inbound_nat_rules + self.inbound_nat_pools = inbound_nat_pools + self.outbound_nat_rules = outbound_nat_rules + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer_sku.py index 463fceebfda3..484e2596ca92 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer_sku.py @@ -25,6 +25,6 @@ class LoadBalancerSku(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - super(LoadBalancerSku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer_sku_py3.py new file mode 100644 index 000000000000..dbef51dcc3a9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancer_sku_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LoadBalancerSku(Model): + """SKU of a load balancer. + + :param name: Name of a load balancer SKU. Possible values include: + 'Basic', 'Standard' + :type name: str or + ~azure.mgmt.network.v2017_09_01.models.LoadBalancerSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancing_rule.py index 8a682d3021ed..6c59ea6c55c7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancing_rule.py @@ -15,6 +15,8 @@ class LoadBalancingRule(SubResource): """A load balancing rule for a load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. @@ -27,7 +29,7 @@ class LoadBalancingRule(SubResource): :param probe: The reference of the load balancer probe used by the load balancing rule. :type probe: ~azure.mgmt.network.v2017_09_01.models.SubResource - :param protocol: Possible values include: 'Udp', 'Tcp', 'All' + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' :type protocol: str or ~azure.mgmt.network.v2017_09_01.models.TransportProtocol :param load_distribution: The load distribution policy for this rule. @@ -35,9 +37,9 @@ class LoadBalancingRule(SubResource): Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' :type load_distribution: str or ~azure.mgmt.network.v2017_09_01.models.LoadDistribution - :param frontend_port: The port for the external endpoint. Port numbers for - each rule must be unique within the Load Balancer. Acceptable values are - between 0 and 65534. Note that value 0 enables "Any Port" + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 0 and 65534. Note that value 0 enables "Any Port" :type frontend_port: int :param backend_port: The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 @@ -90,18 +92,18 @@ class LoadBalancingRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port, id=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, disable_outbound_snat=None, provisioning_state=None, name=None, etag=None): - super(LoadBalancingRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.backend_address_pool = backend_address_pool - self.probe = probe - self.protocol = protocol - self.load_distribution = load_distribution - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.disable_outbound_snat = disable_outbound_snat - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancingRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.probe = kwargs.get('probe', None) + self.protocol = kwargs.get('protocol', None) + self.load_distribution = kwargs.get('load_distribution', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.disable_outbound_snat = kwargs.get('disable_outbound_snat', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancing_rule_py3.py new file mode 100644 index 000000000000..ce6b5b7b8982 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/load_balancing_rule_py3.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class LoadBalancingRule(SubResource): + """A load balancing rule for a load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param backend_address_pool: A reference to a pool of DIPs. Inbound + traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param probe: The reference of the load balancer probe used by the load + balancing rule. + :type probe: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_09_01.models.TransportProtocol + :param load_distribution: The load distribution policy for this rule. + Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + :type load_distribution: str or + ~azure.mgmt.network.v2017_09_01.models.LoadDistribution + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 0 and 65534. Note that value 0 enables "Any Port" + :type frontend_port: int + :param backend_port: The port used for internal connections on the + endpoint. Acceptable values are between 0 and 65535. Note that value 0 + enables "Any Port" + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param disable_outbound_snat: Configures SNAT for the VMs in the backend + pool to use the publicIP address specified in the frontend of the load + balancing rule. + :type disable_outbound_snat: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'disable_outbound_snat': {'key': 'properties.disableOutboundSnat', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port: int, id: str=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, disable_outbound_snat: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancingRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_address_pool = backend_address_pool + self.probe = probe + self.protocol = protocol + self.load_distribution = load_distribution + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.disable_outbound_snat = disable_outbound_snat + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/local_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/local_network_gateway.py index 9a9d07beaf94..646cf84db576 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/local_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/local_network_gateway.py @@ -67,11 +67,11 @@ class LocalNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, local_network_address_space=None, gateway_ip_address=None, bgp_settings=None, resource_guid=None, etag=None): - super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.local_network_address_space = local_network_address_space - self.gateway_ip_address = gateway_ip_address - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(LocalNetworkGateway, self).__init__(**kwargs) + self.local_network_address_space = kwargs.get('local_network_address_space', None) + self.gateway_ip_address = kwargs.get('gateway_ip_address', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/local_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/local_network_gateway_py3.py new file mode 100644 index 000000000000..61b2b4958ee6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/local_network_gateway_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LocalNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param local_network_address_space: Local network site address space. + :type local_network_address_space: + ~azure.mgmt.network.v2017_09_01.models.AddressSpace + :param gateway_ip_address: IP address of local network gateway. + :type gateway_ip_address: str + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2017_09_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + LocalNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', + and 'Failed'. + :vartype provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, + 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, local_network_address_space=None, gateway_ip_address: str=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.local_network_address_space = local_network_address_space + self.gateway_ip_address = gateway_ip_address + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/log_specification.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/log_specification.py index 2386ea5f799f..ab592992d904 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/log_specification.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/log_specification.py @@ -29,8 +29,8 @@ class LogSpecification(Model): 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, blob_duration=None): - super(LogSpecification, self).__init__() - self.name = name - self.display_name = display_name - self.blob_duration = blob_duration + def __init__(self, **kwargs): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/log_specification_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/log_specification_py3.py new file mode 100644 index 000000000000..6184811d393e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/log_specification_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LogSpecification(Model): + """Description of logging specification. + + :param name: The name of the specification. + :type name: str + :param display_name: The display name of the specification. + :type display_name: str + :param blob_duration: Duration of the blob. + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str=None, **kwargs) -> None: + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/metric_specification.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/metric_specification.py index 12432a256747..32a3542c356a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/metric_specification.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/metric_specification.py @@ -64,19 +64,19 @@ class MetricSpecification(Model): 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, display_description=None, unit=None, aggregation_type=None, availabilities=None, enable_regional_mdm_account=None, fill_gap_with_zero=None, metric_filter_pattern=None, dimensions=None, is_internal=None, source_mdm_account=None, source_mdm_namespace=None, resource_id_dimension_name_override=None): - super(MetricSpecification, self).__init__() - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.aggregation_type = aggregation_type - self.availabilities = availabilities - self.enable_regional_mdm_account = enable_regional_mdm_account - self.fill_gap_with_zero = fill_gap_with_zero - self.metric_filter_pattern = metric_filter_pattern - self.dimensions = dimensions - self.is_internal = is_internal - self.source_mdm_account = source_mdm_account - self.source_mdm_namespace = source_mdm_namespace - self.resource_id_dimension_name_override = resource_id_dimension_name_override + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.availabilities = kwargs.get('availabilities', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.metric_filter_pattern = kwargs.get('metric_filter_pattern', None) + self.dimensions = kwargs.get('dimensions', None) + self.is_internal = kwargs.get('is_internal', None) + self.source_mdm_account = kwargs.get('source_mdm_account', None) + self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/metric_specification_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/metric_specification_py3.py new file mode 100644 index 000000000000..3a4d4e17fa0c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/metric_specification_py3.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricSpecification(Model): + """Description of metrics specification. + + :param name: The name of the metric. + :type name: str + :param display_name: The display name of the metric. + :type display_name: str + :param display_description: The description of the metric. + :type display_description: str + :param unit: Units the metric to be displayed in. + :type unit: str + :param aggregation_type: The aggregation type. + :type aggregation_type: str + :param availabilities: List of availability. + :type availabilities: + list[~azure.mgmt.network.v2017_09_01.models.Availability] + :param enable_regional_mdm_account: Whether regional MDM account enabled. + :type enable_regional_mdm_account: bool + :param fill_gap_with_zero: Whether gaps would be filled with zeros. + :type fill_gap_with_zero: bool + :param metric_filter_pattern: Pattern for the filter of the metric. + :type metric_filter_pattern: str + :param dimensions: List of dimensions. + :type dimensions: list[~azure.mgmt.network.v2017_09_01.models.Dimension] + :param is_internal: Whether the metric is internal. + :type is_internal: bool + :param source_mdm_account: The source MDM account. + :type source_mdm_account: str + :param source_mdm_namespace: The source MDM namespace. + :type source_mdm_namespace: str + :param resource_id_dimension_name_override: The resource Id dimension name + override. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[Availability]'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, availabilities=None, enable_regional_mdm_account: bool=None, fill_gap_with_zero: bool=None, metric_filter_pattern: str=None, dimensions=None, is_internal: bool=None, source_mdm_account: str=None, source_mdm_namespace: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.availabilities = availabilities + self.enable_regional_mdm_account = enable_regional_mdm_account + self.fill_gap_with_zero = fill_gap_with_zero + self.metric_filter_pattern = metric_filter_pattern + self.dimensions = dimensions + self.is_internal = is_internal + self.source_mdm_account = source_mdm_account + self.source_mdm_namespace = source_mdm_namespace + self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface.py index 481642698094..4fe230487bf7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface.py @@ -87,16 +87,16 @@ class NetworkInterface(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address=None, primary=None, enable_accelerated_networking=None, enable_ip_forwarding=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkInterface, self).__init__(id=id, location=location, tags=tags) - self.virtual_machine = virtual_machine - self.network_security_group = network_security_group - self.ip_configurations = ip_configurations - self.dns_settings = dns_settings - self.mac_address = mac_address - self.primary = primary - self.enable_accelerated_networking = enable_accelerated_networking - self.enable_ip_forwarding = enable_ip_forwarding - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.virtual_machine = kwargs.get('virtual_machine', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.mac_address = kwargs.get('mac_address', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_association.py index 391f93d931e1..cb9699afd3c8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_association.py @@ -34,7 +34,7 @@ class NetworkInterfaceAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(NetworkInterfaceAssociation, self).__init__() + def __init__(self, **kwargs): + super(NetworkInterfaceAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_association_py3.py new file mode 100644 index 000000000000..71a5c9242548 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Network interface ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2017_09_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(NetworkInterfaceAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_dns_settings.py index 675a4a1eb08a..b6ee0ff40d51 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_dns_settings.py @@ -46,10 +46,10 @@ class NetworkInterfaceDnsSettings(Model): 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, } - def __init__(self, dns_servers=None, applied_dns_servers=None, internal_dns_name_label=None, internal_fqdn=None, internal_domain_name_suffix=None): - super(NetworkInterfaceDnsSettings, self).__init__() - self.dns_servers = dns_servers - self.applied_dns_servers = applied_dns_servers - self.internal_dns_name_label = internal_dns_name_label - self.internal_fqdn = internal_fqdn - self.internal_domain_name_suffix = internal_domain_name_suffix + def __init__(self, **kwargs): + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + self.applied_dns_servers = kwargs.get('applied_dns_servers', None) + self.internal_dns_name_label = kwargs.get('internal_dns_name_label', None) + self.internal_fqdn = kwargs.get('internal_fqdn', None) + self.internal_domain_name_suffix = kwargs.get('internal_domain_name_suffix', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_dns_settings_py3.py new file mode 100644 index 000000000000..ccdcc937def8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_dns_settings_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceDnsSettings(Model): + """DNS settings of a network interface. + + :param dns_servers: List of DNS servers IP addresses. Use + 'AzureProvidedDNS' to switch to azure provided DNS resolution. + 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + only value in dnsServers collection. + :type dns_servers: list[str] + :param applied_dns_servers: If the VM that uses this NIC is part of an + Availability Set, then this list will have the union of all DNS servers + from all NICs that are part of the Availability Set. This property is what + is configured on each of those VMs. + :type applied_dns_servers: list[str] + :param internal_dns_name_label: Relative DNS name for this NIC used for + internal communications between VMs in the same virtual network. + :type internal_dns_name_label: str + :param internal_fqdn: Fully qualified DNS name supporting internal + communications between VMs in the same virtual network. + :type internal_fqdn: str + :param internal_domain_name_suffix: Even if internalDnsNameLabel is not + specified, a DNS entry is created for the primary NIC of the VM. This DNS + name can be constructed by concatenating the VM name with the value of + internalDomainNameSuffix. + :type internal_domain_name_suffix: str + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, + 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, + } + + def __init__(self, *, dns_servers=None, applied_dns_servers=None, internal_dns_name_label: str=None, internal_fqdn: str=None, internal_domain_name_suffix: str=None, **kwargs) -> None: + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers + self.applied_dns_servers = applied_dns_servers + self.internal_dns_name_label = internal_dns_name_label + self.internal_fqdn = internal_fqdn + self.internal_domain_name_suffix = internal_domain_name_suffix diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_ip_configuration.py index a4a31e868f12..37b60fa15c58 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_ip_configuration.py @@ -83,18 +83,18 @@ class NetworkInterfaceIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary=None, public_ip_address=None, application_security_groups=None, provisioning_state=None, name=None, etag=None): - super(NetworkInterfaceIPConfiguration, self).__init__(id=id) - self.application_gateway_backend_address_pools = application_gateway_backend_address_pools - self.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.private_ip_address_version = private_ip_address_version - self.subnet = subnet - self.primary = primary - self.public_ip_address = public_ip_address - self.application_security_groups = application_security_groups - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterfaceIPConfiguration, self).__init__(**kwargs) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_rules = kwargs.get('load_balancer_inbound_nat_rules', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.application_security_groups = kwargs.get('application_security_groups', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_ip_configuration_py3.py new file mode 100644 index 000000000000..f8cdcfe99340 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_ip_configuration_py3.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class NetworkInterfaceIPConfiguration(SubResource): + """IPConfiguration in a network interface. + + :param id: Resource ID. + :type id: str + :param application_gateway_backend_address_pools: The reference of + ApplicationGatewayBackendAddressPool resource. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendAddressPool] + :param load_balancer_backend_address_pools: The reference of + LoadBalancerBackendAddressPool resource. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2017_09_01.models.BackendAddressPool] + :param load_balancer_inbound_nat_rules: A list of references of + LoadBalancerInboundNatRules. + :type load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2017_09_01.models.InboundNatRule] + :param private_ip_address: Private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: Defines how a private IP address is + assigned. Possible values are: 'Static' and 'Dynamic'. Possible values + include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_09_01.models.IPAllocationMethod + :param private_ip_address_version: Available from Api-Version 2016-03-30 + onwards, it represents whether the specific ipconfiguration is IPv4 or + IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.network.v2017_09_01.models.IPVersion + :param subnet: Subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.network.v2017_09_01.models.Subnet + :param primary: Gets whether this is a primary customer address on the + network interface. + :type primary: bool + :param public_ip_address: Public IP address bound to the IP configuration. + :type public_ip_address: + ~azure.mgmt.network.v2017_09_01.models.PublicIPAddress + :param application_security_groups: Application security groups in which + the IP configuration is included. + :type application_security_groups: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroup] + :param provisioning_state: The provisioning state of the network interface + IP configuration. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'application_security_groups': {'key': 'properties.applicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address: str=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary: bool=None, public_ip_address=None, application_security_groups=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterfaceIPConfiguration, self).__init__(id=id, **kwargs) + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.private_ip_address_version = private_ip_address_version + self.subnet = subnet + self.primary = primary + self.public_ip_address = public_ip_address + self.application_security_groups = application_security_groups + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_py3.py new file mode 100644 index 000000000000..020827162777 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_interface_py3.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkInterface(Resource): + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param virtual_machine: The reference of a virtual machine. + :type virtual_machine: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroup + :param ip_configurations: A list of IPConfigurations of the network + interface. + :type ip_configurations: + list[~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceIPConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: + ~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceDnsSettings + :param mac_address: The MAC address of the network interface. + :type mac_address: str + :param primary: Gets whether this is a primary network interface on a + virtual machine. + :type primary: bool + :param enable_accelerated_networking: If the network interface is + accelerated networking enabled. + :type enable_accelerated_networking: bool + :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on + this network interface. + :type enable_ip_forwarding: bool + :param resource_guid: The resource GUID property of the network interface + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, + 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address: str=None, primary: bool=None, enable_accelerated_networking: bool=None, enable_ip_forwarding: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterface, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.virtual_machine = virtual_machine + self.network_security_group = network_security_group + self.ip_configurations = ip_configurations + self.dns_settings = dns_settings + self.mac_address = mac_address + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.enable_ip_forwarding = enable_ip_forwarding + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_management_client_enums.py index efb1265d2875..973e75fb5ce8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_management_client_enums.py @@ -12,45 +12,45 @@ from enum import Enum -class TransportProtocol(Enum): +class TransportProtocol(str, Enum): udp = "Udp" tcp = "Tcp" all = "All" -class IPAllocationMethod(Enum): +class IPAllocationMethod(str, Enum): static = "Static" dynamic = "Dynamic" -class IPVersion(Enum): +class IPVersion(str, Enum): ipv4 = "IPv4" ipv6 = "IPv6" -class SecurityRuleProtocol(Enum): +class SecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" asterisk = "*" -class SecurityRuleAccess(Enum): +class SecurityRuleAccess(str, Enum): allow = "Allow" deny = "Deny" -class SecurityRuleDirection(Enum): +class SecurityRuleDirection(str, Enum): inbound = "Inbound" outbound = "Outbound" -class RouteNextHopType(Enum): +class RouteNextHopType(str, Enum): virtual_network_gateway = "VirtualNetworkGateway" vnet_local = "VnetLocal" @@ -59,25 +59,25 @@ class RouteNextHopType(Enum): none = "None" -class PublicIPAddressSkuName(Enum): +class PublicIPAddressSkuName(str, Enum): basic = "Basic" standard = "Standard" -class ApplicationGatewayProtocol(Enum): +class ApplicationGatewayProtocol(str, Enum): http = "Http" https = "Https" -class ApplicationGatewayCookieBasedAffinity(Enum): +class ApplicationGatewayCookieBasedAffinity(str, Enum): enabled = "Enabled" disabled = "Disabled" -class ApplicationGatewayBackendHealthServerHealth(Enum): +class ApplicationGatewayBackendHealthServerHealth(str, Enum): unknown = "Unknown" up = "Up" @@ -86,7 +86,7 @@ class ApplicationGatewayBackendHealthServerHealth(Enum): draining = "Draining" -class ApplicationGatewaySkuName(Enum): +class ApplicationGatewaySkuName(str, Enum): standard_small = "Standard_Small" standard_medium = "Standard_Medium" @@ -95,33 +95,33 @@ class ApplicationGatewaySkuName(Enum): waf_large = "WAF_Large" -class ApplicationGatewayTier(Enum): +class ApplicationGatewayTier(str, Enum): standard = "Standard" waf = "WAF" -class ApplicationGatewaySslProtocol(Enum): +class ApplicationGatewaySslProtocol(str, Enum): tl_sv1_0 = "TLSv1_0" tl_sv1_1 = "TLSv1_1" tl_sv1_2 = "TLSv1_2" -class ApplicationGatewaySslPolicyType(Enum): +class ApplicationGatewaySslPolicyType(str, Enum): predefined = "Predefined" custom = "Custom" -class ApplicationGatewaySslPolicyName(Enum): +class ApplicationGatewaySslPolicyName(str, Enum): app_gw_ssl_policy20150501 = "AppGwSslPolicy20150501" app_gw_ssl_policy20170401 = "AppGwSslPolicy20170401" app_gw_ssl_policy20170401_s = "AppGwSslPolicy20170401S" -class ApplicationGatewaySslCipherSuite(Enum): +class ApplicationGatewaySslCipherSuite(str, Enum): tls_ecdhe_rsa_with_aes_256_cbc_sha384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" tls_ecdhe_rsa_with_aes_128_cbc_sha256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" @@ -150,13 +150,13 @@ class ApplicationGatewaySslCipherSuite(Enum): tls_rsa_with_3_des_ede_cbc_sha = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" -class ApplicationGatewayRequestRoutingRuleType(Enum): +class ApplicationGatewayRequestRoutingRuleType(str, Enum): basic = "Basic" path_based_routing = "PathBasedRouting" -class ApplicationGatewayRedirectType(Enum): +class ApplicationGatewayRedirectType(str, Enum): permanent = "Permanent" found = "Found" @@ -164,7 +164,7 @@ class ApplicationGatewayRedirectType(Enum): temporary = "Temporary" -class ApplicationGatewayOperationalState(Enum): +class ApplicationGatewayOperationalState(str, Enum): stopped = "Stopped" starting = "Starting" @@ -172,19 +172,19 @@ class ApplicationGatewayOperationalState(Enum): stopping = "Stopping" -class ApplicationGatewayFirewallMode(Enum): +class ApplicationGatewayFirewallMode(str, Enum): detection = "Detection" prevention = "Prevention" -class AuthorizationUseStatus(Enum): +class AuthorizationUseStatus(str, Enum): available = "Available" in_use = "InUse" -class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(str, Enum): not_configured = "NotConfigured" configuring = "Configuring" @@ -192,38 +192,38 @@ class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): validation_needed = "ValidationNeeded" -class Access(Enum): +class Access(str, Enum): allow = "Allow" deny = "Deny" -class ExpressRouteCircuitPeeringType(Enum): +class ExpressRouteCircuitPeeringType(str, Enum): azure_public_peering = "AzurePublicPeering" azure_private_peering = "AzurePrivatePeering" microsoft_peering = "MicrosoftPeering" -class ExpressRouteCircuitPeeringState(Enum): +class ExpressRouteCircuitPeeringState(str, Enum): disabled = "Disabled" enabled = "Enabled" -class ExpressRouteCircuitSkuTier(Enum): +class ExpressRouteCircuitSkuTier(str, Enum): standard = "Standard" premium = "Premium" -class ExpressRouteCircuitSkuFamily(Enum): +class ExpressRouteCircuitSkuFamily(str, Enum): unlimited_data = "UnlimitedData" metered_data = "MeteredData" -class ServiceProviderProvisioningState(Enum): +class ServiceProviderProvisioningState(str, Enum): not_provisioned = "NotProvisioned" provisioning = "Provisioning" @@ -231,40 +231,40 @@ class ServiceProviderProvisioningState(Enum): deprovisioning = "Deprovisioning" -class LoadBalancerSkuName(Enum): +class LoadBalancerSkuName(str, Enum): basic = "Basic" standard = "Standard" -class LoadDistribution(Enum): +class LoadDistribution(str, Enum): default = "Default" source_ip = "SourceIP" source_ip_protocol = "SourceIPProtocol" -class ProbeProtocol(Enum): +class ProbeProtocol(str, Enum): http = "Http" tcp = "Tcp" -class NetworkOperationStatus(Enum): +class NetworkOperationStatus(str, Enum): in_progress = "InProgress" succeeded = "Succeeded" failed = "Failed" -class EffectiveSecurityRuleProtocol(Enum): +class EffectiveSecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" all = "All" -class EffectiveRouteSource(Enum): +class EffectiveRouteSource(str, Enum): unknown = "Unknown" user = "User" @@ -272,13 +272,13 @@ class EffectiveRouteSource(Enum): default = "Default" -class EffectiveRouteState(Enum): +class EffectiveRouteState(str, Enum): active = "Active" invalid = "Invalid" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): succeeded = "Succeeded" updating = "Updating" @@ -286,25 +286,25 @@ class ProvisioningState(Enum): failed = "Failed" -class AssociationType(Enum): +class AssociationType(str, Enum): associated = "Associated" contains = "Contains" -class Direction(Enum): +class Direction(str, Enum): inbound = "Inbound" outbound = "Outbound" -class Protocol(Enum): +class Protocol(str, Enum): tcp = "TCP" udp = "UDP" -class NextHopType(Enum): +class NextHopType(str, Enum): internet = "Internet" virtual_appliance = "VirtualAppliance" @@ -314,14 +314,14 @@ class NextHopType(Enum): none = "None" -class PcProtocol(Enum): +class PcProtocol(str, Enum): tcp = "TCP" udp = "UDP" any = "Any" -class PcStatus(Enum): +class PcStatus(str, Enum): not_started = "NotStarted" running = "Running" @@ -330,7 +330,7 @@ class PcStatus(Enum): unknown = "Unknown" -class PcError(Enum): +class PcError(str, Enum): internal_error = "InternalError" agent_stopped = "AgentStopped" @@ -339,20 +339,20 @@ class PcError(Enum): storage_failed = "StorageFailed" -class Origin(Enum): +class Origin(str, Enum): local = "Local" inbound = "Inbound" outbound = "Outbound" -class Severity(Enum): +class Severity(str, Enum): error = "Error" warning = "Warning" -class IssueType(Enum): +class IssueType(str, Enum): unknown = "Unknown" agent_stopped = "AgentStopped" @@ -365,7 +365,7 @@ class IssueType(Enum): platform = "Platform" -class ConnectionStatus(Enum): +class ConnectionStatus(str, Enum): unknown = "Unknown" connected = "Connected" @@ -373,26 +373,26 @@ class ConnectionStatus(Enum): degraded = "Degraded" -class VirtualNetworkPeeringState(Enum): +class VirtualNetworkPeeringState(str, Enum): initiated = "Initiated" connected = "Connected" disconnected = "Disconnected" -class VirtualNetworkGatewayType(Enum): +class VirtualNetworkGatewayType(str, Enum): vpn = "Vpn" express_route = "ExpressRoute" -class VpnType(Enum): +class VpnType(str, Enum): policy_based = "PolicyBased" route_based = "RouteBased" -class VirtualNetworkGatewaySkuName(Enum): +class VirtualNetworkGatewaySkuName(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -403,7 +403,7 @@ class VirtualNetworkGatewaySkuName(Enum): vpn_gw3 = "VpnGw3" -class VirtualNetworkGatewaySkuTier(Enum): +class VirtualNetworkGatewaySkuTier(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -414,13 +414,13 @@ class VirtualNetworkGatewaySkuTier(Enum): vpn_gw3 = "VpnGw3" -class VpnClientProtocol(Enum): +class VpnClientProtocol(str, Enum): ike_v2 = "IkeV2" sstp = "SSTP" -class BgpPeerState(Enum): +class BgpPeerState(str, Enum): unknown = "Unknown" stopped = "Stopped" @@ -429,19 +429,19 @@ class BgpPeerState(Enum): connected = "Connected" -class ProcessorArchitecture(Enum): +class ProcessorArchitecture(str, Enum): amd64 = "Amd64" x86 = "X86" -class AuthenticationMethod(Enum): +class AuthenticationMethod(str, Enum): eaptls = "EAPTLS" eapmscha_pv2 = "EAPMSCHAPv2" -class VirtualNetworkGatewayConnectionStatus(Enum): +class VirtualNetworkGatewayConnectionStatus(str, Enum): unknown = "Unknown" connecting = "Connecting" @@ -449,7 +449,7 @@ class VirtualNetworkGatewayConnectionStatus(Enum): not_connected = "NotConnected" -class VirtualNetworkGatewayConnectionType(Enum): +class VirtualNetworkGatewayConnectionType(str, Enum): ipsec = "IPsec" vnet2_vnet = "Vnet2Vnet" @@ -457,7 +457,7 @@ class VirtualNetworkGatewayConnectionType(Enum): vpn_client = "VPNClient" -class IpsecEncryption(Enum): +class IpsecEncryption(str, Enum): none = "None" des = "DES" @@ -470,7 +470,7 @@ class IpsecEncryption(Enum): gcmaes256 = "GCMAES256" -class IpsecIntegrity(Enum): +class IpsecIntegrity(str, Enum): md5 = "MD5" sha1 = "SHA1" @@ -480,7 +480,7 @@ class IpsecIntegrity(Enum): gcmaes256 = "GCMAES256" -class IkeEncryption(Enum): +class IkeEncryption(str, Enum): des = "DES" des3 = "DES3" @@ -489,7 +489,7 @@ class IkeEncryption(Enum): aes256 = "AES256" -class IkeIntegrity(Enum): +class IkeIntegrity(str, Enum): md5 = "MD5" sha1 = "SHA1" @@ -497,7 +497,7 @@ class IkeIntegrity(Enum): sha384 = "SHA384" -class DhGroup(Enum): +class DhGroup(str, Enum): none = "None" dh_group1 = "DHGroup1" @@ -509,7 +509,7 @@ class DhGroup(Enum): dh_group24 = "DHGroup24" -class PfsGroup(Enum): +class PfsGroup(str, Enum): none = "None" pfs1 = "PFS1" diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_security_group.py index 3d5a991d08f1..db76e2fda668 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_security_group.py @@ -75,12 +75,12 @@ class NetworkSecurityGroup(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, security_rules=None, default_security_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags) - self.security_rules = security_rules - self.default_security_rules = default_security_rules + def __init__(self, **kwargs): + super(NetworkSecurityGroup, self).__init__(**kwargs) + self.security_rules = kwargs.get('security_rules', None) + self.default_security_rules = kwargs.get('default_security_rules', None) self.network_interfaces = None self.subnets = None - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_security_group_py3.py new file mode 100644 index 000000000000..46c6f36d4941 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_security_group_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkSecurityGroup(Resource): + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param security_rules: A collection of security rules of the network + security group. + :type security_rules: + list[~azure.mgmt.network.v2017_09_01.models.SecurityRule] + :param default_security_rules: The default security rules of network + security group. + :type default_security_rules: + list[~azure.mgmt.network.v2017_09_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network + interfaces. + :vartype network_interfaces: + list[~azure.mgmt.network.v2017_09_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2017_09_01.models.Subnet] + :param resource_guid: The resource GUID property of the network security + group resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, + 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, security_rules=None, default_security_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.security_rules = security_rules + self.default_security_rules = default_security_rules + self.network_interfaces = None + self.subnets = None + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_watcher.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_watcher.py index 60d4cfa379f4..39cb9e79a094 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_watcher.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_watcher.py @@ -53,7 +53,7 @@ class NetworkWatcher(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, etag=None): - super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags) - self.etag = etag + def __init__(self, **kwargs): + super(NetworkWatcher, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_watcher_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_watcher_py3.py new file mode 100644 index 000000000000..eebe3f0eb7ee --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/network_watcher_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkWatcher(Resource): + """Network watcher in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.network.v2017_09_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, etag: str=None, **kwargs) -> None: + super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = etag + self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_parameters.py index 3e1478409a0a..54d8674c8884 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_parameters.py @@ -15,12 +15,14 @@ class NextHopParameters(Model): """Parameters that define the source and destination endpoint. - :param target_resource_id: The resource identifier of the target resource - against which the action is to be performed. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. :type target_resource_id: str - :param source_ip_address: The source IP address. + :param source_ip_address: Required. The source IP address. :type source_ip_address: str - :param destination_ip_address: The destination IP address. + :param destination_ip_address: Required. The destination IP address. :type destination_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be @@ -41,9 +43,9 @@ class NextHopParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, source_ip_address, destination_ip_address, target_nic_resource_id=None): - super(NextHopParameters, self).__init__() - self.target_resource_id = target_resource_id - self.source_ip_address = source_ip_address - self.destination_ip_address = destination_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.source_ip_address = kwargs.get('source_ip_address', None) + self.destination_ip_address = kwargs.get('destination_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_parameters_py3.py new file mode 100644 index 000000000000..50ee3d334e91 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_parameters_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopParameters(Model): + """Parameters that define the source and destination endpoint. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. + :type target_resource_id: str + :param source_ip_address: Required. The source IP address. + :type source_ip_address: str + :param destination_ip_address: Required. The destination IP address. + :type destination_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of the nics, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'source_ip_address': {'required': True}, + 'destination_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, + 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, source_ip_address: str, destination_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.source_ip_address = source_ip_address + self.destination_ip_address = destination_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_result.py index 6ef065c8973e..4ae7e9248d02 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_result.py @@ -35,8 +35,8 @@ class NextHopResult(Model): 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, } - def __init__(self, next_hop_type=None, next_hop_ip_address=None, route_table_id=None): - super(NextHopResult, self).__init__() - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.route_table_id = route_table_id + def __init__(self, **kwargs): + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.route_table_id = kwargs.get('route_table_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_result_py3.py new file mode 100644 index 000000000000..1dab8256ede5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopResult(Model): + """The information about next hop from the specified VM. + + :param next_hop_type: Next hop type. Possible values include: 'Internet', + 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', + 'HyperNetGateway', 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_09_01.models.NextHopType + :param next_hop_ip_address: Next hop IP Address + :type next_hop_ip_address: str + :param route_table_id: The resource identifier for the route table + associated with the route being returned. If the route being returned does + not correspond to any user created routes then this field will be the + string 'System Route'. + :type route_table_id: str + """ + + _attribute_map = { + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type=None, next_hop_ip_address: str=None, route_table_id: str=None, **kwargs) -> None: + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.route_table_id = route_table_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation.py index 09f993e607ed..ee8525e936af 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation.py @@ -33,9 +33,9 @@ class Operation(Model): 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationPropertiesFormatServiceSpecification'}, } - def __init__(self, name=None, display=None, origin=None, service_specification=None): - super(Operation, self).__init__() - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_display.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_display.py index 91ea63defbf0..6e37c2433f56 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_display.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_display.py @@ -32,9 +32,9 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_display_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_display_py3.py new file mode 100644 index 000000000000..c0508a41bd48 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Network. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of the operation: get, read, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_properties_format_service_specification.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_properties_format_service_specification.py index 0225ee10e035..9d6e11421eac 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_properties_format_service_specification.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_properties_format_service_specification.py @@ -28,7 +28,7 @@ class OperationPropertiesFormatServiceSpecification(Model): 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, } - def __init__(self, metric_specifications=None, log_specifications=None): - super(OperationPropertiesFormatServiceSpecification, self).__init__() - self.metric_specifications = metric_specifications - self.log_specifications = log_specifications + def __init__(self, **kwargs): + super(OperationPropertiesFormatServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + self.log_specifications = kwargs.get('log_specifications', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_properties_format_service_specification_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_properties_format_service_specification_py3.py new file mode 100644 index 000000000000..490a157c2f98 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_properties_format_service_specification_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationPropertiesFormatServiceSpecification(Model): + """Specification of the service. + + :param metric_specifications: Operation service specification. + :type metric_specifications: + list[~azure.mgmt.network.v2017_09_01.models.MetricSpecification] + :param log_specifications: Operation log specification. + :type log_specifications: + list[~azure.mgmt.network.v2017_09_01.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, log_specifications=None, **kwargs) -> None: + super(OperationPropertiesFormatServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + self.log_specifications = log_specifications diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_py3.py new file mode 100644 index 000000000000..23ff20360eaf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/operation_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Network REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.network.v2017_09_01.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param service_specification: Specification of the service. + :type service_specification: + ~azure.mgmt.network.v2017_09_01.models.OperationPropertiesFormatServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationPropertiesFormatServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/outbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/outbound_nat_rule.py index 37e34b65d6d4..d24cb97a0fb0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/outbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/outbound_nat_rule.py @@ -15,6 +15,8 @@ class OutboundNatRule(SubResource): """Outbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param allocated_outbound_ports: The number of outbound ports to be used @@ -24,8 +26,8 @@ class OutboundNatRule(SubResource): balancer. :type frontend_ip_configurations: list[~azure.mgmt.network.v2017_09_01.models.SubResource] - :param backend_address_pool: A reference to a pool of DIPs. Outbound - traffic is randomly load balanced across IPs in the backend IPs. + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. :type backend_address_pool: ~azure.mgmt.network.v2017_09_01.models.SubResource :param provisioning_state: Gets the provisioning state of the PublicIP @@ -53,11 +55,11 @@ class OutboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, backend_address_pool, id=None, allocated_outbound_ports=None, frontend_ip_configurations=None, provisioning_state=None, name=None, etag=None): - super(OutboundNatRule, self).__init__(id=id) - self.allocated_outbound_ports = allocated_outbound_ports - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pool = backend_address_pool - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(OutboundNatRule, self).__init__(**kwargs) + self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/outbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/outbound_nat_rule_py3.py new file mode 100644 index 000000000000..304a514afdf4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/outbound_nat_rule_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class OutboundNatRule(SubResource): + """Outbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param allocated_outbound_ports: The number of outbound ports to be used + for NAT. + :type allocated_outbound_ports: int + :param frontend_ip_configurations: The Frontend IP addresses of the load + balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_09_01.models.SubResource] + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_address_pool': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, backend_address_pool, id: str=None, allocated_outbound_ports: int=None, frontend_ip_configurations=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(OutboundNatRule, self).__init__(id=id, **kwargs) + self.allocated_outbound_ports = allocated_outbound_ports + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pool = backend_address_pool + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture.py index 9c7b320f5ddf..23468d193e46 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture.py @@ -15,8 +15,10 @@ class PacketCapture(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCapture(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_09_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCapture(Model): 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCapture, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCapture, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_filter.py index 719356ace77a..8509543a1ab0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_filter.py @@ -51,10 +51,10 @@ class PacketCaptureFilter(Model): 'remote_port': {'key': 'remotePort', 'type': 'str'}, } - def __init__(self, protocol="Any", local_ip_address=None, remote_ip_address=None, local_port=None, remote_port=None): - super(PacketCaptureFilter, self).__init__() - self.protocol = protocol - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.local_port = local_port - self.remote_port = remote_port + def __init__(self, **kwargs): + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', "Any") + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_filter_py3.py new file mode 100644 index 000000000000..283798ae0696 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_filter_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureFilter(Model): + """Filter that is applied to packet capture request. Multiple filters can be + applied. + + :param protocol: Protocol to be filtered on. Possible values include: + 'TCP', 'UDP', 'Any'. Default value: "Any" . + :type protocol: str or ~azure.mgmt.network.v2017_09_01.models.PcProtocol + :param local_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type local_ip_address: str + :param remote_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type remote_ip_address: str + :param local_port: Local port to be filtered on. Notation: "80" for single + port entry."80-85" for range. "80;443;" for multiple entries. Multiple + ranges not currently supported. Mixing ranges with multiple entries not + currently supported. Default = null. + :type local_port: str + :param remote_port: Remote port to be filtered on. Notation: "80" for + single port entry."80-85" for range. "80;443;" for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple + entries not currently supported. Default = null. + :type remote_port: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + } + + def __init__(self, *, protocol="Any", local_ip_address: str=None, remote_ip_address: str=None, local_port: str=None, remote_port: str=None, **kwargs) -> None: + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = protocol + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.local_port = local_port + self.remote_port = remote_port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_parameters.py index 2baeb60a37b8..58d3e76185e0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_parameters.py @@ -15,8 +15,10 @@ class PacketCaptureParameters(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCaptureParameters(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_09_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCaptureParameters(Model): 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCaptureParameters, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_parameters_py3.py new file mode 100644 index 000000000000..7335e70e7b06 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_parameters_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureParameters(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_09_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_09_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_py3.py new file mode 100644 index 000000000000..fc2fb1994f61 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCapture(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_09_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_09_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCapture, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_query_status_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_query_status_result.py index f0155ab77fda..6ac877062e18 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_query_status_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_query_status_result.py @@ -43,11 +43,11 @@ class PacketCaptureQueryStatusResult(Model): 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, } - def __init__(self, name=None, id=None, capture_start_time=None, packet_capture_status=None, stop_reason=None, packet_capture_error=None): - super(PacketCaptureQueryStatusResult, self).__init__() - self.name = name - self.id = id - self.capture_start_time = capture_start_time - self.packet_capture_status = packet_capture_status - self.stop_reason = stop_reason - self.packet_capture_error = packet_capture_error + def __init__(self, **kwargs): + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.capture_start_time = kwargs.get('capture_start_time', None) + self.packet_capture_status = kwargs.get('packet_capture_status', None) + self.stop_reason = kwargs.get('stop_reason', None) + self.packet_capture_error = kwargs.get('packet_capture_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_query_status_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_query_status_result_py3.py new file mode 100644 index 000000000000..adbb450e73f8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_query_status_result_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureQueryStatusResult(Model): + """Status of packet capture session. + + :param name: The name of the packet capture resource. + :type name: str + :param id: The ID of the packet capture resource. + :type id: str + :param capture_start_time: The start time of the packet capture session. + :type capture_start_time: datetime + :param packet_capture_status: The status of the packet capture session. + Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', + 'Unknown' + :type packet_capture_status: str or + ~azure.mgmt.network.v2017_09_01.models.PcStatus + :param stop_reason: The reason the current packet capture session was + stopped. + :type stop_reason: str + :param packet_capture_error: List of errors of packet capture session. + :type packet_capture_error: list[str or + ~azure.mgmt.network.v2017_09_01.models.PcError] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, + 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, + 'stop_reason': {'key': 'stopReason', 'type': 'str'}, + 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, id: str=None, capture_start_time=None, packet_capture_status=None, stop_reason: str=None, packet_capture_error=None, **kwargs) -> None: + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = name + self.id = id + self.capture_start_time = capture_start_time + self.packet_capture_status = packet_capture_status + self.stop_reason = stop_reason + self.packet_capture_error = packet_capture_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_result.py index 7e2621007157..66e5505f7809 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_result.py @@ -18,6 +18,8 @@ class PacketCaptureResult(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar name: Name of the packet capture session. :vartype name: str :ivar id: ID of the packet capture operation. @@ -25,8 +27,8 @@ class PacketCaptureResult(Model): :param etag: Default value: "A unique read-only string that changes whenever the resource is updated." . :type etag: str - :param target: The ID of the targeted resource, only VM is currently - supported. + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -37,7 +39,7 @@ class PacketCaptureResult(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_09_01.models.PacketCaptureStorageLocation :param filters: @@ -70,15 +72,15 @@ class PacketCaptureResult(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, target, storage_location, etag="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None, provisioning_state=None): - super(PacketCaptureResult, self).__init__() + def __init__(self, **kwargs): + super(PacketCaptureResult, self).__init__(**kwargs) self.name = None self.id = None - self.etag = etag - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters - self.provisioning_state = provisioning_state + self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_result_py3.py new file mode 100644 index 000000000000..24818b7593b7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_result_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureResult(Model): + """Information about packet capture session. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the packet capture session. + :vartype name: str + :ivar id: ID of the packet capture operation. + :vartype id: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_09_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_09_01.models.PacketCaptureFilter] + :param provisioning_state: The provisioning state of the packet capture + session. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2017_09_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, target: str, storage_location, etag: str="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, provisioning_state=None, **kwargs) -> None: + super(PacketCaptureResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = etag + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_storage_location.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_storage_location.py index 773b04d22501..62ed83d592b3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_storage_location.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_storage_location.py @@ -35,8 +35,8 @@ class PacketCaptureStorageLocation(Model): 'file_path': {'key': 'filePath', 'type': 'str'}, } - def __init__(self, storage_id=None, storage_path=None, file_path=None): - super(PacketCaptureStorageLocation, self).__init__() - self.storage_id = storage_id - self.storage_path = storage_path - self.file_path = file_path + def __init__(self, **kwargs): + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) + self.file_path = kwargs.get('file_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_storage_location_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_storage_location_py3.py new file mode 100644 index 000000000000..6925dd4f9bdf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/packet_capture_storage_location_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureStorageLocation(Model): + """Describes the storage location for a packet capture session. + + :param storage_id: The ID of the storage account to save the packet + capture session. Required if no local file path is provided. + :type storage_id: str + :param storage_path: The URI of the storage path to save the packet + capture. Must be a well-formed URI describing the location to save the + packet capture. + :type storage_path: str + :param file_path: A valid local path on the targeting VM. Must include the + name of the capture file (*.cap). For linux virtual machine it must start + with /var/captures. Required if no storage ID is provided, otherwise + optional. + :type file_path: str + """ + + _attribute_map = { + 'storage_id': {'key': 'storageId', 'type': 'str'}, + 'storage_path': {'key': 'storagePath', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + } + + def __init__(self, *, storage_id: str=None, storage_path: str=None, file_path: str=None, **kwargs) -> None: + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = storage_id + self.storage_path = storage_path + self.file_path = file_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter.py index ef106b06a4c6..9cb58ec3efcb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter.py @@ -60,12 +60,12 @@ class PatchRouteFilter(SubResource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, rules=None, peerings=None, tags=None): - super(PatchRouteFilter, self).__init__(id=id) - self.rules = rules - self.peerings = peerings + def __init__(self, **kwargs): + super(PatchRouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.peerings = kwargs.get('peerings', None) self.provisioning_state = None self.name = None self.etag = None self.type = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter_py3.py new file mode 100644 index 000000000000..52d0e2e56e2d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilter(SubResource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2017_09_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, rules=None, peerings=None, tags=None, **kwargs) -> None: + super(PatchRouteFilter, self).__init__(id=id, **kwargs) + self.rules = rules + self.peerings = peerings + self.provisioning_state = None + self.name = None + self.etag = None + self.type = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter_rule.py index c03aa128a721..a79629f8d9c1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter_rule.py @@ -18,16 +18,18 @@ class PatchRouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2017_09_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -64,11 +66,11 @@ class PatchRouteFilterRule(SubResource): route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, tags=None): - super(PatchRouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(PatchRouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None self.name = None self.etag = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter_rule_py3.py new file mode 100644 index 000000000000..fc870472eb23 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/patch_route_filter_rule_py3.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_09_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, tags=None, **kwargs) -> None: + super(PatchRouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = None + self.etag = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/probe.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/probe.py index 426162d64206..991673104764 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/probe.py @@ -18,20 +18,22 @@ class Probe(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar load_balancing_rules: The load balancer rules that use this probe. :vartype load_balancing_rules: list[~azure.mgmt.network.v2017_09_01.models.SubResource] - :param protocol: The protocol of the end point. Possible values are: - 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the - probe to be successful. If 'Http' is specified, a 200 OK response from the - specifies URI is required for the probe to be successful. Possible values - include: 'Http', 'Tcp' + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2017_09_01.models.ProbeProtocol - :param port: The port for communicating the probe. Possible values range - from 1 to 65535, inclusive. + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. :type port: int :param interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is @@ -78,14 +80,14 @@ class Probe(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, port, id=None, interval_in_seconds=None, number_of_probes=None, request_path=None, provisioning_state=None, name=None, etag=None): - super(Probe, self).__init__(id=id) + def __init__(self, **kwargs): + super(Probe, self).__init__(**kwargs) self.load_balancing_rules = None - self.protocol = protocol - self.port = port - self.interval_in_seconds = interval_in_seconds - self.number_of_probes = number_of_probes - self.request_path = request_path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.port = kwargs.get('port', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.number_of_probes = kwargs.get('number_of_probes', None) + self.request_path = kwargs.get('request_path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/probe_py3.py new file mode 100644 index 000000000000..944ca8f01084 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Probe(SubResource): + """A load balancer probe. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar load_balancing_rules: The load balancer rules that use this probe. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_09_01.models.SubResource] + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_09_01.models.ProbeProtocol + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. + :type port: int + :param interval_in_seconds: The interval, in seconds, for how frequently + to probe the endpoint for health status. Typically, the interval is + slightly less than half the allocated timeout period (in seconds) which + allows two full probes before taking the instance out of rotation. The + default value is 15, the minimum value is 5. + :type interval_in_seconds: int + :param number_of_probes: The number of probes where if no response, will + result in stopping further traffic from being delivered to the endpoint. + This values allows endpoints to be taken out of rotation faster or slower + than the typical times used in Azure. + :type number_of_probes: int + :param request_path: The URI used for requesting health status from the + VM. Path is required if a protocol is set to http. Otherwise, it is not + allowed. There is no default value. + :type request_path: str + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'load_balancing_rules': {'readonly': True}, + 'protocol': {'required': True}, + 'port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, + 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, port: int, id: str=None, interval_in_seconds: int=None, number_of_probes: int=None, request_path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Probe, self).__init__(id=id, **kwargs) + self.load_balancing_rules = None + self.protocol = protocol + self.port = port + self.interval_in_seconds = interval_in_seconds + self.number_of_probes = number_of_probes + self.request_path = request_path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address.py index ab810f3a902b..3454770c0fa9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address.py @@ -91,16 +91,16 @@ class PublicIPAddress(Resource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address=None, idle_timeout_in_minutes=None, resource_guid=None, provisioning_state=None, etag=None, zones=None): - super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.public_ip_allocation_method = public_ip_allocation_method - self.public_ip_address_version = public_ip_address_version + def __init__(self, **kwargs): + super(PublicIPAddress, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) + self.public_ip_address_version = kwargs.get('public_ip_address_version', None) self.ip_configuration = None - self.dns_settings = dns_settings - self.ip_address = ip_address - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag - self.zones = zones + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_address = kwargs.get('ip_address', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_dns_settings.py index a248461f05d7..07dfe30433a6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_dns_settings.py @@ -38,8 +38,8 @@ class PublicIPAddressDnsSettings(Model): 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, } - def __init__(self, domain_name_label=None, fqdn=None, reverse_fqdn=None): - super(PublicIPAddressDnsSettings, self).__init__() - self.domain_name_label = domain_name_label - self.fqdn = fqdn - self.reverse_fqdn = reverse_fqdn + def __init__(self, **kwargs): + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) + self.fqdn = kwargs.get('fqdn', None) + self.reverse_fqdn = kwargs.get('reverse_fqdn', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_dns_settings_py3.py new file mode 100644 index 000000000000..e84aa9c10bf5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_dns_settings_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressDnsSettings(Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :param domain_name_label: Gets or sets the Domain name label.The + concatenation of the domain name label and the regionalized DNS zone make + up the fully qualified domain name associated with the public IP address. + If a domain name label is specified, an A DNS record is created for the + public IP in the Microsoft Azure DNS system. + :type domain_name_label: str + :param fqdn: Gets the FQDN, Fully qualified domain name of the A DNS + record associated with the public IP. This is the concatenation of the + domainNameLabel and the regionalized DNS zone. + :type fqdn: str + :param reverse_fqdn: Gets or Sets the Reverse FQDN. A user-visible, fully + qualified domain name that resolves to this public IP address. If the + reverseFqdn is specified, then a PTR DNS record is created pointing from + the IP address in the in-addr.arpa domain to the reverse FQDN. + :type reverse_fqdn: str + """ + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, + } + + def __init__(self, *, domain_name_label: str=None, fqdn: str=None, reverse_fqdn: str=None, **kwargs) -> None: + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label + self.fqdn = fqdn + self.reverse_fqdn = reverse_fqdn diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_py3.py new file mode 100644 index 000000000000..ff589dac9ea6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_py3.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PublicIPAddress(Resource): + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The public IP address SKU. + :type sku: ~azure.mgmt.network.v2017_09_01.models.PublicIPAddressSku + :param public_ip_allocation_method: The public IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type public_ip_allocation_method: str or + ~azure.mgmt.network.v2017_09_01.models.IPAllocationMethod + :param public_ip_address_version: The public IP address version. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + :type public_ip_address_version: str or + ~azure.mgmt.network.v2017_09_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP + address. + :vartype ip_configuration: + ~azure.mgmt.network.v2017_09_01.models.IPConfiguration + :param dns_settings: The FQDN of the DNS record associated with the public + IP address. + :type dns_settings: + ~azure.mgmt.network.v2017_09_01.models.PublicIPAddressDnsSettings + :param ip_address: The IP address associated with the public IP address + resource. + :type ip_address: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param resource_guid: The resource GUID property of the public IP + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address: str=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, zones=None, **kwargs) -> None: + super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.public_ip_allocation_method = public_ip_allocation_method + self.public_ip_address_version = public_ip_address_version + self.ip_configuration = None + self.dns_settings = dns_settings + self.ip_address = ip_address + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag + self.zones = zones diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_sku.py index 4a6d29697430..92693039b9bc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_sku.py @@ -25,6 +25,6 @@ class PublicIPAddressSku(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - super(PublicIPAddressSku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_sku_py3.py new file mode 100644 index 000000000000..1f8ee3ae085e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/public_ip_address_sku_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressSku(Model): + """SKU of a public IP address. + + :param name: Name of a public IP address SKU. Possible values include: + 'Basic', 'Standard' + :type name: str or + ~azure.mgmt.network.v2017_09_01.models.PublicIPAddressSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/query_troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/query_troubleshooting_parameters.py index 9b6801eb7b63..6ae1924916c6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/query_troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/query_troubleshooting_parameters.py @@ -15,7 +15,9 @@ class QueryTroubleshootingParameters(Model): """Parameters that define the resource to query the troubleshooting result. - :param target_resource_id: The target resource ID to query the + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the troubleshooting result. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class QueryTroubleshootingParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(QueryTroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/query_troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/query_troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..b5fccb87857c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/query_troubleshooting_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryTroubleshootingParameters(Model): + """Parameters that define the resource to query the troubleshooting result. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the + troubleshooting result. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource.py index ff5f1f40e14e..7dabab29ac9d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource.py @@ -43,10 +43,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, location=None, tags=None): - super(Resource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource_navigation_link.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource_navigation_link.py index 9b4484be654a..705698f513f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource_navigation_link.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource_navigation_link.py @@ -49,10 +49,10 @@ class ResourceNavigationLink(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, linked_resource_type=None, link=None, name=None): - super(ResourceNavigationLink, self).__init__(id=id) - self.linked_resource_type = linked_resource_type - self.link = link + def __init__(self, **kwargs): + super(ResourceNavigationLink, self).__init__(**kwargs) + self.linked_resource_type = kwargs.get('linked_resource_type', None) + self.link = kwargs.get('link', None) self.provisioning_state = None - self.name = name + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource_navigation_link_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource_navigation_link_py3.py new file mode 100644 index 000000000000..5cb22d347836 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource_navigation_link_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ResourceNavigationLink(SubResource): + """ResourceNavigationLink resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource + :type link: str + :ivar provisioning_state: Provisioning state of the ResourceNavigationLink + resource. + :vartype provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, linked_resource_type: str=None, link: str=None, name: str=None, **kwargs) -> None: + super(ResourceNavigationLink, self).__init__(id=id, **kwargs) + self.linked_resource_type = linked_resource_type + self.link = link + self.provisioning_state = None + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource_py3.py new file mode 100644 index 000000000000..ae95b78b4f23 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/resource_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Common resource representation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/retention_policy_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/retention_policy_parameters.py index 102f4c5c3b4c..28cb43056d47 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/retention_policy_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/retention_policy_parameters.py @@ -26,7 +26,7 @@ class RetentionPolicyParameters(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, days=0, enabled=False): - super(RetentionPolicyParameters, self).__init__() - self.days = days - self.enabled = enabled + def __init__(self, **kwargs): + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = kwargs.get('days', 0) + self.enabled = kwargs.get('enabled', False) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/retention_policy_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/retention_policy_parameters_py3.py new file mode 100644 index 000000000000..3b2ffc5e741e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/retention_policy_parameters_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RetentionPolicyParameters(Model): + """Parameters that define the retention policy for flow log. + + :param days: Number of days to retain flow log records. Default value: 0 . + :type days: int + :param enabled: Flag to enable/disable retention. Default value: False . + :type enabled: bool + """ + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, days: int=0, enabled: bool=False, **kwargs) -> None: + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = days + self.enabled = enabled diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route.py index 6b2b12bd8b85..f1cbeef0432b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route.py @@ -15,13 +15,15 @@ class Route(SubResource): """Route resource. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param address_prefix: The destination CIDR to which the route applies. :type address_prefix: str - :param next_hop_type: The type of Azure hop the packet should be sent to. - Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - 'VirtualAppliance', and 'None'. Possible values include: + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' :type next_hop_type: str or @@ -55,11 +57,11 @@ class Route(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, next_hop_type, id=None, address_prefix=None, next_hop_ip_address=None, provisioning_state=None, name=None, etag=None): - super(Route, self).__init__(id=id) - self.address_prefix = address_prefix - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(Route, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter.py index efac4ef99b1e..b133842376f8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter.py @@ -62,9 +62,9 @@ class RouteFilter(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, rules=None, peerings=None): - super(RouteFilter, self).__init__(id=id, location=location, tags=tags) - self.rules = rules - self.peerings = peerings + def __init__(self, **kwargs): + super(RouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.peerings = kwargs.get('peerings', None) self.provisioning_state = None self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter_py3.py new file mode 100644 index 000000000000..2d1a8d89ed82 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteFilter(Resource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2017_09_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, rules=None, peerings=None, **kwargs) -> None: + super(RouteFilter, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.rules = rules + self.peerings = peerings + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter_rule.py index 7ab1e82d9f00..75cb571a5892 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter_rule.py @@ -18,16 +18,18 @@ class RouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2017_09_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -66,12 +68,12 @@ class RouteFilterRule(SubResource): route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, name=None, location=None, tags=None): - super(RouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(RouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None - self.name = name - self.location = location + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) self.etag = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter_rule_py3.py new file mode 100644 index 000000000000..e47056aa409a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_filter_rule_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class RouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_09_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param location: Resource location. + :type location: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(RouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = name + self.location = location + self.etag = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_py3.py new file mode 100644 index 000000000000..269bb82af074 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Route(SubResource): + """Route resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param address_prefix: The destination CIDR to which the route applies. + :type address_prefix: str + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_09_01.models.RouteNextHopType + :param next_hop_ip_address: The IP address packets should be forwarded to. + Next hop values are only allowed in routes where the next hop type is + VirtualAppliance. + :type next_hop_ip_address: str + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'next_hop_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type, id: str=None, address_prefix: str=None, next_hop_ip_address: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Route, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_table.py index a169f8513667..0ed94a62956e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_table.py @@ -58,9 +58,9 @@ class RouteTable(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, routes=None, provisioning_state=None, etag=None): - super(RouteTable, self).__init__(id=id, location=location, tags=tags) - self.routes = routes + def __init__(self, **kwargs): + super(RouteTable, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) self.subnets = None - self.provisioning_state = provisioning_state - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_table_py3.py new file mode 100644 index 000000000000..66b26f752446 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/route_table_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteTable(Resource): + """Route table resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param routes: Collection of routes contained within a route table. + :type routes: list[~azure.mgmt.network.v2017_09_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2017_09_01.models.Subnet] + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'routes': {'key': 'properties.routes', 'type': '[Route]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, routes=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(RouteTable, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.routes = routes + self.subnets = None + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_network_interface.py index e4996c482954..ec9da3e79fd5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_network_interface.py @@ -27,7 +27,7 @@ class SecurityGroupNetworkInterface(Model): 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, } - def __init__(self, id=None, security_rule_associations=None): - super(SecurityGroupNetworkInterface, self).__init__() - self.id = id - self.security_rule_associations = security_rule_associations + def __init__(self, **kwargs): + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.security_rule_associations = kwargs.get('security_rule_associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_network_interface_py3.py new file mode 100644 index 000000000000..ea8380e93d8e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_network_interface_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupNetworkInterface(Model): + """Network interface and all its associated security rules. + + :param id: ID of the network interface. + :type id: str + :param security_rule_associations: + :type security_rule_associations: + ~azure.mgmt.network.v2017_09_01.models.SecurityRuleAssociations + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, + } + + def __init__(self, *, id: str=None, security_rule_associations=None, **kwargs) -> None: + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = id + self.security_rule_associations = security_rule_associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_parameters.py index 5c0972e5d55e..1d547b0b0e2b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_parameters.py @@ -15,7 +15,9 @@ class SecurityGroupViewParameters(Model): """Parameters that define the VM to check security groups for. - :param target_resource_id: ID of the target VM. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. :type target_resource_id: str """ @@ -27,6 +29,6 @@ class SecurityGroupViewParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(SecurityGroupViewParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_parameters_py3.py new file mode 100644 index 000000000000..7ccc48017444 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_parameters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewParameters(Model): + """Parameters that define the VM to check security groups for. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_result.py index fc69f548464d..e392f5771ff4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_result.py @@ -24,6 +24,6 @@ class SecurityGroupViewResult(Model): 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, } - def __init__(self, network_interfaces=None): - super(SecurityGroupViewResult, self).__init__() - self.network_interfaces = network_interfaces + def __init__(self, **kwargs): + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_result_py3.py new file mode 100644 index 000000000000..f577cd5e908b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_group_view_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewResult(Model): + """The information about security rules applied to the specified VM. + + :param network_interfaces: List of network interfaces on the specified VM. + :type network_interfaces: + list[~azure.mgmt.network.v2017_09_01.models.SecurityGroupNetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule.py index 067d91121336..2b64ac589abc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule.py @@ -15,12 +15,15 @@ class SecurityRule(SubResource): """Network security rule. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param description: A description for this rule. Restricted to 140 chars. :type description: str - :param protocol: Network protocol this rule applies to. Possible values - are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*' + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' :type protocol: str or ~azure.mgmt.network.v2017_09_01.models.SecurityRuleProtocol :param source_port_range: The source port or range. Integer or range @@ -57,8 +60,9 @@ class SecurityRule(SubResource): :type source_port_ranges: list[str] :param destination_port_ranges: The destination port ranges. :type destination_port_ranges: list[str] - :param access: The network traffic is allowed or denied. Possible values - are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' :type access: str or ~azure.mgmt.network.v2017_09_01.models.SecurityRuleAccess :param priority: The priority of the rule. The value can be between 100 @@ -66,10 +70,10 @@ class SecurityRule(SubResource): collection. The lower the priority number, the higher the priority of the rule. :type priority: int - :param direction: The direction of the rule. The direction specifies if - rule will be evaluated on incoming or outcoming traffic. Possible values - are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', - 'Outbound' + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2017_09_01.models.SecurityRuleDirection :param provisioning_state: The provisioning state of the public IP @@ -111,23 +115,23 @@ class SecurityRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, source_address_prefix=None, destination_address_prefix=None, access=None, direction=None, id=None, description=None, source_port_range=None, destination_port_range=None, source_address_prefixes=None, source_application_security_groups=None, destination_address_prefixes=None, destination_application_security_groups=None, source_port_ranges=None, destination_port_ranges=None, priority=None, provisioning_state=None, name=None, etag=None): - super(SecurityRule, self).__init__(id=id) - self.description = description - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_address_prefix = source_address_prefix - self.source_address_prefixes = source_address_prefixes - self.source_application_security_groups = source_application_security_groups - self.destination_address_prefix = destination_address_prefix - self.destination_address_prefixes = destination_address_prefixes - self.destination_application_security_groups = destination_application_security_groups - self.source_port_ranges = source_port_ranges - self.destination_port_ranges = destination_port_ranges - self.access = access - self.priority = priority - self.direction = direction - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(SecurityRule, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.source_application_security_groups = kwargs.get('source_application_security_groups', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.destination_application_security_groups = kwargs.get('destination_application_security_groups', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule_associations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule_associations.py index 8c120c665c49..f6ae7ac1bddf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule_associations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule_associations.py @@ -37,9 +37,9 @@ class SecurityRuleAssociations(Model): 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, } - def __init__(self, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None): - super(SecurityRuleAssociations, self).__init__() - self.network_interface_association = network_interface_association - self.subnet_association = subnet_association - self.default_security_rules = default_security_rules - self.effective_security_rules = effective_security_rules + def __init__(self, **kwargs): + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = kwargs.get('network_interface_association', None) + self.subnet_association = kwargs.get('subnet_association', None) + self.default_security_rules = kwargs.get('default_security_rules', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule_associations_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule_associations_py3.py new file mode 100644 index 000000000000..a98486f6adf8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule_associations_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityRuleAssociations(Model): + """All security rules associated with the network interface. + + :param network_interface_association: + :type network_interface_association: + ~azure.mgmt.network.v2017_09_01.models.NetworkInterfaceAssociation + :param subnet_association: + :type subnet_association: + ~azure.mgmt.network.v2017_09_01.models.SubnetAssociation + :param default_security_rules: Collection of default security rules of the + network security group. + :type default_security_rules: + list[~azure.mgmt.network.v2017_09_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2017_09_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, + 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, + 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__(self, *, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None, **kwargs) -> None: + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = network_interface_association + self.subnet_association = subnet_association + self.default_security_rules = default_security_rules + self.effective_security_rules = effective_security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule_py3.py new file mode 100644 index 000000000000..718adcc5a1fb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/security_rule_py3.py @@ -0,0 +1,137 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class SecurityRule(SubResource): + """Network security rule. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2017_09_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. Integer or range + between 0 and 65535. Asterix '*' can also be used to match all ports. + :type source_port_range: str + :param destination_port_range: The destination port or range. Integer or + range between 0 and 65535. Asterix '*' can also be used to match all + ports. + :type destination_port_range: str + :param source_address_prefix: The CIDR or source IP range. Asterix '*' can + also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + this is an ingress rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param source_address_prefixes: The CIDR or source IP ranges. + :type source_address_prefixes: list[str] + :param source_application_security_groups: The application security group + specified as source. + :type source_application_security_groups: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroup] + :param destination_address_prefix: The destination address prefix. CIDR or + destination IP range. Asterix '*' can also be used to match all source + IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. + :type destination_address_prefix: str + :param destination_address_prefixes: The destination address prefixes. + CIDR or destination IP ranges. + :type destination_address_prefixes: list[str] + :param destination_application_security_groups: The application security + group specified as destination. + :type destination_application_security_groups: + list[~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroup] + :param source_port_ranges: The source port ranges. + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. + :type destination_port_ranges: list[str] + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' + :type access: str or + ~azure.mgmt.network.v2017_09_01.models.SecurityRuleAccess + :param priority: The priority of the rule. The value can be between 100 + and 4096. The priority number must be unique for each rule in the + collection. The lower the priority number, the higher the priority of the + rule. + :type priority: int + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2017_09_01.models.SecurityRuleDirection + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'access': {'required': True}, + 'direction': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'properties.sourceAddressPrefixes', 'type': '[str]'}, + 'source_application_security_groups': {'key': 'properties.sourceApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, + 'destination_address_prefixes': {'key': 'properties.destinationAddressPrefixes', 'type': '[str]'}, + 'destination_application_security_groups': {'key': 'properties.destinationApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'source_port_ranges': {'key': 'properties.sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'properties.destinationPortRanges', 'type': '[str]'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, access, direction, id: str=None, description: str=None, source_port_range: str=None, destination_port_range: str=None, source_address_prefix: str=None, source_address_prefixes=None, source_application_security_groups=None, destination_address_prefix: str=None, destination_address_prefixes=None, destination_application_security_groups=None, source_port_ranges=None, destination_port_ranges=None, priority: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(SecurityRule, self).__init__(id=id, **kwargs) + self.description = description + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.source_address_prefixes = source_address_prefixes + self.source_application_security_groups = source_application_security_groups + self.destination_address_prefix = destination_address_prefix + self.destination_address_prefixes = destination_address_prefixes + self.destination_application_security_groups = destination_application_security_groups + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/service_endpoint_properties_format.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/service_endpoint_properties_format.py index 847cb9ac8b3b..87ca01e64540 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/service_endpoint_properties_format.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/service_endpoint_properties_format.py @@ -29,8 +29,8 @@ class ServiceEndpointPropertiesFormat(Model): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } - def __init__(self, service=None, locations=None, provisioning_state=None): - super(ServiceEndpointPropertiesFormat, self).__init__() - self.service = service - self.locations = locations - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = kwargs.get('service', None) + self.locations = kwargs.get('locations', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/service_endpoint_properties_format_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/service_endpoint_properties_format_py3.py new file mode 100644 index 000000000000..8d3d2e5e8347 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/service_endpoint_properties_format_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceEndpointPropertiesFormat(Model): + """The service endpoint properties. + + :param service: The type of the endpoint service. + :type service: str + :param locations: A list of locations. + :type locations: list[str] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + """ + + _attribute_map = { + 'service': {'key': 'service', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, service: str=None, locations=None, provisioning_state: str=None, **kwargs) -> None: + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = service + self.locations = locations + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/sub_resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/sub_resource.py index 491f1d1caf83..6ab81f55f21b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/sub_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/sub_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/sub_resource_py3.py new file mode 100644 index 000000000000..8f4c4c816061 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """Reference to another subresource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet.py index 59683d2b2c27..1597205a8ea9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet.py @@ -66,14 +66,14 @@ class Subnet(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, address_prefix=None, network_security_group=None, route_table=None, service_endpoints=None, resource_navigation_links=None, provisioning_state=None, name=None, etag=None): - super(Subnet, self).__init__(id=id) - self.address_prefix = address_prefix - self.network_security_group = network_security_group - self.route_table = route_table - self.service_endpoints = service_endpoints + def __init__(self, **kwargs): + super(Subnet, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.route_table = kwargs.get('route_table', None) + self.service_endpoints = kwargs.get('service_endpoints', None) self.ip_configurations = None - self.resource_navigation_links = resource_navigation_links - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.resource_navigation_links = kwargs.get('resource_navigation_links', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet_association.py index 369570207014..8a08a87d69d2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet_association.py @@ -34,7 +34,7 @@ class SubnetAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(SubnetAssociation, self).__init__() + def __init__(self, **kwargs): + super(SubnetAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet_association_py3.py new file mode 100644 index 000000000000..c28077d57011 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Subnet ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2017_09_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(SubnetAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet_py3.py new file mode 100644 index 000000000000..b0a1afac96ab --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/subnet_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Subnet(SubResource): + """Subnet in a virtual network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param address_prefix: The address prefix for the subnet. + :type address_prefix: str + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroup + :param route_table: The reference of the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2017_09_01.models.RouteTable + :param service_endpoints: An array of service endpoints. + :type service_endpoints: + list[~azure.mgmt.network.v2017_09_01.models.ServiceEndpointPropertiesFormat] + :ivar ip_configurations: Gets an array of references to the network + interface IP configurations using subnet. + :vartype ip_configurations: + list[~azure.mgmt.network.v2017_09_01.models.IPConfiguration] + :param resource_navigation_links: Gets an array of references to the + external resources using subnet. + :type resource_navigation_links: + list[~azure.mgmt.network.v2017_09_01.models.ResourceNavigationLink] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'ip_configurations': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, + 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, address_prefix: str=None, network_security_group=None, route_table=None, service_endpoints=None, resource_navigation_links=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Subnet, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.network_security_group = network_security_group + self.route_table = route_table + self.service_endpoints = service_endpoints + self.ip_configurations = None + self.resource_navigation_links = resource_navigation_links + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tags_object.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tags_object.py index 539129368be9..2966ec220f94 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tags_object.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tags_object.py @@ -23,6 +23,6 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, tags=None): - super(TagsObject, self).__init__() - self.tags = tags + def __init__(self, **kwargs): + super(TagsObject, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tags_object_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tags_object_py3.py new file mode 100644 index 000000000000..8be0bb4a15d7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tags_object_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagsObject(Model): + """Tags object for patch operations. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsObject, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology.py index 45c6886fe0df..d8b76c7a0255 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology.py @@ -43,9 +43,9 @@ class Topology(Model): 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, } - def __init__(self, resources=None): - super(Topology, self).__init__() + def __init__(self, **kwargs): + super(Topology, self).__init__(**kwargs) self.id = None self.created_date_time = None self.last_modified = None - self.resources = resources + self.resources = kwargs.get('resources', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_association.py index 89b3e60f48f3..fb9dabe88053 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_association.py @@ -33,8 +33,8 @@ class TopologyAssociation(Model): 'association_type': {'key': 'associationType', 'type': 'str'}, } - def __init__(self, name=None, resource_id=None, association_type=None): - super(TopologyAssociation, self).__init__() - self.name = name - self.resource_id = resource_id - self.association_type = association_type + def __init__(self, **kwargs): + super(TopologyAssociation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.resource_id = kwargs.get('resource_id', None) + self.association_type = kwargs.get('association_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_association_py3.py new file mode 100644 index 000000000000..62c47a1997b4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyAssociation(Model): + """Resources that have an association with the parent resource. + + :param name: The name of the resource that is associated with the parent + resource. + :type name: str + :param resource_id: The ID of the resource that is associated with the + parent resource. + :type resource_id: str + :param association_type: The association type of the child resource to the + parent resource. Possible values include: 'Associated', 'Contains' + :type association_type: str or + ~azure.mgmt.network.v2017_09_01.models.AssociationType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'association_type': {'key': 'associationType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, resource_id: str=None, association_type=None, **kwargs) -> None: + super(TopologyAssociation, self).__init__(**kwargs) + self.name = name + self.resource_id = resource_id + self.association_type = association_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_parameters.py index 04920dc9665d..c7065ef57c09 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_parameters.py @@ -15,8 +15,10 @@ class TopologyParameters(Model): """Parameters that define the representation of topology. - :param target_resource_group_name: The name of the target resource group - to perform topology on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_group_name: Required. The name of the target + resource group to perform topology on. :type target_resource_group_name: str """ @@ -28,6 +30,6 @@ class TopologyParameters(Model): 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, } - def __init__(self, target_resource_group_name): - super(TopologyParameters, self).__init__() - self.target_resource_group_name = target_resource_group_name + def __init__(self, **kwargs): + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = kwargs.get('target_resource_group_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_parameters_py3.py new file mode 100644 index 000000000000..90c2365d8dba --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyParameters(Model): + """Parameters that define the representation of topology. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_group_name: Required. The name of the target + resource group to perform topology on. + :type target_resource_group_name: str + """ + + _validation = { + 'target_resource_group_name': {'required': True}, + } + + _attribute_map = { + 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, + } + + def __init__(self, *, target_resource_group_name: str, **kwargs) -> None: + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = target_resource_group_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_py3.py new file mode 100644 index 000000000000..473a8d61226f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Topology(Model): + """Topology of the specified resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: GUID representing the operation id. + :vartype id: str + :ivar created_date_time: The datetime when the topology was initially + created for the resource group. + :vartype created_date_time: datetime + :ivar last_modified: The datetime when the topology was last modified. + :vartype last_modified: datetime + :param resources: + :type resources: + list[~azure.mgmt.network.v2017_09_01.models.TopologyResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, + } + + def __init__(self, *, resources=None, **kwargs) -> None: + super(Topology, self).__init__(**kwargs) + self.id = None + self.created_date_time = None + self.last_modified = None + self.resources = resources diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_resource.py index 0907867f0997..20c85b3579d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_resource.py @@ -34,9 +34,9 @@ class TopologyResource(Model): 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, } - def __init__(self, name=None, id=None, location=None, associations=None): - super(TopologyResource, self).__init__() - self.name = name - self.id = id - self.location = location - self.associations = associations + def __init__(self, **kwargs): + super(TopologyResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.associations = kwargs.get('associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_resource_py3.py new file mode 100644 index 000000000000..f5f001d5bb78 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/topology_resource_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyResource(Model): + """The network resource topology information for the given resource group. + + :param name: Name of the resource. + :type name: str + :param id: ID of the resource. + :type id: str + :param location: Resource location. + :type location: str + :param associations: Holds the associations the resource has with other + resources in the resource group. + :type associations: + list[~azure.mgmt.network.v2017_09_01.models.TopologyAssociation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, + } + + def __init__(self, *, name: str=None, id: str=None, location: str=None, associations=None, **kwargs) -> None: + super(TopologyResource, self).__init__(**kwargs) + self.name = name + self.id = id + self.location = location + self.associations = associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_details.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_details.py index 8c5a12876b47..af01cb9b247e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_details.py @@ -36,10 +36,10 @@ class TroubleshootingDetails(Model): 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, } - def __init__(self, id=None, reason_type=None, summary=None, detail=None, recommended_actions=None): - super(TroubleshootingDetails, self).__init__() - self.id = id - self.reason_type = reason_type - self.summary = summary - self.detail = detail - self.recommended_actions = recommended_actions + def __init__(self, **kwargs): + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.reason_type = kwargs.get('reason_type', None) + self.summary = kwargs.get('summary', None) + self.detail = kwargs.get('detail', None) + self.recommended_actions = kwargs.get('recommended_actions', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_details_py3.py new file mode 100644 index 000000000000..f4207664da79 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_details_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingDetails(Model): + """Information gained from troubleshooting of specified resource. + + :param id: The id of the get troubleshoot operation. + :type id: str + :param reason_type: Reason type of failure. + :type reason_type: str + :param summary: A summary of troubleshooting. + :type summary: str + :param detail: Details on troubleshooting results. + :type detail: str + :param recommended_actions: List of recommended actions. + :type recommended_actions: + list[~azure.mgmt.network.v2017_09_01.models.TroubleshootingRecommendedActions] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'reason_type': {'key': 'reasonType', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'detail': {'key': 'detail', 'type': 'str'}, + 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, + } + + def __init__(self, *, id: str=None, reason_type: str=None, summary: str=None, detail: str=None, recommended_actions=None, **kwargs) -> None: + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = id + self.reason_type = reason_type + self.summary = summary + self.detail = detail + self.recommended_actions = recommended_actions diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_parameters.py index c4833fb8eeb3..6b11d3eb5ffc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_parameters.py @@ -15,13 +15,15 @@ class TroubleshootingParameters(Model): """Parameters that define the resource to troubleshoot. - :param target_resource_id: The target resource to troubleshoot. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. :type target_resource_id: str - :param storage_id: The ID for the storage account to save the troubleshoot - result. + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. :type storage_id: str - :param storage_path: The path to the blob to save the troubleshoot result - in. + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. :type storage_path: str """ @@ -37,8 +39,8 @@ class TroubleshootingParameters(Model): 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, } - def __init__(self, target_resource_id, storage_id, storage_path): - super(TroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.storage_path = storage_path + def __init__(self, **kwargs): + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..e010b7bdc9de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_parameters_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingParameters(Model): + """Parameters that define the resource to troubleshoot. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. + :type target_resource_id: str + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. + :type storage_id: str + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. + :type storage_path: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'storage_path': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, storage_path: str, **kwargs) -> None: + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.storage_path = storage_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_recommended_actions.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_recommended_actions.py index cbc5e31177c7..be395be4ad54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_recommended_actions.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_recommended_actions.py @@ -34,9 +34,9 @@ class TroubleshootingRecommendedActions(Model): 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, } - def __init__(self, action_id=None, action_text=None, action_uri=None, action_uri_text=None): - super(TroubleshootingRecommendedActions, self).__init__() - self.action_id = action_id - self.action_text = action_text - self.action_uri = action_uri - self.action_uri_text = action_uri_text + def __init__(self, **kwargs): + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = kwargs.get('action_id', None) + self.action_text = kwargs.get('action_text', None) + self.action_uri = kwargs.get('action_uri', None) + self.action_uri_text = kwargs.get('action_uri_text', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_recommended_actions_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_recommended_actions_py3.py new file mode 100644 index 000000000000..05c3f654353b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_recommended_actions_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingRecommendedActions(Model): + """Recommended actions based on discovered issues. + + :param action_id: ID of the recommended action. + :type action_id: str + :param action_text: Description of recommended actions. + :type action_text: str + :param action_uri: The uri linking to a documentation for the recommended + troubleshooting actions. + :type action_uri: str + :param action_uri_text: The information from the URI for the recommended + troubleshooting actions. + :type action_uri_text: str + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'action_text': {'key': 'actionText', 'type': 'str'}, + 'action_uri': {'key': 'actionUri', 'type': 'str'}, + 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, + } + + def __init__(self, *, action_id: str=None, action_text: str=None, action_uri: str=None, action_uri_text: str=None, **kwargs) -> None: + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = action_id + self.action_text = action_text + self.action_uri = action_uri + self.action_uri_text = action_uri_text diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_result.py index d473f86d36d8..272a7b938a21 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_result.py @@ -33,9 +33,9 @@ class TroubleshootingResult(Model): 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, } - def __init__(self, start_time=None, end_time=None, code=None, results=None): - super(TroubleshootingResult, self).__init__() - self.start_time = start_time - self.end_time = end_time - self.code = code - self.results = results + def __init__(self, **kwargs): + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.code = kwargs.get('code', None) + self.results = kwargs.get('results', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_result_py3.py new file mode 100644 index 000000000000..7ba0e3d67d37 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/troubleshooting_result_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingResult(Model): + """Troubleshooting information gained from specified resource. + + :param start_time: The start time of the troubleshooting. + :type start_time: datetime + :param end_time: The end time of the troubleshooting. + :type end_time: datetime + :param code: The result code of the troubleshooting. + :type code: str + :param results: Information from troubleshooting. + :type results: + list[~azure.mgmt.network.v2017_09_01.models.TroubleshootingDetails] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, + } + + def __init__(self, *, start_time=None, end_time=None, code: str=None, results=None, **kwargs) -> None: + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.code = code + self.results = results diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tunnel_connection_health.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tunnel_connection_health.py index b0ec1f39f801..ed3371116e54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tunnel_connection_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tunnel_connection_health.py @@ -52,8 +52,8 @@ class TunnelConnectionHealth(Model): 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, } - def __init__(self): - super(TunnelConnectionHealth, self).__init__() + def __init__(self, **kwargs): + super(TunnelConnectionHealth, self).__init__(**kwargs) self.tunnel = None self.connection_status = None self.ingress_bytes_transferred = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tunnel_connection_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tunnel_connection_health_py3.py new file mode 100644 index 000000000000..b69c207c2dbc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/tunnel_connection_health_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TunnelConnectionHealth(Model): + """VirtualNetworkGatewayConnection properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tunnel: Tunnel name. + :vartype tunnel: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values include: 'Unknown', 'Connecting', 'Connected', + 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnectionStatus + :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this + connection + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: The Egress Bytes Transferred in this + connection + :vartype egress_bytes_transferred: long + :ivar last_connection_established_utc_time: The time at which connection + was established in Utc format. + :vartype last_connection_established_utc_time: str + """ + + _validation = { + 'tunnel': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'last_connection_established_utc_time': {'readonly': True}, + } + + _attribute_map = { + 'tunnel': {'key': 'tunnel', 'type': 'str'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TunnelConnectionHealth, self).__init__(**kwargs) + self.tunnel = None + self.connection_status = None + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.last_connection_established_utc_time = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage.py index 6b216dff1bab..0e3ddb1ed5c3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage.py @@ -18,16 +18,18 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource identifier. :vartype id: str - :ivar unit: An enum describing the unit of measurement. Default value: - "Count" . + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . :vartype unit: str - :param current_value: The current value of the usage. + :param current_value: Required. The current value of the usage. :type current_value: long - :param limit: The limit of usage. + :param limit: Required. The limit of usage. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.network.v2017_09_01.models.UsageName """ @@ -49,9 +51,9 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.id = None - self.current_value = current_value - self.limit = limit - self.name = name + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage_name.py index df7f344bfb9b..bd1813944fdc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage_name_py3.py new file mode 100644 index 000000000000..4e5e3e10de15 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage_py3.py new file mode 100644 index 000000000000..a282520bf9e4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/usage_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes network resource usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource identifier. + :vartype id: str + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . + :vartype unit: str + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.network.v2017_09_01.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.id = None + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_parameters.py index 99a3da554383..8f222723243f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_parameters.py @@ -15,28 +15,30 @@ class VerificationIPFlowParameters(Model): """Parameters that define the IP flow to be verified. - :param target_resource_id: The ID of the target resource to perform - next-hop on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. :type target_resource_id: str - :param direction: The direction of the packet represented as a 5-tuple. - Possible values include: 'Inbound', 'Outbound' + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2017_09_01.models.Direction - :param protocol: Protocol to be verified on. Possible values include: - 'TCP', 'UDP' + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' :type protocol: str or ~azure.mgmt.network.v2017_09_01.models.Protocol - :param local_port: The local port. Acceptable values are a single integer - in the range (0-65535). Support for * for the source port, which depends - on the direction. + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type local_port: str - :param remote_port: The remote port. Acceptable values are a single - integer in the range (0-65535). Support for * for the source port, which - depends on the direction. + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type remote_port: str - :param local_ip_address: The local IP address. Acceptable values are valid - IPv4 addresses. + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. :type local_ip_address: str - :param remote_ip_address: The remote IP address. Acceptable values are - valid IPv4 addresses. + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. :type remote_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be @@ -65,13 +67,13 @@ class VerificationIPFlowParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, direction, protocol, local_port, remote_port, local_ip_address, remote_ip_address, target_nic_resource_id=None): - super(VerificationIPFlowParameters, self).__init__() - self.target_resource_id = target_resource_id - self.direction = direction - self.protocol = protocol - self.local_port = local_port - self.remote_port = remote_port - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.direction = kwargs.get('direction', None) + self.protocol = kwargs.get('protocol', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_parameters_py3.py new file mode 100644 index 000000000000..e2d91e25751c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_parameters_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowParameters(Model): + """Parameters that define the IP flow to be verified. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. + :type target_resource_id: str + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' + :type direction: str or ~azure.mgmt.network.v2017_09_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' + :type protocol: str or ~azure.mgmt.network.v2017_09_01.models.Protocol + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type local_port: str + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type remote_port: str + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. + :type local_ip_address: str + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. + :type remote_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of them, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'local_port': {'required': True}, + 'remote_port': {'required': True}, + 'local_ip_address': {'required': True}, + 'remote_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, direction, protocol, local_port: str, remote_port: str, local_ip_address: str, remote_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.direction = direction + self.protocol = protocol + self.local_port = local_port + self.remote_port = remote_port + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_result.py index b6fbc7c1ba9b..bf92fcce07da 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_result.py @@ -28,7 +28,7 @@ class VerificationIPFlowResult(Model): 'rule_name': {'key': 'ruleName', 'type': 'str'}, } - def __init__(self, access=None, rule_name=None): - super(VerificationIPFlowResult, self).__init__() - self.access = access - self.rule_name = rule_name + def __init__(self, **kwargs): + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.rule_name = kwargs.get('rule_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_result_py3.py new file mode 100644 index 000000000000..70cdcb2c478c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/verification_ip_flow_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowResult(Model): + """Results of IP flow verification on the target resource. + + :param access: Indicates whether the traffic is allowed or denied. + Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_09_01.models.Access + :param rule_name: Name of the rule. If input is not matched against any + security rule, it is not displayed. + :type rule_name: str + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + } + + def __init__(self, *, access=None, rule_name: str=None, **kwargs) -> None: + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = access + self.rule_name = rule_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network.py index 42d07731d117..f6d65104babd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network.py @@ -78,14 +78,14 @@ class VirtualNetwork(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid=None, provisioning_state=None, enable_ddos_protection=None, enable_vm_protection=None, etag=None): - super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags) - self.address_space = address_space - self.dhcp_options = dhcp_options - self.subnets = subnets - self.virtual_network_peerings = virtual_network_peerings - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.enable_ddos_protection = enable_ddos_protection - self.enable_vm_protection = enable_vm_protection - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetwork, self).__init__(**kwargs) + self.address_space = kwargs.get('address_space', None) + self.dhcp_options = kwargs.get('dhcp_options', None) + self.subnets = kwargs.get('subnets', None) + self.virtual_network_peerings = kwargs.get('virtual_network_peerings', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.enable_ddos_protection = kwargs.get('enable_ddos_protection', None) + self.enable_vm_protection = kwargs.get('enable_vm_protection', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_connection_gateway_reference.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_connection_gateway_reference.py index eb18a3c124ff..aa10101778f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_connection_gateway_reference.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_connection_gateway_reference.py @@ -15,8 +15,10 @@ class VirtualNetworkConnectionGatewayReference(Model): """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. - :param id: The ID of VirtualNetworkGateway or LocalNetworkGateway - resource. + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or + LocalNetworkGateway resource. :type id: str """ @@ -28,6 +30,6 @@ class VirtualNetworkConnectionGatewayReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id): - super(VirtualNetworkConnectionGatewayReference, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_connection_gateway_reference_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_connection_gateway_reference_py3.py new file mode 100644 index 000000000000..b2d9734baf3c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_connection_gateway_reference_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkConnectionGatewayReference(Model): + """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or + LocalNetworkGateway resource. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway.py index a1d9b8b51d1d..b409bd5782fe 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway.py @@ -98,17 +98,17 @@ class VirtualNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp=None, active_active=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid=None, etag=None): - super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.ip_configurations = ip_configurations - self.gateway_type = gateway_type - self.vpn_type = vpn_type - self.enable_bgp = enable_bgp - self.active_active = active_active - self.gateway_default_site = gateway_default_site - self.sku = sku - self.vpn_client_configuration = vpn_client_configuration - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(VirtualNetworkGateway, self).__init__(**kwargs) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.gateway_type = kwargs.get('gateway_type', None) + self.vpn_type = kwargs.get('vpn_type', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.active_active = kwargs.get('active_active', None) + self.gateway_default_site = kwargs.get('gateway_default_site', None) + self.sku = kwargs.get('sku', None) + self.vpn_client_configuration = kwargs.get('vpn_client_configuration', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection.py index e72b4c375b34..b0811806a910 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayConnection(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -30,8 +32,8 @@ class VirtualNetworkGatewayConnection(Resource): :type tags: dict[str, str] :param authorization_key: The authorizationKey. :type authorization_key: str - :param virtual_network_gateway1: The reference to virtual network gateway - resource. + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. :type virtual_network_gateway1: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway :param virtual_network_gateway2: The reference to virtual network gateway @@ -42,8 +44,8 @@ class VirtualNetworkGatewayConnection(Resource): resource. :type local_network_gateway2: ~azure.mgmt.network.v2017_09_01.models.LocalNetworkGateway - :param connection_type: Gateway connection type. Possible values are: - 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' :type connection_type: str or ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnectionType @@ -128,23 +130,23 @@ class VirtualNetworkGatewayConnection(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, virtual_network_gateway1, connection_type, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight=None, shared_key=None, peer=None, enable_bgp=None, use_policy_based_traffic_selectors=None, ipsec_policies=None, resource_guid=None, etag=None): - super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnection, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) self.connection_status = None self.tunnel_connection_status = None self.egress_bytes_transferred = None self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors - self.ipsec_policies = ipsec_policies - self.resource_guid = resource_guid + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection_list_entity.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection_list_entity.py index a37f08bc777f..6961d95266ff 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection_list_entity.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection_list_entity.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -30,8 +32,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): :type tags: dict[str, str] :param authorization_key: The authorizationKey. :type authorization_key: str - :param virtual_network_gateway1: The reference to virtual network gateway - resource. + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. :type virtual_network_gateway1: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkConnectionGatewayReference :param virtual_network_gateway2: The reference to virtual network gateway @@ -42,8 +44,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): resource. :type local_network_gateway2: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkConnectionGatewayReference - :param connection_type: Gateway connection type. Possible values are: - 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' :type connection_type: str or ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnectionType @@ -128,23 +130,23 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, virtual_network_gateway1, connection_type, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight=None, shared_key=None, peer=None, enable_bgp=None, use_policy_based_traffic_selectors=None, ipsec_policies=None, resource_guid=None, etag=None): - super(VirtualNetworkGatewayConnectionListEntity, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) self.connection_status = None self.tunnel_connection_status = None self.egress_bytes_transferred = None self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors - self.ipsec_policies = ipsec_policies - self.resource_guid = resource_guid + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection_list_entity_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection_list_entity_py3.py new file mode 100644 index 000000000000..84308117ea9b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection_list_entity_py3.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnectionListEntity(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkConnectionGatewayReference + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkConnectionGatewayReference + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkConnectionGatewayReference + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2017_09_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2017_09_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, use_policy_based_traffic_selectors: bool=None, ipsec_policies=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection_py3.py new file mode 100644 index 000000000000..2c1877de5982 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection_py3.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnection(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2017_09_01.models.LocalNetworkGateway + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2017_09_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2017_09_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, use_policy_based_traffic_selectors: bool=None, ipsec_policies=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_ip_configuration.py index 0dc813d6c3b5..39dc1fe89950 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_ip_configuration.py @@ -55,11 +55,11 @@ class VirtualNetworkGatewayIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name=None, etag=None): - super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id) - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address + def __init__(self, **kwargs): + super(VirtualNetworkGatewayIPConfiguration, self).__init__(**kwargs) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..d071df60dbbe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_ip_configuration_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_09_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_09_01.models.SubResource + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :ivar provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_py3.py new file mode 100644 index 000000000000..0a58c67a8996 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_py3.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param ip_configurations: IP configurations for virtual network gateway. + :type ip_configurations: + list[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible + values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', + 'ExpressRoute' + :type gateway_type: str or + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayType + :param vpn_type: The type of this virtual network gateway. Possible values + are: 'PolicyBased' and 'RouteBased'. Possible values include: + 'PolicyBased', 'RouteBased' + :type vpn_type: str or ~azure.mgmt.network.v2017_09_01.models.VpnType + :param enable_bgp: Whether BGP is enabled for this virtual network gateway + or not. + :type enable_bgp: bool + :param active_active: ActiveActive flag + :type active_active: bool + :param gateway_default_site: The reference of the LocalNetworkGateway + resource which represents local network site having default routes. Assign + Null value in case of removing existing default site setting. + :type gateway_default_site: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param sku: The reference of the VirtualNetworkGatewaySku resource which + represents the SKU selected for Virtual network gateway. + :type sku: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewaySku + :param vpn_client_configuration: The reference of the + VpnClientConfiguration resource which represents the P2S VpnClient + configurations. + :type vpn_client_configuration: + ~azure.mgmt.network.v2017_09_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2017_09_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + VirtualNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGateway resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, + 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, + 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'active_active': {'key': 'properties.activeActive', 'type': 'bool'}, + 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, + 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, + 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp: bool=None, active_active: bool=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.ip_configurations = ip_configurations + self.gateway_type = gateway_type + self.vpn_type = vpn_type + self.enable_bgp = enable_bgp + self.active_active = active_active + self.gateway_default_site = gateway_default_site + self.sku = sku + self.vpn_client_configuration = vpn_client_configuration + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_sku.py index 0089fe3d5399..de07f5a4a6d0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_sku.py @@ -35,8 +35,8 @@ class VirtualNetworkGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(VirtualNetworkGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_sku_py3.py new file mode 100644 index 000000000000..50406032770f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_sku_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkGatewaySku(Model): + """VirtualNetworkGatewaySku details. + + :param name: Gateway SKU name. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type name: str or + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewaySkuName + :param tier: Gateway SKU tier. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type tier: str or + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewaySkuTier + :param capacity: The capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_peering.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_peering.py index d12e782b08a6..27e7325e0371 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_peering.py @@ -72,15 +72,15 @@ class VirtualNetworkPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, allow_virtual_network_access=None, allow_forwarded_traffic=None, allow_gateway_transit=None, use_remote_gateways=None, remote_virtual_network=None, remote_address_space=None, peering_state=None, provisioning_state=None, name=None, etag=None): - super(VirtualNetworkPeering, self).__init__(id=id) - self.allow_virtual_network_access = allow_virtual_network_access - self.allow_forwarded_traffic = allow_forwarded_traffic - self.allow_gateway_transit = allow_gateway_transit - self.use_remote_gateways = use_remote_gateways - self.remote_virtual_network = remote_virtual_network - self.remote_address_space = remote_address_space - self.peering_state = peering_state - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetworkPeering, self).__init__(**kwargs) + self.allow_virtual_network_access = kwargs.get('allow_virtual_network_access', None) + self.allow_forwarded_traffic = kwargs.get('allow_forwarded_traffic', None) + self.allow_gateway_transit = kwargs.get('allow_gateway_transit', None) + self.use_remote_gateways = kwargs.get('use_remote_gateways', None) + self.remote_virtual_network = kwargs.get('remote_virtual_network', None) + self.remote_address_space = kwargs.get('remote_address_space', None) + self.peering_state = kwargs.get('peering_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_peering_py3.py new file mode 100644 index 000000000000..e8f3031a09d2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_peering_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkPeering(SubResource): + """Peerings in a virtual network resource. + + :param id: Resource ID. + :type id: str + :param allow_virtual_network_access: Whether the VMs in the linked virtual + network space would be able to access all the VMs in local Virtual network + space. + :type allow_virtual_network_access: bool + :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs + in the remote virtual network will be allowed/disallowed. + :type allow_forwarded_traffic: bool + :param allow_gateway_transit: If gateway links can be used in remote + virtual networking to link to this virtual network. + :type allow_gateway_transit: bool + :param use_remote_gateways: If remote gateways can be used on this virtual + network. If the flag is set to true, and allowGatewayTransit on remote + peering is also true, virtual network will use gateways of remote virtual + network for transit. Only one peering can have this flag set to true. This + flag cannot be set if virtual network already has a gateway. + :type use_remote_gateways: bool + :param remote_virtual_network: The reference of the remote virtual + network. The remote virtual network can be in the same or different region + (preview). See here to register for the preview and learn more + (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + :type remote_virtual_network: + ~azure.mgmt.network.v2017_09_01.models.SubResource + :param remote_address_space: The reference of the remote virtual network + address space. + :type remote_address_space: + ~azure.mgmt.network.v2017_09_01.models.AddressSpace + :param peering_state: The status of the virtual network peering. Possible + values are 'Initiated', 'Connected', and 'Disconnected'. Possible values + include: 'Initiated', 'Connected', 'Disconnected' + :type peering_state: str or + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkPeeringState + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, + 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, + 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, + 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'remote_address_space': {'key': 'properties.remoteAddressSpace', 'type': 'AddressSpace'}, + 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, allow_virtual_network_access: bool=None, allow_forwarded_traffic: bool=None, allow_gateway_transit: bool=None, use_remote_gateways: bool=None, remote_virtual_network=None, remote_address_space=None, peering_state=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkPeering, self).__init__(id=id, **kwargs) + self.allow_virtual_network_access = allow_virtual_network_access + self.allow_forwarded_traffic = allow_forwarded_traffic + self.allow_gateway_transit = allow_gateway_transit + self.use_remote_gateways = use_remote_gateways + self.remote_virtual_network = remote_virtual_network + self.remote_address_space = remote_address_space + self.peering_state = peering_state + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_py3.py new file mode 100644 index 000000000000..4b7ab5b2ab95 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetwork(Resource): + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param address_space: The AddressSpace that contains an array of IP + address ranges that can be used by subnets. + :type address_space: ~azure.mgmt.network.v2017_09_01.models.AddressSpace + :param dhcp_options: The dhcpOptions that contains an array of DNS servers + available to VMs deployed in the virtual network. + :type dhcp_options: ~azure.mgmt.network.v2017_09_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2017_09_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkPeering] + :param resource_guid: The resourceGuid property of the Virtual Network + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param enable_ddos_protection: Indicates if DDoS protection is enabled for + all the protected resources in a Virtual Network. + :type enable_ddos_protection: bool + :param enable_vm_protection: Indicates if Vm protection is enabled for all + the subnets in a Virtual Network. + :type enable_vm_protection: bool + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'enable_ddos_protection': {'key': 'properties.enableDdosProtection', 'type': 'bool'}, + 'enable_vm_protection': {'key': 'properties.enableVmProtection', 'type': 'bool'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid: str=None, provisioning_state: str=None, enable_ddos_protection: bool=None, enable_vm_protection: bool=None, etag: str=None, **kwargs) -> None: + super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.address_space = address_space + self.dhcp_options = dhcp_options + self.subnets = subnets + self.virtual_network_peerings = virtual_network_peerings + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.enable_ddos_protection = enable_ddos_protection + self.enable_vm_protection = enable_vm_protection + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage.py index e229cfeab24e..ae2fe1189db0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage.py @@ -47,8 +47,8 @@ class VirtualNetworkUsage(Model): 'unit': {'key': 'unit', 'type': 'str'}, } - def __init__(self): - super(VirtualNetworkUsage, self).__init__() + def __init__(self, **kwargs): + super(VirtualNetworkUsage, self).__init__(**kwargs) self.current_value = None self.id = None self.limit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage_name.py index 01fcbf0875eb..607ccec3b964 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage_name.py @@ -34,7 +34,7 @@ class VirtualNetworkUsageName(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self): - super(VirtualNetworkUsageName, self).__init__() + def __init__(self, **kwargs): + super(VirtualNetworkUsageName, self).__init__(**kwargs) self.localized_value = None self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage_name_py3.py new file mode 100644 index 000000000000..1651ebda7e77 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage_name_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsageName(Model): + """Usage strings container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar localized_value: Localized subnet size and usage string. + :vartype localized_value: str + :ivar value: Subnet size and usage string. + :vartype value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsageName, self).__init__(**kwargs) + self.localized_value = None + self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage_py3.py new file mode 100644 index 000000000000..cccedc1acd70 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_usage_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsage(Model): + """Usage details for subnet. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar current_value: Indicates number of IPs used from the Subnet. + :vartype current_value: float + :ivar id: Subnet identifier. + :vartype id: str + :ivar limit: Indicates the size of the subnet. + :vartype limit: float + :ivar name: The name containing common and localized value for usage. + :vartype name: + ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkUsageName + :ivar unit: Usage units. Returns 'Count' + :vartype unit: str + """ + + _validation = { + 'current_value': {'readonly': True}, + 'id': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'name': {'key': 'name', 'type': 'VirtualNetworkUsageName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsage, self).__init__(**kwargs) + self.current_value = None + self.id = None + self.limit = None + self.name = None + self.unit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_configuration.py index 76dbc6aa30db..0719102ee69d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_configuration.py @@ -48,11 +48,11 @@ class VpnClientConfiguration(Model): 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, } - def __init__(self, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, vpn_client_protocols=None, radius_server_address=None, radius_server_secret=None): - super(VpnClientConfiguration, self).__init__() - self.vpn_client_address_pool = vpn_client_address_pool - self.vpn_client_root_certificates = vpn_client_root_certificates - self.vpn_client_revoked_certificates = vpn_client_revoked_certificates - self.vpn_client_protocols = vpn_client_protocols - self.radius_server_address = radius_server_address - self.radius_server_secret = radius_server_secret + def __init__(self, **kwargs): + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = kwargs.get('vpn_client_address_pool', None) + self.vpn_client_root_certificates = kwargs.get('vpn_client_root_certificates', None) + self.vpn_client_revoked_certificates = kwargs.get('vpn_client_revoked_certificates', None) + self.vpn_client_protocols = kwargs.get('vpn_client_protocols', None) + self.radius_server_address = kwargs.get('radius_server_address', None) + self.radius_server_secret = kwargs.get('radius_server_secret', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_configuration_py3.py new file mode 100644 index 000000000000..8c90b0870b75 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_configuration_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientConfiguration(Model): + """VpnClientConfiguration for P2S client. + + :param vpn_client_address_pool: The reference of the address space + resource which represents Address space for P2S VpnClient. + :type vpn_client_address_pool: + ~azure.mgmt.network.v2017_09_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual + network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2017_09_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for + Virtual network gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2017_09_01.models.VpnClientRevokedCertificate] + :param vpn_client_protocols: VpnClientProtocols for Virtual network + gateway. + :type vpn_client_protocols: list[str or + ~azure.mgmt.network.v2017_09_01.models.VpnClientProtocol] + :param radius_server_address: The radius server address property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_address: str + :param radius_server_secret: The radius secret property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_secret: str + """ + + _attribute_map = { + 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, + 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, + 'vpn_client_protocols': {'key': 'vpnClientProtocols', 'type': '[str]'}, + 'radius_server_address': {'key': 'radiusServerAddress', 'type': 'str'}, + 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, + } + + def __init__(self, *, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, vpn_client_protocols=None, radius_server_address: str=None, radius_server_secret: str=None, **kwargs) -> None: + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = vpn_client_address_pool + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + self.vpn_client_protocols = vpn_client_protocols + self.radius_server_address = radius_server_address + self.radius_server_secret = radius_server_secret diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_parameters.py index 7aaa29750ed2..25c794f5a872 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_parameters.py @@ -42,9 +42,9 @@ class VpnClientParameters(Model): 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, } - def __init__(self, processor_architecture=None, authentication_method=None, radius_server_auth_certificate=None, client_root_certificates=None): - super(VpnClientParameters, self).__init__() - self.processor_architecture = processor_architecture - self.authentication_method = authentication_method - self.radius_server_auth_certificate = radius_server_auth_certificate - self.client_root_certificates = client_root_certificates + def __init__(self, **kwargs): + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = kwargs.get('processor_architecture', None) + self.authentication_method = kwargs.get('authentication_method', None) + self.radius_server_auth_certificate = kwargs.get('radius_server_auth_certificate', None) + self.client_root_certificates = kwargs.get('client_root_certificates', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_parameters_py3.py new file mode 100644 index 000000000000..55d97b433499 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_parameters_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientParameters(Model): + """Vpn Client Parameters for package generation. + + :param processor_architecture: VPN client Processor Architecture. Possible + values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' + :type processor_architecture: str or + ~azure.mgmt.network.v2017_09_01.models.ProcessorArchitecture + :param authentication_method: VPN client Authentication Method. Possible + values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', + 'EAPMSCHAPv2' + :type authentication_method: str or + ~azure.mgmt.network.v2017_09_01.models.AuthenticationMethod + :param radius_server_auth_certificate: The public certificate data for the + radius server authentication certificate as a Base-64 encoded string. + Required only if external radius authentication has been configured with + EAPTLS authentication. + :type radius_server_auth_certificate: str + :param client_root_certificates: A list of client root certificates public + certificate data encoded as Base-64 strings. Optional parameter for + external radius based authentication with EAPTLS. + :type client_root_certificates: list[str] + """ + + _attribute_map = { + 'processor_architecture': {'key': 'processorArchitecture', 'type': 'str'}, + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + 'radius_server_auth_certificate': {'key': 'radiusServerAuthCertificate', 'type': 'str'}, + 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, + } + + def __init__(self, *, processor_architecture=None, authentication_method=None, radius_server_auth_certificate: str=None, client_root_certificates=None, **kwargs) -> None: + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = processor_architecture + self.authentication_method = authentication_method + self.radius_server_auth_certificate = radius_server_auth_certificate + self.client_root_certificates = client_root_certificates diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_revoked_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_revoked_certificate.py index ebd6a4bbba2f..1fa6f6a1ef23 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_revoked_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_revoked_certificate.py @@ -46,9 +46,9 @@ class VpnClientRevokedCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, thumbprint=None, name=None, etag=None): - super(VpnClientRevokedCertificate, self).__init__(id=id) - self.thumbprint = thumbprint + def __init__(self, **kwargs): + super(VpnClientRevokedCertificate, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_revoked_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_revoked_certificate_py3.py new file mode 100644 index 000000000000..7c1e05f283a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_revoked_certificate_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + :ivar provisioning_state: The provisioning state of the VPN client revoked + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, thumbprint: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRevokedCertificate, self).__init__(id=id, **kwargs) + self.thumbprint = thumbprint + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_root_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_root_certificate.py index 6d820d3a8c11..48c7033d42ec 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_root_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_root_certificate.py @@ -18,9 +18,11 @@ class VpnClientRootCertificate(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param public_cert_data: The certificate public data. + :param public_cert_data: Required. The certificate public data. :type public_cert_data: str :ivar provisioning_state: The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and @@ -47,9 +49,9 @@ class VpnClientRootCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, public_cert_data, id=None, name=None, etag=None): - super(VpnClientRootCertificate, self).__init__(id=id) - self.public_cert_data = public_cert_data + def __init__(self, **kwargs): + super(VpnClientRootCertificate, self).__init__(**kwargs) + self.public_cert_data = kwargs.get('public_cert_data', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_root_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_root_certificate_py3.py new file mode 100644 index 000000000000..db8a1e547705 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_client_root_certificate_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param public_cert_data: Required. The certificate public data. + :type public_cert_data: str + :ivar provisioning_state: The provisioning state of the VPN client root + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'public_cert_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, public_cert_data: str, id: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRootCertificate, self).__init__(id=id, **kwargs) + self.public_cert_data = public_cert_data + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_device_script_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_device_script_parameters.py index 89ee8af0645a..e4f8f12701b7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_device_script_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_device_script_parameters.py @@ -29,8 +29,8 @@ class VpnDeviceScriptParameters(Model): 'firmware_version': {'key': 'firmwareVersion', 'type': 'str'}, } - def __init__(self, vendor=None, device_family=None, firmware_version=None): - super(VpnDeviceScriptParameters, self).__init__() - self.vendor = vendor - self.device_family = device_family - self.firmware_version = firmware_version + def __init__(self, **kwargs): + super(VpnDeviceScriptParameters, self).__init__(**kwargs) + self.vendor = kwargs.get('vendor', None) + self.device_family = kwargs.get('device_family', None) + self.firmware_version = kwargs.get('firmware_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_device_script_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_device_script_parameters_py3.py new file mode 100644 index 000000000000..e5520ffb5a18 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/vpn_device_script_parameters_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnDeviceScriptParameters(Model): + """Vpn device configuration script generation parameters. + + :param vendor: The vendor for the vpn device. + :type vendor: str + :param device_family: The device family for the vpn device. + :type device_family: str + :param firmware_version: The firmware version for the vpn device. + :type firmware_version: str + """ + + _attribute_map = { + 'vendor': {'key': 'vendor', 'type': 'str'}, + 'device_family': {'key': 'deviceFamily', 'type': 'str'}, + 'firmware_version': {'key': 'firmwareVersion', 'type': 'str'}, + } + + def __init__(self, *, vendor: str=None, device_family: str=None, firmware_version: str=None, **kwargs) -> None: + super(VpnDeviceScriptParameters, self).__init__(**kwargs) + self.vendor = vendor + self.device_family = device_family + self.firmware_version = firmware_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/network_management_client.py index 811d856a791c..a26ee74b754a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/network_management_client.py @@ -15,7 +15,8 @@ from .version import VERSION from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.application_gateways_operations import ApplicationGatewaysOperations from .operations.application_security_groups_operations import ApplicationSecurityGroupsOperations @@ -287,7 +288,7 @@ def check_dns_name_availability( api_version = "2017-09-01" # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability' + url = self.check_dns_name_availability.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -328,3 +329,4 @@ def check_dns_name_availability( return client_raw_response return deserialized + check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/application_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/application_gateways_operations.py index ba33568a41f5..9e733f797008 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/application_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/application_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ApplicationGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def get( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def _create_or_update_initial( self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_09_01.models.ApplicationGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ApplicationGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ApplicationGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ApplicationGateway', response) if raw: @@ -312,12 +276,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def _update_tags_initial( @@ -325,7 +291,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -372,7 +338,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, application_gateway_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -382,13 +348,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ApplicationGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ApplicationGateway]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -399,30 +368,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ApplicationGateway', response) if raw: @@ -431,12 +378,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -458,7 +407,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -504,6 +453,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -523,7 +473,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -568,12 +518,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} def _start_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -609,7 +560,7 @@ def _start_initial( return client_raw_response def start( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -617,12 +568,14 @@ def start( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -632,46 +585,26 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} def _stop_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -707,7 +640,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -715,12 +648,14 @@ def stop( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -730,46 +665,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} def _backend_health_initial( self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth' + url = self.backend_health.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -814,7 +729,7 @@ def _backend_health_initial( return deserialized def backend_health( - self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the backend health of the specified application gateway in a resource group. @@ -826,13 +741,17 @@ def backend_health( referenced in backend health. :type expand: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGatewayBackendHealth or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApplicationGatewayBackendHealth or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendHealth] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ApplicationGatewayBackendHealth]] :raises: :class:`CloudError` """ raw_result = self._backend_health_initial( @@ -843,30 +762,8 @@ def backend_health( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ApplicationGatewayBackendHealth', response) if raw: @@ -875,12 +772,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} def list_available_waf_rule_sets( self, custom_headers=None, raw=False, **operation_config): @@ -899,7 +798,7 @@ def list_available_waf_rule_sets( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets' + url = self.list_available_waf_rule_sets.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -938,6 +837,7 @@ def list_available_waf_rule_sets( return client_raw_response return deserialized + list_available_waf_rule_sets.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'} def list_available_ssl_options( self, custom_headers=None, raw=False, **operation_config): @@ -956,7 +856,7 @@ def list_available_ssl_options( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default' + url = self.list_available_ssl_options.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -995,6 +895,7 @@ def list_available_ssl_options( return client_raw_response return deserialized + list_available_ssl_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default'} def list_available_ssl_predefined_policies( self, custom_headers=None, raw=False, **operation_config): @@ -1015,7 +916,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies' + url = self.list_available_ssl_predefined_policies.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -1060,6 +961,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_ssl_predefined_policies.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies'} def get_ssl_predefined_policy( self, predefined_policy_name, custom_headers=None, raw=False, **operation_config): @@ -1080,7 +982,7 @@ def get_ssl_predefined_policy( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}' + url = self.get_ssl_predefined_policy.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'predefinedPolicyName': self._serialize.url("predefined_policy_name", predefined_policy_name, 'str') @@ -1120,3 +1022,4 @@ def get_ssl_predefined_policy( return client_raw_response return deserialized + get_ssl_predefined_policy.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/application_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/application_security_groups_operations.py index 6cfd55d1e4ce..5b63a80b94c7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/application_security_groups_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/application_security_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ApplicationSecurityGroupsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -88,12 +88,14 @@ def delete( security group. :type application_security_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -103,40 +105,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} def get( self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, **operation_config): @@ -159,7 +141,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), @@ -200,12 +182,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} def _create_or_update_initial( self, resource_group_name, application_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), @@ -254,7 +237,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,17 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroup :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApplicationSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ApplicationSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +271,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ApplicationSecurityGroup', response) if raw: @@ -316,12 +281,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -341,7 +308,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -386,6 +353,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +375,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -453,3 +421,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/available_endpoint_services_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/available_endpoint_services_operations.py index e74071da6bbe..07adde1d940b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/available_endpoint_services_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/available_endpoint_services_operations.py @@ -22,7 +22,7 @@ class AvailableEndpointServicesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/bgp_service_communities_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/bgp_service_communities_operations.py index ced26ed0a3de..818a33c8e616 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/bgp_service_communities_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/bgp_service_communities_operations.py @@ -22,7 +22,7 @@ class BgpServiceCommunitiesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/default_security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/default_security_rules_operations.py index 2e021b4d6ef1..2e9b406585bd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/default_security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/default_security_rules_operations.py @@ -22,7 +22,7 @@ class DefaultSecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -60,7 +60,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -107,6 +107,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules'} def get( self, resource_group_name, network_security_group_name, default_security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -131,7 +132,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -173,3 +174,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_circuit_authorizations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_circuit_authorizations_operations.py index 477421656a89..d49d94a312bd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_circuit_authorizations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_circuit_authorizations_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified authorization from the specified express route circuit. @@ -91,12 +91,14 @@ def delete( :param authorization_name: The name of the authorization. :type authorization_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def get( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): @@ -166,7 +148,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an authorization in the specified express route circuit. @@ -278,13 +261,17 @@ def create_or_update( :type authorization_parameters: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitAuthorization :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitAuthorization or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitAuthorization or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitAuthorization] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitAuthorization]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -296,30 +283,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitAuthorization', response) if raw: @@ -328,12 +293,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +324,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -404,3 +371,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_circuit_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_circuit_peerings_operations.py index bd8646c82217..908974b0d513 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_circuit_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_circuit_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param peering_name: The name of the peering. :type peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def get( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -275,13 +258,17 @@ def create_or_update( :type peering_parameters: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitPeering or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitPeering', response) if raw: @@ -325,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -401,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_circuits_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_circuits_operations.py index fcf2cf286960..f97ad5d08a42 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_circuits_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_circuits_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param circuit_name: The name of the express route circuit. :type circuit_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def get( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuit :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuit or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuit] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuit]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuit', response) if raw: @@ -312,12 +276,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _update_tags_initial( @@ -325,7 +291,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -372,7 +338,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, circuit_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -382,13 +348,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuit or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuit] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuit]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -399,30 +368,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuit', response) if raw: @@ -431,18 +378,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _list_arp_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}' + url = self.list_arp_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -487,7 +436,7 @@ def _list_arp_table_initial( return deserialized def list_arp_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -500,14 +449,17 @@ def list_arp_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsArpTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsArpTableListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitsArpTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitsArpTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_arp_table_initial( @@ -519,30 +471,8 @@ def list_arp_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', response) if raw: @@ -551,18 +481,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} def _list_routes_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}' + url = self.list_routes_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -607,7 +539,7 @@ def _list_routes_table_initial( return deserialized def list_routes_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -620,14 +552,18 @@ def list_routes_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitsRoutesTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitsRoutesTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_initial( @@ -639,30 +575,8 @@ def list_routes_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', response) if raw: @@ -671,18 +585,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} def _list_routes_table_summary_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}' + url = self.list_routes_table_summary.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -727,7 +643,7 @@ def _list_routes_table_summary_initial( return deserialized def list_routes_table_summary( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -740,14 +656,18 @@ def list_routes_table_summary( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableSummaryListResult or ClientRawResponse - if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableSummaryListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_summary_initial( @@ -759,30 +679,8 @@ def list_routes_table_summary( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', response) if raw: @@ -791,12 +689,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} def get_stats( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -818,7 +718,7 @@ def get_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats' + url = self.get_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -859,6 +759,7 @@ def get_stats( return client_raw_response return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} def get_peering_stats( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -882,7 +783,7 @@ def get_peering_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats' + url = self.get_peering_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -924,6 +825,7 @@ def get_peering_stats( return client_raw_response return deserialized + get_peering_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -945,7 +847,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -991,6 +893,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -1010,7 +913,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -1055,3 +958,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_service_providers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_service_providers_operations.py index 3176e462d554..2f91abf10aae 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_service_providers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/express_route_service_providers_operations.py @@ -22,7 +22,7 @@ class ExpressRouteServiceProvidersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/inbound_nat_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/inbound_nat_rules_operations.py index 81df0094ade1..f2e5853b975e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/inbound_nat_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/inbound_nat_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class InboundNatRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -61,7 +61,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -108,12 +108,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules'} def _delete_initial( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -150,7 +151,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -160,12 +161,14 @@ def delete( :param inbound_nat_rule_name: The name of the inbound nat rule. :type inbound_nat_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -176,40 +179,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} def get( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -234,7 +217,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -278,12 +261,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -333,7 +317,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -347,13 +331,16 @@ def create_or_update( :type inbound_nat_rule_parameters: ~azure.mgmt.network.v2017_09_01.models.InboundNatRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - InboundNatRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns InboundNatRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.InboundNatRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.InboundNatRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -365,30 +352,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('InboundNatRule', response) if raw: @@ -397,9 +362,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_backend_address_pools_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_backend_address_pools_operations.py index fc0c53d5dabe..2de9e81128a3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_backend_address_pools_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_backend_address_pools_operations.py @@ -22,7 +22,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools'} def get( self, resource_group_name, load_balancer_name, backend_address_pool_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -171,3 +172,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_frontend_ip_configurations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_frontend_ip_configurations_operations.py index aee08565c6bf..eda1d3eccec8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_frontend_ip_configurations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_frontend_ip_configurations_operations.py @@ -22,7 +22,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations'} def get( self, resource_group_name, load_balancer_name, frontend_ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -171,3 +172,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_load_balancing_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_load_balancing_rules_operations.py index cbdeac92b1ec..f81abea90f9e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_load_balancing_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_load_balancing_rules_operations.py @@ -22,7 +22,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules'} def get( self, resource_group_name, load_balancer_name, load_balancing_rule_name, custom_headers=None, raw=False, **operation_config): @@ -128,7 +129,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -170,3 +171,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_network_interfaces_operations.py index 0b35ffe81e0a..02351a6db68e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_network_interfaces_operations.py @@ -22,7 +22,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,3 +106,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_probes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_probes_operations.py index ff2489e8176b..eeff273b6f65 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_probes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancer_probes_operations.py @@ -22,7 +22,7 @@ class LoadBalancerProbesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes'} def get( self, resource_group_name, load_balancer_name, probe_name, custom_headers=None, raw=False, **operation_config): @@ -128,7 +129,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -170,3 +171,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancers_operations.py index fedc1bcd6982..4ae922ab13a8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/load_balancers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param load_balancer_name: The name of the load balancer. :type load_balancer_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def get( self, resource_group_name, load_balancer_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( balancer operation. :type parameters: ~azure.mgmt.network.v2017_09_01.models.LoadBalancer :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns LoadBalancer - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.LoadBalancer] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.LoadBalancer]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LoadBalancer', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def _update_tags_initial( @@ -328,7 +294,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -375,7 +341,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, load_balancer_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -385,13 +351,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns LoadBalancer - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.LoadBalancer] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.LoadBalancer]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -402,30 +371,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('LoadBalancer', response) if raw: @@ -434,12 +381,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -459,7 +408,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -504,6 +453,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -525,7 +475,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -571,3 +521,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/local_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/local_network_gateways_operations.py index 1d43fe7963a4..f56dca7fcfd9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/local_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/local_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LocalNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a local network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_09_01.models.LocalNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - LocalNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.LocalNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.LocalNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LocalNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def get( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def _delete_initial( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type local_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def _update_tags_initial( @@ -329,7 +295,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -376,7 +342,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, local_network_gateway_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -387,13 +353,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - LocalNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.LocalNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.LocalNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -404,30 +373,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('LocalNetworkGateway', response) if raw: @@ -436,12 +383,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -463,7 +412,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -509,3 +458,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_interface_ip_configurations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_interface_ip_configurations_operations.py index 8253ba4741db..17f5d47a39cd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_interface_ip_configurations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_interface_ip_configurations_operations.py @@ -22,7 +22,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations'} def get( self, resource_group_name, network_interface_name, ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -130,7 +131,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -172,3 +173,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_interface_load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_interface_load_balancers_operations.py index 192d27b90d47..87846c5e610f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_interface_load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_interface_load_balancers_operations.py @@ -22,7 +22,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -106,3 +106,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_interfaces_operations.py index 82ea96c3fd96..92760e5697c6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_interfaces_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ models = models @@ -43,7 +43,7 @@ def _delete_initial( api_version = "2017-09-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def get( self, resource_group_name, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( api_version = "2017-09-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -203,6 +185,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def _create_or_update_initial( @@ -210,7 +193,7 @@ def _create_or_update_initial( api_version = "2017-09-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_09_01.models.NetworkInterface :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkInterface or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.NetworkInterface] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.NetworkInterface]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkInterface', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def _update_tags_initial( @@ -335,7 +301,7 @@ def _update_tags_initial( api_version = "2017-09-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -382,7 +348,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, network_interface_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -392,13 +358,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkInterface or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.NetworkInterface] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.NetworkInterface]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -409,30 +378,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NetworkInterface', response) if raw: @@ -441,12 +388,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -468,7 +417,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -513,6 +462,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -536,7 +486,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -582,6 +532,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} def _get_effective_route_table_initial( @@ -589,7 +540,7 @@ def _get_effective_route_table_initial( api_version = "2017-09-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable' + url = self.get_effective_route_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -632,7 +583,7 @@ def _get_effective_route_table_initial( return deserialized def get_effective_route_table( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -640,13 +591,17 @@ def get_effective_route_table( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveRouteListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.EffectiveRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.EffectiveRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_effective_route_table_initial( @@ -656,30 +611,8 @@ def get_effective_route_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveRouteListResult', response) if raw: @@ -688,12 +621,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_effective_route_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} def _list_effective_network_security_groups_initial( @@ -701,7 +636,7 @@ def _list_effective_network_security_groups_initial( api_version = "2017-09-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups' + url = self.list_effective_network_security_groups.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -744,7 +679,7 @@ def _list_effective_network_security_groups_initial( return deserialized def list_effective_network_security_groups( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -752,14 +687,18 @@ def list_effective_network_security_groups( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveNetworkSecurityGroupListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveNetworkSecurityGroupListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.EffectiveNetworkSecurityGroupListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.EffectiveNetworkSecurityGroupListResult]] :raises: :class:`CloudError` """ raw_result = self._list_effective_network_security_groups_initial( @@ -769,30 +708,8 @@ def list_effective_network_security_groups( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', response) if raw: @@ -801,12 +718,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_effective_network_security_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} def list_virtual_machine_scale_set_vm_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, custom_headers=None, raw=False, **operation_config): @@ -836,7 +755,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces' + url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -884,6 +803,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} def list_virtual_machine_scale_set_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -910,7 +830,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces' + url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -957,6 +877,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} def get_virtual_machine_scale_set_network_interface( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -986,7 +907,7 @@ def get_virtual_machine_scale_set_network_interface( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}' + url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -1031,6 +952,7 @@ def get_virtual_machine_scale_set_network_interface( return client_raw_response return deserialized + get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} def list_virtual_machine_scale_set_ip_configurations( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -1064,7 +986,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations' + url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -1115,6 +1037,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_ip_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations'} def get_virtual_machine_scale_set_ip_configuration( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -1149,7 +1072,7 @@ def get_virtual_machine_scale_set_ip_configuration( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}' + url = self.get_virtual_machine_scale_set_ip_configuration.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -1195,3 +1118,4 @@ def get_virtual_machine_scale_set_ip_configuration( return client_raw_response return deserialized + get_virtual_machine_scale_set_ip_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_security_groups_operations.py index 9f92b09e83d3..09e44ef306e3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_security_groups_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_security_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkSecurityGroupsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -88,12 +88,14 @@ def delete( group. :type network_security_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -103,40 +105,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def get( self, resource_group_name, network_security_group_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -203,12 +185,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -257,7 +240,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network security group in the specified resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroup :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkSecurityGroup', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def _update_tags_initial( @@ -333,7 +299,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -380,7 +346,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, network_security_group_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -391,13 +357,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.NetworkSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -408,30 +377,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NetworkSecurityGroup', response) if raw: @@ -440,12 +387,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -465,7 +414,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -510,6 +459,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -531,7 +481,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -577,3 +527,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_watchers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_watchers_operations.py index 4bf10f04845a..9df65690d0cb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_watchers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/network_watchers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkWatchersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -62,7 +62,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -109,6 +109,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def get( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -170,12 +171,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def _delete_initial( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -211,7 +213,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -219,12 +221,14 @@ def delete( :param network_watcher_name: The name of the network watcher. :type network_watcher_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -234,40 +238,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def update_tags( self, resource_group_name, network_watcher_name, tags=None, custom_headers=None, raw=False, **operation_config): @@ -292,7 +276,7 @@ def update_tags( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -337,6 +321,7 @@ def update_tags( return client_raw_response return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -358,7 +343,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -404,6 +389,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -423,7 +409,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -468,6 +454,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'} def get_topology( self, resource_group_name, network_watcher_name, target_resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -493,7 +480,7 @@ def get_topology( parameters = models.TopologyParameters(target_resource_group_name=target_resource_group_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology' + url = self.get_topology.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -538,12 +525,13 @@ def get_topology( return client_raw_response return deserialized + get_topology.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'} def _verify_ip_flow_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify' + url = self.verify_ip_flow.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -592,7 +580,7 @@ def _verify_ip_flow_initial( return deserialized def verify_ip_flow( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Verify IP flow from the specified VM to a location given the currently configured NSG rules. @@ -604,13 +592,17 @@ def verify_ip_flow( :type parameters: ~azure.mgmt.network.v2017_09_01.models.VerificationIPFlowParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VerificationIPFlowResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VerificationIPFlowResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.VerificationIPFlowResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.VerificationIPFlowResult]] :raises: :class:`CloudError` """ raw_result = self._verify_ip_flow_initial( @@ -621,30 +613,8 @@ def verify_ip_flow( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VerificationIPFlowResult', response) if raw: @@ -653,18 +623,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + verify_ip_flow.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} def _get_next_hop_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop' + url = self.get_next_hop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -713,7 +685,7 @@ def _get_next_hop_initial( return deserialized def get_next_hop( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -725,13 +697,16 @@ def get_next_hop( :type parameters: ~azure.mgmt.network.v2017_09_01.models.NextHopParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NextHopResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NextHopResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.NextHopResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.NextHopResult]] :raises: :class:`CloudError` """ raw_result = self._get_next_hop_initial( @@ -742,30 +717,8 @@ def get_next_hop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NextHopResult', response) if raw: @@ -774,12 +727,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_next_hop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} def _get_vm_security_rules_initial( @@ -787,7 +742,7 @@ def _get_vm_security_rules_initial( parameters = models.SecurityGroupViewParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView' + url = self.get_vm_security_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -836,7 +791,7 @@ def _get_vm_security_rules_initial( return deserialized def get_vm_security_rules( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the configured and effective security group rules on the specified VM. @@ -847,13 +802,16 @@ def get_vm_security_rules( :param target_resource_id: ID of the target VM. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - SecurityGroupViewResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityGroupViewResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.SecurityGroupViewResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.SecurityGroupViewResult]] :raises: :class:`CloudError` """ raw_result = self._get_vm_security_rules_initial( @@ -864,30 +822,8 @@ def get_vm_security_rules( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('SecurityGroupViewResult', response) if raw: @@ -896,18 +832,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vm_security_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} def _get_troubleshooting_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot' + url = self.get_troubleshooting.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -956,7 +894,7 @@ def _get_troubleshooting_initial( return deserialized def get_troubleshooting( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -968,13 +906,16 @@ def get_troubleshooting( :type parameters: ~azure.mgmt.network.v2017_09_01.models.TroubleshootingParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_initial( @@ -985,30 +926,8 @@ def get_troubleshooting( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -1017,12 +936,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} def _get_troubleshooting_result_initial( @@ -1030,7 +951,7 @@ def _get_troubleshooting_result_initial( parameters = models.QueryTroubleshootingParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult' + url = self.get_troubleshooting_result.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1079,7 +1000,7 @@ def _get_troubleshooting_result_initial( return deserialized def get_troubleshooting_result( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1090,13 +1011,16 @@ def get_troubleshooting_result( troubleshooting result. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_result_initial( @@ -1107,30 +1031,8 @@ def get_troubleshooting_result( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -1139,18 +1041,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} def _set_flow_log_configuration_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog' + url = self.set_flow_log_configuration.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1199,7 +1103,7 @@ def _set_flow_log_configuration_initial( return deserialized def set_flow_log_configuration( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1212,13 +1116,16 @@ def set_flow_log_configuration( :type parameters: ~azure.mgmt.network.v2017_09_01.models.FlowLogInformation :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._set_flow_log_configuration_initial( @@ -1229,30 +1136,8 @@ def set_flow_log_configuration( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1261,12 +1146,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_flow_log_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} def _get_flow_log_status_initial( @@ -1274,7 +1161,7 @@ def _get_flow_log_status_initial( parameters = models.FlowLogStatusParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus' + url = self.get_flow_log_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1323,7 +1210,7 @@ def _get_flow_log_status_initial( return deserialized def get_flow_log_status( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1335,13 +1222,16 @@ def get_flow_log_status( logging status. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._get_flow_log_status_initial( @@ -1352,30 +1242,8 @@ def get_flow_log_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1384,12 +1252,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_flow_log_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} def _check_connectivity_initial( @@ -1397,7 +1267,7 @@ def _check_connectivity_initial( parameters = models.ConnectivityParameters(source=source, destination=destination) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck' + url = self.check_connectivity.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1446,7 +1316,7 @@ def _check_connectivity_initial( return deserialized def check_connectivity( - self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, polling=True, **operation_config): """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1463,13 +1333,16 @@ def check_connectivity( :type destination: ~azure.mgmt.network.v2017_09_01.models.ConnectivityDestination :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectivityInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectivityInformation + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ConnectivityInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ConnectivityInformation]] :raises: :class:`CloudError` """ raw_result = self._check_connectivity_initial( @@ -1481,30 +1354,8 @@ def check_connectivity( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectivityInformation', response) if raw: @@ -1513,18 +1364,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + check_connectivity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} def _get_azure_reachability_report_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport' + url = self.get_azure_reachability_report.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1573,7 +1426,7 @@ def _get_azure_reachability_report_initial( return deserialized def get_azure_reachability_report( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1587,13 +1440,16 @@ def get_azure_reachability_report( :type parameters: ~azure.mgmt.network.v2017_09_01.models.AzureReachabilityReportParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - AzureReachabilityReport or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AzureReachabilityReport + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.AzureReachabilityReport] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.AzureReachabilityReport]] :raises: :class:`CloudError` """ raw_result = self._get_azure_reachability_report_initial( @@ -1604,30 +1460,8 @@ def get_azure_reachability_report( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AzureReachabilityReport', response) if raw: @@ -1636,18 +1470,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_azure_reachability_report.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport'} def _list_available_providers_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList' + url = self.list_available_providers.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1696,7 +1532,7 @@ def _list_available_providers_initial( return deserialized def list_available_providers( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Lists all available internet service providers for a specified Azure region. @@ -1710,13 +1546,16 @@ def list_available_providers( :type parameters: ~azure.mgmt.network.v2017_09_01.models.AvailableProvidersListParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - AvailableProvidersList or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AvailableProvidersList + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.AvailableProvidersList] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.AvailableProvidersList]] :raises: :class:`CloudError` """ raw_result = self._list_available_providers_initial( @@ -1727,30 +1566,8 @@ def list_available_providers( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AvailableProvidersList', response) if raw: @@ -1759,9 +1576,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_available_providers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/operations.py index bc015912686b..616c62296262 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Network/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -96,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Network/operations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/packet_captures_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/packet_captures_operations.py index 47abde3c45a3..43d6333325d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/packet_captures_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/packet_captures_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PacketCapturesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -91,7 +91,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -104,13 +104,16 @@ def create( operation. :type parameters: ~azure.mgmt.network.v2017_09_01.models.PacketCapture :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PacketCaptureResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.PacketCaptureResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.PacketCaptureResult]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -122,30 +125,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureResult', response) if raw: @@ -154,12 +135,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def get( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -224,12 +207,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _delete_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -266,7 +250,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -276,12 +260,14 @@ def delete( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -292,46 +278,26 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _stop_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -368,7 +334,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -378,12 +344,14 @@ def stop( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -394,46 +362,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} def _get_status_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus' + url = self.get_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -479,7 +427,7 @@ def _get_status_initial( return deserialized def get_status( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -490,13 +438,17 @@ def get_status( session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureQueryStatusResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PacketCaptureQueryStatusResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.PacketCaptureQueryStatusResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.PacketCaptureQueryStatusResult]] :raises: :class:`CloudError` """ raw_result = self._get_status_initial( @@ -507,30 +459,8 @@ def get_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureQueryStatusResult', response) if raw: @@ -539,12 +469,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} def list( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -568,7 +500,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -615,3 +547,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/public_ip_addresses_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/public_ip_addresses_operations.py index 7a64976ce8eb..405a7a1fc5e9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/public_ip_addresses_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/public_ip_addresses_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PublicIPAddressesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ models = models @@ -43,7 +43,7 @@ def _delete_initial( api_version = "2017-09-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param public_ip_address_name: The name of the subnet. :type public_ip_address_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def get( self, resource_group_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( api_version = "2017-09-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -203,6 +185,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def _create_or_update_initial( @@ -210,7 +193,7 @@ def _create_or_update_initial( api_version = "2017-09-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_09_01.models.PublicIPAddress :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PublicIPAddress or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.PublicIPAddress] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.PublicIPAddress]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('PublicIPAddress', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def _update_tags_initial( @@ -335,7 +301,7 @@ def _update_tags_initial( api_version = "2017-09-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -382,7 +348,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, public_ip_address_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -392,13 +358,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PublicIPAddress or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.PublicIPAddress] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.PublicIPAddress]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -409,30 +378,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PublicIPAddress', response) if raw: @@ -441,12 +388,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -468,7 +417,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -513,6 +462,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -536,7 +486,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -582,6 +532,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} def list_virtual_machine_scale_set_public_ip_addresses( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -609,7 +560,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses' + url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -656,6 +607,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses'} def list_virtual_machine_scale_set_vm_public_ip_addresses( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -689,7 +641,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses' + url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -739,6 +691,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses'} def get_virtual_machine_scale_set_public_ip_address( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -772,7 +725,7 @@ def get_virtual_machine_scale_set_public_ip_address( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}' + url = self.get_virtual_machine_scale_set_public_ip_address.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -819,3 +772,4 @@ def get_virtual_machine_scale_set_public_ip_address( return client_raw_response return deserialized + get_virtual_machine_scale_set_public_ip_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_filter_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_filter_rules_operations.py index dedaf77e6c95..b7050b1f9361 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_filter_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_filter_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFilterRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param rule_name: The name of the rule. :type rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def get( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -273,13 +256,16 @@ def create_or_update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_09_01.models.RouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -291,30 +277,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilterRule', response) if raw: @@ -323,18 +287,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -382,7 +348,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -396,13 +362,16 @@ def update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_09_01.models.PatchRouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -414,30 +383,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilterRule', response) if raw: @@ -446,12 +393,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def list_by_route_filter( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): @@ -475,7 +424,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules' + url = self.list_by_route_filter.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -522,3 +471,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_route_filter.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_filters_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_filters_operations.py index f7f3b17f3666..d291e20acb05 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_filters_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_filters_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFiltersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_filter_name: The name of the route filter. :type route_filter_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def get( self, resource_group_name, route_filter_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type route_filter_parameters: ~azure.mgmt.network.v2017_09_01.models.RouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilter', response) if raw: @@ -316,18 +280,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -374,7 +340,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -386,13 +352,16 @@ def update( :type route_filter_parameters: ~azure.mgmt.network.v2017_09_01.models.PatchRouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -403,30 +372,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilter', response) if raw: @@ -435,12 +382,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -462,7 +411,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -508,6 +457,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -527,7 +477,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -572,3 +522,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_tables_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_tables_operations.py index 9a5d360d1fa3..e11aad1a48ec 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_tables_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/route_tables_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteTablesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_table_name: The name of the route table. :type route_table_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def get( self, resource_group_name, route_table_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( table operation. :type parameters: ~azure.mgmt.network.v2017_09_01.models.RouteTable :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteTable - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.RouteTable] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.RouteTable]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteTable', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def _update_tags_initial( @@ -328,7 +294,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -375,7 +341,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, route_table_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -385,13 +351,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteTable - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.RouteTable] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.RouteTable]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -402,30 +371,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteTable', response) if raw: @@ -434,12 +381,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -461,7 +410,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -507,6 +456,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -526,7 +476,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -571,3 +521,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/routes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/routes_operations.py index 8c0a5672bae4..82a1b98cafe8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/routes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/routes_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RoutesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param route_name: The name of the route. :type route_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def get( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -272,13 +255,16 @@ def create_or_update( route operation. :type route_parameters: ~azure.mgmt.network.v2017_09_01.models.Route :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Route or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Route or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.Route] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.Route]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -290,30 +276,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Route', response) if raw: @@ -322,12 +286,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def list( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): @@ -351,7 +317,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -398,3 +364,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/security_rules_operations.py index eb0dcb7209b5..f4473419f51d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/security_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( :param security_rule_name: The name of the security rule. :type security_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def get( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a security rule in the specified network security group. @@ -277,13 +260,16 @@ def create_or_update( :type security_rule_parameters: ~azure.mgmt.network.v2017_09_01.models.SecurityRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns SecurityRule - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.SecurityRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.SecurityRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -295,30 +281,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('SecurityRule', response) if raw: @@ -327,12 +291,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def list( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +323,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -404,3 +370,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/subnets_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/subnets_operations.py index cf06eeacf294..89d71920a318 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/subnets_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/subnets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SubnetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param subnet_name: The name of the subnet. :type subnet_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def get( self, resource_group_name, virtual_network_name, subnet_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -276,13 +259,16 @@ def create_or_update( subnet operation. :type subnet_parameters: ~azure.mgmt.network.v2017_09_01.models.Subnet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Subnet or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Subnet or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.Subnet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.Subnet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -294,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Subnet', response) if raw: @@ -326,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -355,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -402,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/usages_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/usages_operations.py index f2cdaef8e1e4..b54d542f29ea 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/usages_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/usages_operations.py @@ -22,7 +22,7 @@ class UsagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._ ]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_gateway_connections_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_gateway_connections_operations.py index eaaeba931986..932d6c3931b6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_gateway_connections_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_gateway_connections_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway connection in the specified resource group. @@ -106,13 +106,17 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnection :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGatewayConnection or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnection or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnection] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnection]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +127,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGatewayConnection', response) if raw: @@ -155,12 +137,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def get( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -185,7 +169,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -226,12 +210,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -267,7 +252,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -276,12 +261,14 @@ def delete( virtual network gateway connection. :type virtual_network_gateway_connection_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -291,40 +278,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _update_tags_initial( @@ -332,7 +299,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -379,7 +346,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, virtual_network_gateway_connection_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -390,14 +357,18 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGatewayConnectionListEntity or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnectionListEntity or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnectionListEntity] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGatewayConnectionListEntity]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -408,30 +379,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGatewayConnectionListEntity', response) if raw: @@ -440,12 +389,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _set_shared_key_initial( @@ -453,7 +404,7 @@ def _set_shared_key_initial( parameters = models.ConnectionSharedKey(value=value) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.set_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -502,7 +453,7 @@ def _set_shared_key_initial( return deserialized def set_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, polling=True, **operation_config): """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -516,13 +467,16 @@ def set_shared_key( :param value: The virtual network connection shared key value. :type value: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectionSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ConnectionSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ConnectionSharedKey]] :raises: :class:`CloudError` """ raw_result = self._set_shared_key_initial( @@ -533,30 +487,8 @@ def set_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ConnectionSharedKey', response) if raw: @@ -565,12 +497,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def get_shared_key( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -594,7 +528,7 @@ def get_shared_key( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.get_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -635,6 +569,7 @@ def get_shared_key( return client_raw_response return deserialized + get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -657,7 +592,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -703,6 +638,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} def _reset_shared_key_initial( @@ -710,7 +646,7 @@ def _reset_shared_key_initial( parameters = models.ConnectionResetSharedKey(key_length=key_length) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset' + url = self.reset_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -757,7 +693,7 @@ def _reset_shared_key_initial( return deserialized def reset_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, polling=True, **operation_config): """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -772,13 +708,17 @@ def reset_shared_key( length, should between 1 and 128. :type key_length: int :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionResetSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConnectionResetSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.ConnectionResetSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.ConnectionResetSharedKey]] :raises: :class:`CloudError` """ raw_result = self._reset_shared_key_initial( @@ -789,30 +729,8 @@ def reset_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectionResetSharedKey', response) if raw: @@ -821,9 +739,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_gateways_operations.py index 9e3ceb4b3a82..e7d2b1a808e8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def get( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def _update_tags_initial( @@ -329,7 +295,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -376,7 +342,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, virtual_network_gateway_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -387,13 +353,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -404,30 +373,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -436,12 +383,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -463,7 +412,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -509,6 +458,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} def list_connections( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -534,7 +484,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections' + url = self.list_connections.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -581,12 +531,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections'} def _reset_initial( self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset' + url = self.reset.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -631,7 +582,7 @@ def _reset_initial( return deserialized def reset( - self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, polling=True, **operation_config): """Resets the primary of the virtual network gateway in the specified resource group. @@ -644,13 +595,16 @@ def reset( the begin reset of the active-active feature enabled gateway. :type gateway_vip: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._reset_initial( @@ -661,30 +615,8 @@ def reset( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -693,18 +625,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} def _generatevpnclientpackage_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage' + url = self.generatevpnclientpackage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -751,7 +685,7 @@ def _generatevpnclientpackage_initial( return deserialized def generatevpnclientpackage( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -765,12 +699,14 @@ def generatevpnclientpackage( :type parameters: ~azure.mgmt.network.v2017_09_01.models.VpnClientParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._generatevpnclientpackage_initial( @@ -781,30 +717,8 @@ def generatevpnclientpackage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -813,18 +727,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} def _generate_vpn_profile_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile' + url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -871,7 +787,7 @@ def _generate_vpn_profile_initial( return deserialized def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. @@ -886,12 +802,14 @@ def generate_vpn_profile( :type parameters: ~azure.mgmt.network.v2017_09_01.models.VpnClientParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._generate_vpn_profile_initial( @@ -902,30 +820,8 @@ def generate_vpn_profile( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -934,18 +830,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} def _get_vpn_profile_package_url_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl' + url = self.get_vpn_profile_package_url.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -988,7 +886,7 @@ def _get_vpn_profile_package_url_initial( return deserialized def get_vpn_profile_package_url( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. @@ -999,12 +897,14 @@ def get_vpn_profile_package_url( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._get_vpn_profile_package_url_initial( @@ -1014,30 +914,8 @@ def get_vpn_profile_package_url( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -1046,18 +924,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vpn_profile_package_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'} def _get_bgp_peer_status_initial( self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus' + url = self.get_bgp_peer_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1102,7 +982,7 @@ def _get_bgp_peer_status_initial( return deserialized def get_bgp_peer_status( - self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, polling=True, **operation_config): """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1113,13 +993,16 @@ def get_bgp_peer_status( :param peer: The IP address of the peer to retrieve the status of. :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - BgpPeerStatusListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BgpPeerStatusListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.BgpPeerStatusListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.BgpPeerStatusListResult]] :raises: :class:`CloudError` """ raw_result = self._get_bgp_peer_status_initial( @@ -1130,30 +1013,8 @@ def get_bgp_peer_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('BgpPeerStatusListResult', response) if raw: @@ -1162,12 +1023,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_bgp_peer_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} def supported_vpn_devices( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -1188,7 +1051,7 @@ def supported_vpn_devices( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices' + url = self.supported_vpn_devices.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1229,12 +1092,13 @@ def supported_vpn_devices( return client_raw_response return deserialized + supported_vpn_devices.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices'} def _get_learned_routes_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes' + url = self.get_learned_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1277,7 +1141,7 @@ def _get_learned_routes_initial( return deserialized def get_learned_routes( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1287,13 +1151,16 @@ def get_learned_routes( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_learned_routes_initial( @@ -1303,30 +1170,8 @@ def get_learned_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -1335,18 +1180,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} def _get_advertised_routes_initial( self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes' + url = self.get_advertised_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1390,7 +1237,7 @@ def _get_advertised_routes_initial( return deserialized def get_advertised_routes( - self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1402,13 +1249,16 @@ def get_advertised_routes( :param peer: The IP address of the peer :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_advertised_routes_initial( @@ -1419,30 +1269,8 @@ def get_advertised_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -1451,12 +1279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} def vpn_device_configuration_script( self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -1482,7 +1312,7 @@ def vpn_device_configuration_script( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript' + url = self.vpn_device_configuration_script.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -1527,3 +1357,4 @@ def vpn_device_configuration_script( return client_raw_response return deserialized + vpn_device_configuration_script.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_peerings_operations.py index 5374eaf3ec4b..b537d07b4654 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_network_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( peering. :type virtual_network_peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def get( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -275,13 +258,16 @@ def create_or_update( :type virtual_network_peering_parameters: ~azure.mgmt.network.v2017_09_01.models.VirtualNetworkPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkPeering + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.VirtualNetworkPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +279,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkPeering', response) if raw: @@ -325,12 +289,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +320,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -401,3 +367,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_networks_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_networks_operations.py index 6a6b81a38720..f91f7f235b54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_networks_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/virtual_networks_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworksOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-09-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param virtual_network_name: The name of the virtual network. :type virtual_network_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def get( self, resource_group_name, virtual_network_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_09_01.models.VirtualNetwork :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetwork or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetwork] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.VirtualNetwork]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetwork', response) if raw: @@ -316,12 +280,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def _update_tags_initial( @@ -329,7 +295,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -376,7 +342,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, virtual_network_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -386,13 +352,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetwork or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_09_01.models.VirtualNetwork] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_09_01.models.VirtualNetwork]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -403,30 +372,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetwork', response) if raw: @@ -435,12 +382,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -460,7 +409,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -505,6 +454,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -526,7 +476,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -572,6 +522,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks'} def check_ip_address_availability( self, resource_group_name, virtual_network_name, ip_address=None, custom_headers=None, raw=False, **operation_config): @@ -595,7 +546,7 @@ def check_ip_address_availability( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability' + url = self.check_ip_address_availability.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -638,6 +589,7 @@ def check_ip_address_availability( return client_raw_response return deserialized + check_ip_address_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'} def list_usage( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -661,7 +613,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages' + url = self.list_usage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -708,3 +660,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/__init__.py index b4bf156ebcc8..aa807115dd0d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/__init__.py @@ -9,186 +9,368 @@ # regenerated. # -------------------------------------------------------------------------- -from .sub_resource import SubResource -from .backend_address_pool import BackendAddressPool -from .inbound_nat_rule import InboundNatRule -from .application_security_group import ApplicationSecurityGroup -from .security_rule import SecurityRule -from .network_interface_dns_settings import NetworkInterfaceDnsSettings -from .network_interface import NetworkInterface -from .network_security_group import NetworkSecurityGroup -from .route import Route -from .route_table import RouteTable -from .service_endpoint_properties_format import ServiceEndpointPropertiesFormat -from .public_ip_address_sku import PublicIPAddressSku -from .public_ip_address_dns_settings import PublicIPAddressDnsSettings -from .public_ip_address import PublicIPAddress -from .ip_configuration import IPConfiguration -from .resource_navigation_link import ResourceNavigationLink -from .subnet import Subnet -from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration -from .application_gateway_backend_address import ApplicationGatewayBackendAddress -from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool -from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining -from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings -from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer -from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings -from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool -from .application_gateway_backend_health import ApplicationGatewayBackendHealth -from .application_gateway_sku import ApplicationGatewaySku -from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy -from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration -from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate -from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate -from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration -from .application_gateway_frontend_port import ApplicationGatewayFrontendPort -from .application_gateway_http_listener import ApplicationGatewayHttpListener -from .application_gateway_path_rule import ApplicationGatewayPathRule -from .application_gateway_probe_health_response_match import ApplicationGatewayProbeHealthResponseMatch -from .application_gateway_probe import ApplicationGatewayProbe -from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule -from .application_gateway_redirect_configuration import ApplicationGatewayRedirectConfiguration -from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap -from .application_gateway_firewall_disabled_rule_group import ApplicationGatewayFirewallDisabledRuleGroup -from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration -from .application_gateway import ApplicationGateway -from .application_gateway_firewall_rule import ApplicationGatewayFirewallRule -from .application_gateway_firewall_rule_group import ApplicationGatewayFirewallRuleGroup -from .application_gateway_firewall_rule_set import ApplicationGatewayFirewallRuleSet -from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult -from .application_gateway_available_ssl_options import ApplicationGatewayAvailableSslOptions -from .application_gateway_ssl_predefined_policy import ApplicationGatewaySslPredefinedPolicy -from .resource import Resource -from .tags_object import TagsObject -from .dns_name_availability_result import DnsNameAvailabilityResult -from .endpoint_service_result import EndpointServiceResult -from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization -from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig -from .route_filter_rule import RouteFilterRule -from .express_route_circuit_stats import ExpressRouteCircuitStats -from .express_route_circuit_peering import ExpressRouteCircuitPeering -from .route_filter import RouteFilter -from .ipv6_express_route_circuit_peering_config import Ipv6ExpressRouteCircuitPeeringConfig -from .express_route_circuit_sku import ExpressRouteCircuitSku -from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties -from .express_route_circuit import ExpressRouteCircuit -from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable -from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult -from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable -from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult -from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary -from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult -from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered -from .express_route_service_provider import ExpressRouteServiceProvider -from .load_balancer_sku import LoadBalancerSku -from .frontend_ip_configuration import FrontendIPConfiguration -from .load_balancing_rule import LoadBalancingRule -from .probe import Probe -from .inbound_nat_pool import InboundNatPool -from .outbound_nat_rule import OutboundNatRule -from .load_balancer import LoadBalancer -from .error_details import ErrorDetails -from .error import Error -from .azure_async_operation_result import AzureAsyncOperationResult -from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation -from .effective_network_security_rule import EffectiveNetworkSecurityRule -from .effective_network_security_group import EffectiveNetworkSecurityGroup -from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult -from .effective_route import EffectiveRoute -from .effective_route_list_result import EffectiveRouteListResult -from .network_watcher import NetworkWatcher -from .topology_parameters import TopologyParameters -from .topology_association import TopologyAssociation -from .topology_resource import TopologyResource -from .topology import Topology -from .verification_ip_flow_parameters import VerificationIPFlowParameters -from .verification_ip_flow_result import VerificationIPFlowResult -from .next_hop_parameters import NextHopParameters -from .next_hop_result import NextHopResult -from .security_group_view_parameters import SecurityGroupViewParameters -from .network_interface_association import NetworkInterfaceAssociation -from .subnet_association import SubnetAssociation -from .security_rule_associations import SecurityRuleAssociations -from .security_group_network_interface import SecurityGroupNetworkInterface -from .security_group_view_result import SecurityGroupViewResult -from .packet_capture_storage_location import PacketCaptureStorageLocation -from .packet_capture_filter import PacketCaptureFilter -from .packet_capture_parameters import PacketCaptureParameters -from .packet_capture import PacketCapture -from .packet_capture_result import PacketCaptureResult -from .packet_capture_query_status_result import PacketCaptureQueryStatusResult -from .troubleshooting_parameters import TroubleshootingParameters -from .query_troubleshooting_parameters import QueryTroubleshootingParameters -from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions -from .troubleshooting_details import TroubleshootingDetails -from .troubleshooting_result import TroubleshootingResult -from .retention_policy_parameters import RetentionPolicyParameters -from .flow_log_status_parameters import FlowLogStatusParameters -from .flow_log_information import FlowLogInformation -from .connectivity_source import ConnectivitySource -from .connectivity_destination import ConnectivityDestination -from .connectivity_parameters import ConnectivityParameters -from .connectivity_issue import ConnectivityIssue -from .connectivity_hop import ConnectivityHop -from .connectivity_information import ConnectivityInformation -from .azure_reachability_report_location import AzureReachabilityReportLocation -from .azure_reachability_report_parameters import AzureReachabilityReportParameters -from .azure_reachability_report_latency_info import AzureReachabilityReportLatencyInfo -from .azure_reachability_report_item import AzureReachabilityReportItem -from .azure_reachability_report import AzureReachabilityReport -from .available_providers_list_parameters import AvailableProvidersListParameters -from .available_providers_list_city import AvailableProvidersListCity -from .available_providers_list_state import AvailableProvidersListState -from .available_providers_list_country import AvailableProvidersListCountry -from .available_providers_list import AvailableProvidersList -from .connection_monitor_source import ConnectionMonitorSource -from .connection_monitor_destination import ConnectionMonitorDestination -from .connection_monitor_parameters import ConnectionMonitorParameters -from .connection_monitor import ConnectionMonitor -from .connection_monitor_result import ConnectionMonitorResult -from .connection_state_snapshot import ConnectionStateSnapshot -from .connection_monitor_query_result import ConnectionMonitorQueryResult -from .operation_display import OperationDisplay -from .availability import Availability -from .dimension import Dimension -from .metric_specification import MetricSpecification -from .log_specification import LogSpecification -from .operation_properties_format_service_specification import OperationPropertiesFormatServiceSpecification -from .operation import Operation -from .patch_route_filter_rule import PatchRouteFilterRule -from .patch_route_filter import PatchRouteFilter -from .bgp_community import BGPCommunity -from .bgp_service_community import BgpServiceCommunity -from .usage_name import UsageName -from .usage import Usage -from .address_space import AddressSpace -from .virtual_network_peering import VirtualNetworkPeering -from .dhcp_options import DhcpOptions -from .virtual_network import VirtualNetwork -from .ip_address_availability_result import IPAddressAvailabilityResult -from .virtual_network_usage_name import VirtualNetworkUsageName -from .virtual_network_usage import VirtualNetworkUsage -from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration -from .virtual_network_gateway_sku import VirtualNetworkGatewaySku -from .vpn_client_root_certificate import VpnClientRootCertificate -from .vpn_client_revoked_certificate import VpnClientRevokedCertificate -from .vpn_client_configuration import VpnClientConfiguration -from .bgp_settings import BgpSettings -from .bgp_peer_status import BgpPeerStatus -from .gateway_route import GatewayRoute -from .virtual_network_gateway import VirtualNetworkGateway -from .vpn_client_parameters import VpnClientParameters -from .bgp_peer_status_list_result import BgpPeerStatusListResult -from .gateway_route_list_result import GatewayRouteListResult -from .tunnel_connection_health import TunnelConnectionHealth -from .local_network_gateway import LocalNetworkGateway -from .ipsec_policy import IpsecPolicy -from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection -from .connection_reset_shared_key import ConnectionResetSharedKey -from .connection_shared_key import ConnectionSharedKey -from .virtual_network_connection_gateway_reference import VirtualNetworkConnectionGatewayReference -from .virtual_network_gateway_connection_list_entity import VirtualNetworkGatewayConnectionListEntity -from .vpn_device_script_parameters import VpnDeviceScriptParameters +try: + from .sub_resource_py3 import SubResource + from .backend_address_pool_py3 import BackendAddressPool + from .inbound_nat_rule_py3 import InboundNatRule + from .application_security_group_py3 import ApplicationSecurityGroup + from .security_rule_py3 import SecurityRule + from .network_interface_dns_settings_py3 import NetworkInterfaceDnsSettings + from .network_interface_py3 import NetworkInterface + from .network_security_group_py3 import NetworkSecurityGroup + from .route_py3 import Route + from .route_table_py3 import RouteTable + from .service_endpoint_properties_format_py3 import ServiceEndpointPropertiesFormat + from .public_ip_address_sku_py3 import PublicIPAddressSku + from .public_ip_address_dns_settings_py3 import PublicIPAddressDnsSettings + from .public_ip_address_py3 import PublicIPAddress + from .ip_configuration_py3 import IPConfiguration + from .resource_navigation_link_py3 import ResourceNavigationLink + from .subnet_py3 import Subnet + from .network_interface_ip_configuration_py3 import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address_py3 import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool_py3 import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining_py3 import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings_py3 import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server_py3 import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings_py3 import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool_py3 import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health_py3 import ApplicationGatewayBackendHealth + from .application_gateway_sku_py3 import ApplicationGatewaySku + from .application_gateway_ssl_policy_py3 import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration_py3 import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate_py3 import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate_py3 import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration_py3 import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port_py3 import ApplicationGatewayFrontendPort + from .application_gateway_http_listener_py3 import ApplicationGatewayHttpListener + from .application_gateway_path_rule_py3 import ApplicationGatewayPathRule + from .application_gateway_probe_health_response_match_py3 import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_probe_py3 import ApplicationGatewayProbe + from .application_gateway_request_routing_rule_py3 import ApplicationGatewayRequestRoutingRule + from .application_gateway_redirect_configuration_py3 import ApplicationGatewayRedirectConfiguration + from .application_gateway_url_path_map_py3 import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group_py3 import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration_py3 import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway_py3 import ApplicationGateway + from .application_gateway_firewall_rule_py3 import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group_py3 import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set_py3 import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result_py3 import ApplicationGatewayAvailableWafRuleSetsResult + from .application_gateway_available_ssl_options_py3 import ApplicationGatewayAvailableSslOptions + from .application_gateway_ssl_predefined_policy_py3 import ApplicationGatewaySslPredefinedPolicy + from .resource_py3 import Resource + from .tags_object_py3 import TagsObject + from .dns_name_availability_result_py3 import DnsNameAvailabilityResult + from .endpoint_service_result_py3 import EndpointServiceResult + from .express_route_circuit_authorization_py3 import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config_py3 import ExpressRouteCircuitPeeringConfig + from .route_filter_rule_py3 import RouteFilterRule + from .express_route_circuit_stats_py3 import ExpressRouteCircuitStats + from .express_route_circuit_peering_py3 import ExpressRouteCircuitPeering + from .route_filter_py3 import RouteFilter + from .ipv6_express_route_circuit_peering_config_py3 import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku_py3 import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties_py3 import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit_py3 import ExpressRouteCircuit + from .express_route_circuit_arp_table_py3 import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result_py3 import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table_py3 import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result_py3 import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary_py3 import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result_py3 import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered_py3 import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider_py3 import ExpressRouteServiceProvider + from .load_balancer_sku_py3 import LoadBalancerSku + from .frontend_ip_configuration_py3 import FrontendIPConfiguration + from .load_balancing_rule_py3 import LoadBalancingRule + from .probe_py3 import Probe + from .inbound_nat_pool_py3 import InboundNatPool + from .outbound_nat_rule_py3 import OutboundNatRule + from .load_balancer_py3 import LoadBalancer + from .error_details_py3 import ErrorDetails + from .error_py3 import Error + from .azure_async_operation_result_py3 import AzureAsyncOperationResult + from .effective_network_security_group_association_py3 import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule_py3 import EffectiveNetworkSecurityRule + from .effective_network_security_group_py3 import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result_py3 import EffectiveNetworkSecurityGroupListResult + from .effective_route_py3 import EffectiveRoute + from .effective_route_list_result_py3 import EffectiveRouteListResult + from .network_watcher_py3 import NetworkWatcher + from .topology_parameters_py3 import TopologyParameters + from .topology_association_py3 import TopologyAssociation + from .topology_resource_py3 import TopologyResource + from .topology_py3 import Topology + from .verification_ip_flow_parameters_py3 import VerificationIPFlowParameters + from .verification_ip_flow_result_py3 import VerificationIPFlowResult + from .next_hop_parameters_py3 import NextHopParameters + from .next_hop_result_py3 import NextHopResult + from .security_group_view_parameters_py3 import SecurityGroupViewParameters + from .network_interface_association_py3 import NetworkInterfaceAssociation + from .subnet_association_py3 import SubnetAssociation + from .security_rule_associations_py3 import SecurityRuleAssociations + from .security_group_network_interface_py3 import SecurityGroupNetworkInterface + from .security_group_view_result_py3 import SecurityGroupViewResult + from .packet_capture_storage_location_py3 import PacketCaptureStorageLocation + from .packet_capture_filter_py3 import PacketCaptureFilter + from .packet_capture_parameters_py3 import PacketCaptureParameters + from .packet_capture_py3 import PacketCapture + from .packet_capture_result_py3 import PacketCaptureResult + from .packet_capture_query_status_result_py3 import PacketCaptureQueryStatusResult + from .troubleshooting_parameters_py3 import TroubleshootingParameters + from .query_troubleshooting_parameters_py3 import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions_py3 import TroubleshootingRecommendedActions + from .troubleshooting_details_py3 import TroubleshootingDetails + from .troubleshooting_result_py3 import TroubleshootingResult + from .retention_policy_parameters_py3 import RetentionPolicyParameters + from .flow_log_status_parameters_py3 import FlowLogStatusParameters + from .flow_log_information_py3 import FlowLogInformation + from .connectivity_source_py3 import ConnectivitySource + from .connectivity_destination_py3 import ConnectivityDestination + from .connectivity_parameters_py3 import ConnectivityParameters + from .connectivity_issue_py3 import ConnectivityIssue + from .connectivity_hop_py3 import ConnectivityHop + from .connectivity_information_py3 import ConnectivityInformation + from .azure_reachability_report_location_py3 import AzureReachabilityReportLocation + from .azure_reachability_report_parameters_py3 import AzureReachabilityReportParameters + from .azure_reachability_report_latency_info_py3 import AzureReachabilityReportLatencyInfo + from .azure_reachability_report_item_py3 import AzureReachabilityReportItem + from .azure_reachability_report_py3 import AzureReachabilityReport + from .available_providers_list_parameters_py3 import AvailableProvidersListParameters + from .available_providers_list_city_py3 import AvailableProvidersListCity + from .available_providers_list_state_py3 import AvailableProvidersListState + from .available_providers_list_country_py3 import AvailableProvidersListCountry + from .available_providers_list_py3 import AvailableProvidersList + from .connection_monitor_source_py3 import ConnectionMonitorSource + from .connection_monitor_destination_py3 import ConnectionMonitorDestination + from .connection_monitor_parameters_py3 import ConnectionMonitorParameters + from .connection_monitor_py3 import ConnectionMonitor + from .connection_monitor_result_py3 import ConnectionMonitorResult + from .connection_state_snapshot_py3 import ConnectionStateSnapshot + from .connection_monitor_query_result_py3 import ConnectionMonitorQueryResult + from .operation_display_py3 import OperationDisplay + from .availability_py3 import Availability + from .dimension_py3 import Dimension + from .metric_specification_py3 import MetricSpecification + from .log_specification_py3 import LogSpecification + from .operation_properties_format_service_specification_py3 import OperationPropertiesFormatServiceSpecification + from .operation_py3 import Operation + from .patch_route_filter_rule_py3 import PatchRouteFilterRule + from .patch_route_filter_py3 import PatchRouteFilter + from .bgp_community_py3 import BGPCommunity + from .bgp_service_community_py3 import BgpServiceCommunity + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .address_space_py3 import AddressSpace + from .virtual_network_peering_py3 import VirtualNetworkPeering + from .dhcp_options_py3 import DhcpOptions + from .virtual_network_py3 import VirtualNetwork + from .ip_address_availability_result_py3 import IPAddressAvailabilityResult + from .virtual_network_usage_name_py3 import VirtualNetworkUsageName + from .virtual_network_usage_py3 import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration_py3 import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku_py3 import VirtualNetworkGatewaySku + from .vpn_client_root_certificate_py3 import VpnClientRootCertificate + from .vpn_client_revoked_certificate_py3 import VpnClientRevokedCertificate + from .vpn_client_configuration_py3 import VpnClientConfiguration + from .bgp_settings_py3 import BgpSettings + from .bgp_peer_status_py3 import BgpPeerStatus + from .gateway_route_py3 import GatewayRoute + from .virtual_network_gateway_py3 import VirtualNetworkGateway + from .vpn_client_parameters_py3 import VpnClientParameters + from .bgp_peer_status_list_result_py3 import BgpPeerStatusListResult + from .gateway_route_list_result_py3 import GatewayRouteListResult + from .tunnel_connection_health_py3 import TunnelConnectionHealth + from .local_network_gateway_py3 import LocalNetworkGateway + from .ipsec_policy_py3 import IpsecPolicy + from .virtual_network_gateway_connection_py3 import VirtualNetworkGatewayConnection + from .connection_reset_shared_key_py3 import ConnectionResetSharedKey + from .connection_shared_key_py3 import ConnectionSharedKey + from .virtual_network_connection_gateway_reference_py3 import VirtualNetworkConnectionGatewayReference + from .virtual_network_gateway_connection_list_entity_py3 import VirtualNetworkGatewayConnectionListEntity + from .vpn_device_script_parameters_py3 import VpnDeviceScriptParameters +except (SyntaxError, ImportError): + from .sub_resource import SubResource + from .backend_address_pool import BackendAddressPool + from .inbound_nat_rule import InboundNatRule + from .application_security_group import ApplicationSecurityGroup + from .security_rule import SecurityRule + from .network_interface_dns_settings import NetworkInterfaceDnsSettings + from .network_interface import NetworkInterface + from .network_security_group import NetworkSecurityGroup + from .route import Route + from .route_table import RouteTable + from .service_endpoint_properties_format import ServiceEndpointPropertiesFormat + from .public_ip_address_sku import PublicIPAddressSku + from .public_ip_address_dns_settings import PublicIPAddressDnsSettings + from .public_ip_address import PublicIPAddress + from .ip_configuration import IPConfiguration + from .resource_navigation_link import ResourceNavigationLink + from .subnet import Subnet + from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health import ApplicationGatewayBackendHealth + from .application_gateway_sku import ApplicationGatewaySku + from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port import ApplicationGatewayFrontendPort + from .application_gateway_http_listener import ApplicationGatewayHttpListener + from .application_gateway_path_rule import ApplicationGatewayPathRule + from .application_gateway_probe_health_response_match import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_probe import ApplicationGatewayProbe + from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule + from .application_gateway_redirect_configuration import ApplicationGatewayRedirectConfiguration + from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway import ApplicationGateway + from .application_gateway_firewall_rule import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult + from .application_gateway_available_ssl_options import ApplicationGatewayAvailableSslOptions + from .application_gateway_ssl_predefined_policy import ApplicationGatewaySslPredefinedPolicy + from .resource import Resource + from .tags_object import TagsObject + from .dns_name_availability_result import DnsNameAvailabilityResult + from .endpoint_service_result import EndpointServiceResult + from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig + from .route_filter_rule import RouteFilterRule + from .express_route_circuit_stats import ExpressRouteCircuitStats + from .express_route_circuit_peering import ExpressRouteCircuitPeering + from .route_filter import RouteFilter + from .ipv6_express_route_circuit_peering_config import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit import ExpressRouteCircuit + from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider import ExpressRouteServiceProvider + from .load_balancer_sku import LoadBalancerSku + from .frontend_ip_configuration import FrontendIPConfiguration + from .load_balancing_rule import LoadBalancingRule + from .probe import Probe + from .inbound_nat_pool import InboundNatPool + from .outbound_nat_rule import OutboundNatRule + from .load_balancer import LoadBalancer + from .error_details import ErrorDetails + from .error import Error + from .azure_async_operation_result import AzureAsyncOperationResult + from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule import EffectiveNetworkSecurityRule + from .effective_network_security_group import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult + from .effective_route import EffectiveRoute + from .effective_route_list_result import EffectiveRouteListResult + from .network_watcher import NetworkWatcher + from .topology_parameters import TopologyParameters + from .topology_association import TopologyAssociation + from .topology_resource import TopologyResource + from .topology import Topology + from .verification_ip_flow_parameters import VerificationIPFlowParameters + from .verification_ip_flow_result import VerificationIPFlowResult + from .next_hop_parameters import NextHopParameters + from .next_hop_result import NextHopResult + from .security_group_view_parameters import SecurityGroupViewParameters + from .network_interface_association import NetworkInterfaceAssociation + from .subnet_association import SubnetAssociation + from .security_rule_associations import SecurityRuleAssociations + from .security_group_network_interface import SecurityGroupNetworkInterface + from .security_group_view_result import SecurityGroupViewResult + from .packet_capture_storage_location import PacketCaptureStorageLocation + from .packet_capture_filter import PacketCaptureFilter + from .packet_capture_parameters import PacketCaptureParameters + from .packet_capture import PacketCapture + from .packet_capture_result import PacketCaptureResult + from .packet_capture_query_status_result import PacketCaptureQueryStatusResult + from .troubleshooting_parameters import TroubleshootingParameters + from .query_troubleshooting_parameters import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions + from .troubleshooting_details import TroubleshootingDetails + from .troubleshooting_result import TroubleshootingResult + from .retention_policy_parameters import RetentionPolicyParameters + from .flow_log_status_parameters import FlowLogStatusParameters + from .flow_log_information import FlowLogInformation + from .connectivity_source import ConnectivitySource + from .connectivity_destination import ConnectivityDestination + from .connectivity_parameters import ConnectivityParameters + from .connectivity_issue import ConnectivityIssue + from .connectivity_hop import ConnectivityHop + from .connectivity_information import ConnectivityInformation + from .azure_reachability_report_location import AzureReachabilityReportLocation + from .azure_reachability_report_parameters import AzureReachabilityReportParameters + from .azure_reachability_report_latency_info import AzureReachabilityReportLatencyInfo + from .azure_reachability_report_item import AzureReachabilityReportItem + from .azure_reachability_report import AzureReachabilityReport + from .available_providers_list_parameters import AvailableProvidersListParameters + from .available_providers_list_city import AvailableProvidersListCity + from .available_providers_list_state import AvailableProvidersListState + from .available_providers_list_country import AvailableProvidersListCountry + from .available_providers_list import AvailableProvidersList + from .connection_monitor_source import ConnectionMonitorSource + from .connection_monitor_destination import ConnectionMonitorDestination + from .connection_monitor_parameters import ConnectionMonitorParameters + from .connection_monitor import ConnectionMonitor + from .connection_monitor_result import ConnectionMonitorResult + from .connection_state_snapshot import ConnectionStateSnapshot + from .connection_monitor_query_result import ConnectionMonitorQueryResult + from .operation_display import OperationDisplay + from .availability import Availability + from .dimension import Dimension + from .metric_specification import MetricSpecification + from .log_specification import LogSpecification + from .operation_properties_format_service_specification import OperationPropertiesFormatServiceSpecification + from .operation import Operation + from .patch_route_filter_rule import PatchRouteFilterRule + from .patch_route_filter import PatchRouteFilter + from .bgp_community import BGPCommunity + from .bgp_service_community import BgpServiceCommunity + from .usage_name import UsageName + from .usage import Usage + from .address_space import AddressSpace + from .virtual_network_peering import VirtualNetworkPeering + from .dhcp_options import DhcpOptions + from .virtual_network import VirtualNetwork + from .ip_address_availability_result import IPAddressAvailabilityResult + from .virtual_network_usage_name import VirtualNetworkUsageName + from .virtual_network_usage import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku import VirtualNetworkGatewaySku + from .vpn_client_root_certificate import VpnClientRootCertificate + from .vpn_client_revoked_certificate import VpnClientRevokedCertificate + from .vpn_client_configuration import VpnClientConfiguration + from .bgp_settings import BgpSettings + from .bgp_peer_status import BgpPeerStatus + from .gateway_route import GatewayRoute + from .virtual_network_gateway import VirtualNetworkGateway + from .vpn_client_parameters import VpnClientParameters + from .bgp_peer_status_list_result import BgpPeerStatusListResult + from .gateway_route_list_result import GatewayRouteListResult + from .tunnel_connection_health import TunnelConnectionHealth + from .local_network_gateway import LocalNetworkGateway + from .ipsec_policy import IpsecPolicy + from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection + from .connection_reset_shared_key import ConnectionResetSharedKey + from .connection_shared_key import ConnectionSharedKey + from .virtual_network_connection_gateway_reference import VirtualNetworkConnectionGatewayReference + from .virtual_network_gateway_connection_list_entity import VirtualNetworkGatewayConnectionListEntity + from .vpn_device_script_parameters import VpnDeviceScriptParameters from .application_gateway_paged import ApplicationGatewayPaged from .application_gateway_ssl_predefined_policy_paged import ApplicationGatewaySslPredefinedPolicyPaged from .application_security_group_paged import ApplicationSecurityGroupPaged diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/address_space.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/address_space.py index d7050c78a457..fbf42c9e0ade 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/address_space.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/address_space.py @@ -25,6 +25,6 @@ class AddressSpace(Model): 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, } - def __init__(self, address_prefixes=None): - super(AddressSpace, self).__init__() - self.address_prefixes = address_prefixes + def __init__(self, **kwargs): + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = kwargs.get('address_prefixes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/address_space_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/address_space_py3.py new file mode 100644 index 000000000000..9794cc805efa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/address_space_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AddressSpace(Model): + """AddressSpace contains an array of IP address ranges that can be used by + subnets of the virtual network. + + :param address_prefixes: A list of address blocks reserved for this + virtual network in CIDR notation. + :type address_prefixes: list[str] + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__(self, *, address_prefixes=None, **kwargs) -> None: + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = address_prefixes diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway.py index 64c65fabb4da..59e22415be4c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway.py @@ -134,25 +134,25 @@ class ApplicationGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, redirect_configurations=None, web_application_firewall_configuration=None, enable_http2=None, resource_guid=None, provisioning_state=None, etag=None): - super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.ssl_policy = ssl_policy + def __init__(self, **kwargs): + super(ApplicationGateway, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.ssl_policy = kwargs.get('ssl_policy', None) self.operational_state = None - self.gateway_ip_configurations = gateway_ip_configurations - self.authentication_certificates = authentication_certificates - self.ssl_certificates = ssl_certificates - self.frontend_ip_configurations = frontend_ip_configurations - self.frontend_ports = frontend_ports - self.probes = probes - self.backend_address_pools = backend_address_pools - self.backend_http_settings_collection = backend_http_settings_collection - self.http_listeners = http_listeners - self.url_path_maps = url_path_maps - self.request_routing_rules = request_routing_rules - self.redirect_configurations = redirect_configurations - self.web_application_firewall_configuration = web_application_firewall_configuration - self.enable_http2 = enable_http2 - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.gateway_ip_configurations = kwargs.get('gateway_ip_configurations', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.ssl_certificates = kwargs.get('ssl_certificates', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.frontend_ports = kwargs.get('frontend_ports', None) + self.probes = kwargs.get('probes', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) + self.http_listeners = kwargs.get('http_listeners', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.redirect_configurations = kwargs.get('redirect_configurations', None) + self.web_application_firewall_configuration = kwargs.get('web_application_firewall_configuration', None) + self.enable_http2 = kwargs.get('enable_http2', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_authentication_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_authentication_certificate.py index 18f36b7401a7..dff594340e59 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_authentication_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_authentication_certificate.py @@ -42,10 +42,10 @@ class ApplicationGatewayAuthenticationCertificate(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, data=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id) - self.data = data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayAuthenticationCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_authentication_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_authentication_certificate_py3.py new file mode 100644 index 000000000000..f31145eb222c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_authentication_certificate_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayAuthenticationCertificate(SubResource): + """Authentication certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Certificate public data. + :type data: str + :param provisioning_state: Provisioning state of the authentication + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_ssl_options.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_ssl_options.py index d5f6cbe5dcfc..74f805ac4683 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_ssl_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_ssl_options.py @@ -62,9 +62,9 @@ class ApplicationGatewayAvailableSslOptions(Resource): 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, } - def __init__(self, id=None, location=None, tags=None, predefined_policies=None, default_policy=None, available_cipher_suites=None, available_protocols=None): - super(ApplicationGatewayAvailableSslOptions, self).__init__(id=id, location=location, tags=tags) - self.predefined_policies = predefined_policies - self.default_policy = default_policy - self.available_cipher_suites = available_cipher_suites - self.available_protocols = available_protocols + def __init__(self, **kwargs): + super(ApplicationGatewayAvailableSslOptions, self).__init__(**kwargs) + self.predefined_policies = kwargs.get('predefined_policies', None) + self.default_policy = kwargs.get('default_policy', None) + self.available_cipher_suites = kwargs.get('available_cipher_suites', None) + self.available_protocols = kwargs.get('available_protocols', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_ssl_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_ssl_options_py3.py new file mode 100644 index 000000000000..6c4acbd27664 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_ssl_options_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayAvailableSslOptions(Resource): + """Response for ApplicationGatewayAvailableSslOptions API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param predefined_policies: List of available Ssl predefined policy. + :type predefined_policies: + list[~azure.mgmt.network.v2017_10_01.models.SubResource] + :param default_policy: Name of the Ssl predefined policy applied by + default to application gateway. Possible values include: + 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type default_policy: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslPolicyName + :param available_cipher_suites: List of available Ssl cipher suites. + :type available_cipher_suites: list[str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslCipherSuite] + :param available_protocols: List of available Ssl protocols. + :type available_protocols: list[str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslProtocol] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'predefined_policies': {'key': 'properties.predefinedPolicies', 'type': '[SubResource]'}, + 'default_policy': {'key': 'properties.defaultPolicy', 'type': 'str'}, + 'available_cipher_suites': {'key': 'properties.availableCipherSuites', 'type': '[str]'}, + 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, predefined_policies=None, default_policy=None, available_cipher_suites=None, available_protocols=None, **kwargs) -> None: + super(ApplicationGatewayAvailableSslOptions, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.predefined_policies = predefined_policies + self.default_policy = default_policy + self.available_cipher_suites = available_cipher_suites + self.available_protocols = available_protocols diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_waf_rule_sets_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_waf_rule_sets_result.py index 301e3989aa59..65f59314f8a6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_waf_rule_sets_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_waf_rule_sets_result.py @@ -24,6 +24,6 @@ class ApplicationGatewayAvailableWafRuleSetsResult(Model): 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, } - def __init__(self, value=None): - super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_waf_rule_sets_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_waf_rule_sets_result_py3.py new file mode 100644 index 000000000000..7bdb29024adb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_available_waf_rule_sets_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayAvailableWafRuleSetsResult(Model): + """Response for ApplicationGatewayAvailableWafRuleSets API service call. + + :param value: The list of application gateway rule sets. + :type value: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayFirewallRuleSet] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address.py index 6005027d0845..e7a61fe1705c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address.py @@ -26,7 +26,7 @@ class ApplicationGatewayBackendAddress(Model): 'ip_address': {'key': 'ipAddress', 'type': 'str'}, } - def __init__(self, fqdn=None, ip_address=None): - super(ApplicationGatewayBackendAddress, self).__init__() - self.fqdn = fqdn - self.ip_address = ip_address + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = kwargs.get('fqdn', None) + self.ip_address = kwargs.get('ip_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address_pool.py index fb4b7f588984..508528e31756 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address_pool.py @@ -47,11 +47,11 @@ class ApplicationGatewayBackendAddressPool(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayBackendAddressPool, self).__init__(id=id) - self.backend_ip_configurations = backend_ip_configurations - self.backend_addresses = backend_addresses - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddressPool, self).__init__(**kwargs) + self.backend_ip_configurations = kwargs.get('backend_ip_configurations', None) + self.backend_addresses = kwargs.get('backend_addresses', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address_pool_py3.py new file mode 100644 index 000000000000..3984ba48ddde --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address_pool_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + :param id: Resource ID. + :type id: str + :param backend_ip_configurations: Collection of references to IPs defined + in network interfaces. + :type backend_ip_configurations: + list[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses + :type backend_addresses: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendAddress] + :param provisioning_state: Provisioning state of the backend address pool + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Resource that is unique within a resource group. This name + can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = backend_ip_configurations + self.backend_addresses = backend_addresses + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address_py3.py new file mode 100644 index 000000000000..d18e476244d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_address_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendAddress(Model): + """Backend address of an application gateway. + + :param fqdn: Fully qualified domain name (FQDN). + :type fqdn: str + :param ip_address: IP address + :type ip_address: str + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__(self, *, fqdn: str=None, ip_address: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = fqdn + self.ip_address = ip_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health.py index 5d5f14af4b4b..0e05cba9808c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health.py @@ -24,6 +24,6 @@ class ApplicationGatewayBackendHealth(Model): 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, } - def __init__(self, backend_address_pools=None): - super(ApplicationGatewayBackendHealth, self).__init__() - self.backend_address_pools = backend_address_pools + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = kwargs.get('backend_address_pools', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_http_settings.py index f1c0f7e4a7a0..8866b7f338d8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_http_settings.py @@ -29,7 +29,7 @@ class ApplicationGatewayBackendHealthHttpSettings(Model): 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, } - def __init__(self, backend_http_settings=None, servers=None): - super(ApplicationGatewayBackendHealthHttpSettings, self).__init__() - self.backend_http_settings = backend_http_settings - self.servers = servers + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.servers = kwargs.get('servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_http_settings_py3.py new file mode 100644 index 000000000000..3ce5d824b673 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_http_settings_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthHttpSettings(Model): + """Application gateway BackendHealthHttp settings. + + :param backend_http_settings: Reference of an + ApplicationGatewayBackendHttpSettings resource. + :type backend_http_settings: + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendHealthServer] + """ + + _attribute_map = { + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, + 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, + } + + def __init__(self, *, backend_http_settings=None, servers=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = backend_http_settings + self.servers = servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_pool.py index 012b506d2f6b..64c48a0cb3fd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_pool.py @@ -30,7 +30,7 @@ class ApplicationGatewayBackendHealthPool(Model): 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, } - def __init__(self, backend_address_pool=None, backend_http_settings_collection=None): - super(ApplicationGatewayBackendHealthPool, self).__init__() - self.backend_address_pool = backend_address_pool - self.backend_http_settings_collection = backend_http_settings_collection + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_pool_py3.py new file mode 100644 index 000000000000..f509a4bbb402 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_pool_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthPool(Model): + """Application gateway BackendHealth pool. + + :param backend_address_pool: Reference of an + ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of + ApplicationGatewayBackendHealthHttpSettings resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, + } + + def __init__(self, *, backend_address_pool=None, backend_http_settings_collection=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_http_settings_collection = backend_http_settings_collection diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_py3.py new file mode 100644 index 000000000000..74b19ab9e743 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealth(Model): + """List of ApplicationGatewayBackendHealthPool resources. + + :param backend_address_pools: + :type backend_address_pools: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendHealthPool] + """ + + _attribute_map = { + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, + } + + def __init__(self, *, backend_address_pools=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = backend_address_pools diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_server.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_server.py index 72691f4b3b0b..5bda8b39e5e7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_server.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_server.py @@ -32,8 +32,8 @@ class ApplicationGatewayBackendHealthServer(Model): 'health': {'key': 'health', 'type': 'str'}, } - def __init__(self, address=None, ip_configuration=None, health=None): - super(ApplicationGatewayBackendHealthServer, self).__init__() - self.address = address - self.ip_configuration = ip_configuration - self.health = health + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + self.ip_configuration = kwargs.get('ip_configuration', None) + self.health = kwargs.get('health', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_server_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_server_py3.py new file mode 100644 index 000000000000..541b304eb986 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_server_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthServer(Model): + """Application gateway backendhealth http settings. + + :param address: IP address or FQDN of backend server. + :type address: str + :param ip_configuration: Reference of IP configuration of backend server. + :type ip_configuration: + ~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceIPConfiguration + :param health: Health of backend server. Possible values include: + 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + :type health: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendHealthServerHealth + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'health': {'key': 'health', 'type': 'str'}, + } + + def __init__(self, *, address: str=None, ip_configuration=None, health=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = address + self.ip_configuration = ip_configuration + self.health = health diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_http_settings.py index a90c0c4fbc54..87c90c7e61c2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_http_settings.py @@ -87,21 +87,21 @@ class ApplicationGatewayBackendHttpSettings(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, port=None, protocol=None, cookie_based_affinity=None, request_timeout=None, probe=None, authentication_certificates=None, connection_draining=None, host_name=None, pick_host_name_from_backend_address=None, affinity_cookie_name=None, probe_enabled=None, path=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id) - self.port = port - self.protocol = protocol - self.cookie_based_affinity = cookie_based_affinity - self.request_timeout = request_timeout - self.probe = probe - self.authentication_certificates = authentication_certificates - self.connection_draining = connection_draining - self.host_name = host_name - self.pick_host_name_from_backend_address = pick_host_name_from_backend_address - self.affinity_cookie_name = affinity_cookie_name - self.probe_enabled = probe_enabled - self.path = path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHttpSettings, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.protocol = kwargs.get('protocol', None) + self.cookie_based_affinity = kwargs.get('cookie_based_affinity', None) + self.request_timeout = kwargs.get('request_timeout', None) + self.probe = kwargs.get('probe', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.connection_draining = kwargs.get('connection_draining', None) + self.host_name = kwargs.get('host_name', None) + self.pick_host_name_from_backend_address = kwargs.get('pick_host_name_from_backend_address', None) + self.affinity_cookie_name = kwargs.get('affinity_cookie_name', None) + self.probe_enabled = kwargs.get('probe_enabled', None) + self.path = kwargs.get('path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_http_settings_py3.py new file mode 100644 index 000000000000..c595f9669aa0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_http_settings_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendHttpSettings(SubResource): + """Backend address pool settings of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Port + :type port: int + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayProtocol + :param cookie_based_affinity: Cookie based affinity. Possible values + include: 'Enabled', 'Disabled' + :type cookie_based_affinity: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayCookieBasedAffinity + :param request_timeout: Request timeout in seconds. Application Gateway + will fail the request if response is not received within RequestTimeout. + Acceptable values are from 1 second to 86400 seconds. + :type request_timeout: int + :param probe: Probe resource of an application gateway. + :type probe: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param authentication_certificates: Array of references to application + gateway authentication certificates. + :type authentication_certificates: + list[~azure.mgmt.network.v2017_10_01.models.SubResource] + :param connection_draining: Connection draining of the backend http + settings resource. + :type connection_draining: + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayConnectionDraining + :param host_name: Host header to be sent to the backend servers. + :type host_name: str + :param pick_host_name_from_backend_address: Whether to pick host header + should be picked from the host name of the backend server. Default value + is false. + :type pick_host_name_from_backend_address: bool + :param affinity_cookie_name: Cookie name to use for the affinity cookie. + :type affinity_cookie_name: str + :param probe_enabled: Whether the probe is enabled. Default value is + false. + :type probe_enabled: bool + :param path: Path which should be used as a prefix for all HTTP requests. + Null means no path will be prefixed. Default value is null. + :type path: str + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, + 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, + 'connection_draining': {'key': 'properties.connectionDraining', 'type': 'ApplicationGatewayConnectionDraining'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'pick_host_name_from_backend_address': {'key': 'properties.pickHostNameFromBackendAddress', 'type': 'bool'}, + 'affinity_cookie_name': {'key': 'properties.affinityCookieName', 'type': 'str'}, + 'probe_enabled': {'key': 'properties.probeEnabled', 'type': 'bool'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, protocol=None, cookie_based_affinity=None, request_timeout: int=None, probe=None, authentication_certificates=None, connection_draining=None, host_name: str=None, pick_host_name_from_backend_address: bool=None, affinity_cookie_name: str=None, probe_enabled: bool=None, path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id, **kwargs) + self.port = port + self.protocol = protocol + self.cookie_based_affinity = cookie_based_affinity + self.request_timeout = request_timeout + self.probe = probe + self.authentication_certificates = authentication_certificates + self.connection_draining = connection_draining + self.host_name = host_name + self.pick_host_name_from_backend_address = pick_host_name_from_backend_address + self.affinity_cookie_name = affinity_cookie_name + self.probe_enabled = probe_enabled + self.path = path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_connection_draining.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_connection_draining.py index 8f9b88b571e2..531b3cb05dd3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_connection_draining.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_connection_draining.py @@ -17,10 +17,12 @@ class ApplicationGatewayConnectionDraining(Model): active for a specified time after the backend server got removed from the configuration. - :param enabled: Whether connection draining is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. :type enabled: bool - :param drain_timeout_in_sec: The number of seconds connection draining is - active. Acceptable values are from 1 second to 3600 seconds. + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. :type drain_timeout_in_sec: int """ @@ -34,7 +36,7 @@ class ApplicationGatewayConnectionDraining(Model): 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, } - def __init__(self, enabled, drain_timeout_in_sec): - super(ApplicationGatewayConnectionDraining, self).__init__() - self.enabled = enabled - self.drain_timeout_in_sec = drain_timeout_in_sec + def __init__(self, **kwargs): + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.drain_timeout_in_sec = kwargs.get('drain_timeout_in_sec', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_connection_draining_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_connection_draining_py3.py new file mode 100644 index 000000000000..c46fb01cae72 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_connection_draining_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayConnectionDraining(Model): + """Connection draining allows open connections to a backend server to be + active for a specified time after the backend server got removed from the + configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. + :type enabled: bool + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. + :type drain_timeout_in_sec: int + """ + + _validation = { + 'enabled': {'required': True}, + 'drain_timeout_in_sec': {'required': True, 'maximum': 3600, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool, drain_timeout_in_sec: int, **kwargs) -> None: + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = enabled + self.drain_timeout_in_sec = drain_timeout_in_sec diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_disabled_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_disabled_rule_group.py index 02c88980e857..085ae3d78c5c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_disabled_rule_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_disabled_rule_group.py @@ -15,7 +15,10 @@ class ApplicationGatewayFirewallDisabledRuleGroup(Model): """Allows to disable rules within a rule group or an entire rule group. - :param rule_group_name: The name of the rule group that will be disabled. + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. :type rule_group_name: str :param rules: The list of rules that will be disabled. If null, all rules of the rule group will be disabled. @@ -31,7 +34,7 @@ class ApplicationGatewayFirewallDisabledRuleGroup(Model): 'rules': {'key': 'rules', 'type': '[int]'}, } - def __init__(self, rule_group_name, rules=None): - super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__() - self.rule_group_name = rule_group_name - self.rules = rules + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_disabled_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_disabled_rule_group_py3.py new file mode 100644 index 000000000000..44ac696b801c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_disabled_rule_group_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallDisabledRuleGroup(Model): + """Allows to disable rules within a rule group or an entire rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. + :type rule_group_name: str + :param rules: The list of rules that will be disabled. If null, all rules + of the rule group will be disabled. + :type rules: list[int] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[int]'}, + } + + def __init__(self, *, rule_group_name: str, rules=None, **kwargs) -> None: + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule.py index f3f7da7cc11b..661b0d146e16 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule.py @@ -15,7 +15,10 @@ class ApplicationGatewayFirewallRule(Model): """A web application firewall rule. - :param rule_id: The identifier of the web application firewall rule. + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. :type rule_id: int :param description: The description of the web application firewall rule. :type description: str @@ -30,7 +33,7 @@ class ApplicationGatewayFirewallRule(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, rule_id, description=None): - super(ApplicationGatewayFirewallRule, self).__init__() - self.rule_id = rule_id - self.description = description + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_group.py index 183d465199e8..4b7ede2a81fb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_group.py @@ -15,13 +15,16 @@ class ApplicationGatewayFirewallRuleGroup(Model): """A web application firewall rule group. - :param rule_group_name: The name of the web application firewall rule - group. + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. :type rule_group_name: str :param description: The description of the web application firewall rule group. :type description: str - :param rules: The rules of the web application firewall rule group. + :param rules: Required. The rules of the web application firewall rule + group. :type rules: list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayFirewallRule] """ @@ -37,8 +40,8 @@ class ApplicationGatewayFirewallRuleGroup(Model): 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, } - def __init__(self, rule_group_name, rules, description=None): - super(ApplicationGatewayFirewallRuleGroup, self).__init__() - self.rule_group_name = rule_group_name - self.description = description - self.rules = rules + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.description = kwargs.get('description', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_group_py3.py new file mode 100644 index 000000000000..3ce6ba421b8c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_group_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRuleGroup(Model): + """A web application firewall rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. + :type rule_group_name: str + :param description: The description of the web application firewall rule + group. + :type description: str + :param rules: Required. The rules of the web application firewall rule + group. + :type rules: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayFirewallRule] + """ + + _validation = { + 'rule_group_name': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, + } + + def __init__(self, *, rule_group_name: str, rules, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.description = description + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_py3.py new file mode 100644 index 000000000000..e332fbd16853 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRule(Model): + """A web application firewall rule. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. + :type rule_id: int + :param description: The description of the web application firewall rule. + :type description: str + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, rule_id: int, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = rule_id + self.description = description diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_set.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_set.py index a6c03f0fb9a5..22158cc06287 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_set.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_set.py @@ -18,6 +18,8 @@ class ApplicationGatewayFirewallRuleSet(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -31,13 +33,14 @@ class ApplicationGatewayFirewallRuleSet(Resource): :param provisioning_state: The provisioning state of the web application firewall rule set. :type provisioning_state: str - :param rule_set_type: The type of the web application firewall rule set. + :param rule_set_type: Required. The type of the web application firewall + rule set. :type rule_set_type: str - :param rule_set_version: The version of the web application firewall rule - set type. + :param rule_set_version: Required. The version of the web application + firewall rule set type. :type rule_set_version: str - :param rule_groups: The rule groups of the web application firewall rule - set. + :param rule_groups: Required. The rule groups of the web application + firewall rule set. :type rule_groups: list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayFirewallRuleGroup] """ @@ -62,9 +65,9 @@ class ApplicationGatewayFirewallRuleSet(Resource): 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, } - def __init__(self, rule_set_type, rule_set_version, rule_groups, id=None, location=None, tags=None, provisioning_state=None): - super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags) - self.provisioning_state = provisioning_state - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.rule_groups = rule_groups + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleSet, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.rule_groups = kwargs.get('rule_groups', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_set_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_set_py3.py new file mode 100644 index 000000000000..437d73660c13 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_firewall_rule_set_py3.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayFirewallRuleSet(Resource): + """A web application firewall rule set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param provisioning_state: The provisioning state of the web application + firewall rule set. + :type provisioning_state: str + :param rule_set_type: Required. The type of the web application firewall + rule set. + :type rule_set_type: str + :param rule_set_version: Required. The version of the web application + firewall rule set type. + :type rule_set_version: str + :param rule_groups: Required. The rule groups of the web application + firewall rule set. + :type rule_groups: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayFirewallRuleGroup] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'rule_groups': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, + } + + def __init__(self, *, rule_set_type: str, rule_set_version: str, rule_groups, id: str=None, location: str=None, tags=None, provisioning_state: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.rule_groups = rule_groups diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_ip_configuration.py index 955d0ad0ccdd..1d9c68482668 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_ip_configuration.py @@ -54,13 +54,13 @@ class ApplicationGatewayFrontendIPConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..12490c4b3316 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_ip_configuration_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): + """Frontend IP configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param private_ip_address: PrivateIPAddress of the network interface IP + Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: PrivateIP allocation method. Possible + values include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_10_01.models.IPAllocationMethod + :param subnet: Reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param provisioning_state: Provisioning state of the public IP resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_port.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_port.py index 2b1b32d1b79e..318c0554db0a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_port.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_port.py @@ -41,10 +41,10 @@ class ApplicationGatewayFrontendPort(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, port=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayFrontendPort, self).__init__(id=id) - self.port = port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendPort, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_port_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_port_py3.py new file mode 100644 index 000000000000..03c6c0a31e9c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_frontend_port_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Frontend port + :type port: int + :param provisioning_state: Provisioning state of the frontend port + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendPort, self).__init__(id=id, **kwargs) + self.port = port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_http_listener.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_http_listener.py index 14d50e652ffc..fd03a59bb01b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_http_listener.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_http_listener.py @@ -61,15 +61,15 @@ class ApplicationGatewayHttpListener(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name=None, ssl_certificate=None, require_server_name_indication=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayHttpListener, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.frontend_port = frontend_port - self.protocol = protocol - self.host_name = host_name - self.ssl_certificate = ssl_certificate - self.require_server_name_indication = require_server_name_indication - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayHttpListener, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.protocol = kwargs.get('protocol', None) + self.host_name = kwargs.get('host_name', None) + self.ssl_certificate = kwargs.get('ssl_certificate', None) + self.require_server_name_indication = kwargs.get('require_server_name_indication', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_http_listener_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_http_listener_py3.py new file mode 100644 index 000000000000..6b0b81fa4e7f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_http_listener_py3.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayHttpListener(SubResource): + """Http listener of an application gateway. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: Frontend IP configuration resource of an + application gateway. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayProtocol + :param host_name: Host name of HTTP listener. + :type host_name: str + :param ssl_certificate: SSL certificate resource of an application + gateway. + :type ssl_certificate: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param require_server_name_indication: Applicable only if protocol is + https. Enables SNI for multi-hosting. + :type require_server_name_indication: bool + :param provisioning_state: Provisioning state of the HTTP listener + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, + 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name: str=None, ssl_certificate=None, require_server_name_indication: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayHttpListener, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.frontend_port = frontend_port + self.protocol = protocol + self.host_name = host_name + self.ssl_certificate = ssl_certificate + self.require_server_name_indication = require_server_name_indication + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ip_configuration.py index 20410ea66d48..b34e8a44badb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ip_configuration.py @@ -44,10 +44,10 @@ class ApplicationGatewayIPConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, subnet=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayIPConfiguration, self).__init__(id=id) - self.subnet = subnet - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayIPConfiguration, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..4aa8851c985f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ip_configuration_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 + private IP configuration is allowed. + + :param id: Resource ID. + :type id: str + :param subnet: Reference of the subnet resource. A subnet from where + application gateway gets its private address. + :type subnet: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param provisioning_state: Provisioning state of the application gateway + subnet resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, subnet=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.subnet = subnet + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_path_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_path_rule.py index 87365e3bb1e9..3cb7e8383382 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_path_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_path_rule.py @@ -56,13 +56,13 @@ class ApplicationGatewayPathRule(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, paths=None, backend_address_pool=None, backend_http_settings=None, redirect_configuration=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayPathRule, self).__init__(id=id) - self.paths = paths - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.redirect_configuration = redirect_configuration - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayPathRule, self).__init__(**kwargs) + self.paths = kwargs.get('paths', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_path_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_path_rule_py3.py new file mode 100644 index 000000000000..c077756fe97c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_path_rule_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayPathRule(SubResource): + """Path rule of URL path map of an application gateway. + + :param id: Resource ID. + :type id: str + :param paths: Path rules of URL path map. + :type paths: list[str] + :param backend_address_pool: Backend address pool resource of URL path map + path rule. + :type backend_address_pool: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param backend_http_settings: Backend http settings resource of URL path + map path rule. + :type backend_http_settings: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of URL path + map path rule. + :type redirect_configuration: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param provisioning_state: Path rule of URL path map resource. Possible + values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'paths': {'key': 'properties.paths', 'type': '[str]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, paths=None, backend_address_pool=None, backend_http_settings=None, redirect_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayPathRule, self).__init__(id=id, **kwargs) + self.paths = paths + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.redirect_configuration = redirect_configuration + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe.py index 5bed6cfed6af..83af2d1130bd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe.py @@ -76,18 +76,18 @@ class ApplicationGatewayProbe(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, protocol=None, host=None, path=None, interval=None, timeout=None, unhealthy_threshold=None, pick_host_name_from_backend_http_settings=None, min_servers=None, match=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayProbe, self).__init__(id=id) - self.protocol = protocol - self.host = host - self.path = path - self.interval = interval - self.timeout = timeout - self.unhealthy_threshold = unhealthy_threshold - self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings - self.min_servers = min_servers - self.match = match - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayProbe, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.host = kwargs.get('host', None) + self.path = kwargs.get('path', None) + self.interval = kwargs.get('interval', None) + self.timeout = kwargs.get('timeout', None) + self.unhealthy_threshold = kwargs.get('unhealthy_threshold', None) + self.pick_host_name_from_backend_http_settings = kwargs.get('pick_host_name_from_backend_http_settings', None) + self.min_servers = kwargs.get('min_servers', None) + self.match = kwargs.get('match', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe_health_response_match.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe_health_response_match.py index beaef556eb99..b439b9677f8b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe_health_response_match.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe_health_response_match.py @@ -28,7 +28,7 @@ class ApplicationGatewayProbeHealthResponseMatch(Model): 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, } - def __init__(self, body=None, status_codes=None): - super(ApplicationGatewayProbeHealthResponseMatch, self).__init__() - self.body = body - self.status_codes = status_codes + def __init__(self, **kwargs): + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = kwargs.get('body', None) + self.status_codes = kwargs.get('status_codes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe_health_response_match_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe_health_response_match_py3.py new file mode 100644 index 000000000000..6ed2ee8c04ed --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe_health_response_match_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayProbeHealthResponseMatch(Model): + """Application gateway probe health response match. + + :param body: Body that must be contained in the health response. Default + value is empty. + :type body: str + :param status_codes: Allowed ranges of healthy status codes. Default range + of healthy status codes is 200-399. + :type status_codes: list[str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'str'}, + 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, + } + + def __init__(self, *, body: str=None, status_codes=None, **kwargs) -> None: + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = body + self.status_codes = status_codes diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe_py3.py new file mode 100644 index 000000000000..83d8c9d295b1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayProbe(SubResource): + """Probe of the application gateway. + + :param id: Resource ID. + :type id: str + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is + sent to ://: + :type path: str + :param interval: The probing interval in seconds. This is the time + interval between two consecutive probes. Acceptable values are from 1 + second to 86400 seconds. + :type interval: int + :param timeout: the probe timeout in seconds. Probe marked as failed if + valid response is not received with this timeout period. Acceptable values + are from 1 second to 86400 seconds. + :type timeout: int + :param unhealthy_threshold: The probe retry count. Backend server is + marked down after consecutive probe failure count reaches + UnhealthyThreshold. Acceptable values are from 1 second to 20. + :type unhealthy_threshold: int + :param pick_host_name_from_backend_http_settings: Whether the host header + should be picked from the backend http settings. Default value is false. + :type pick_host_name_from_backend_http_settings: bool + :param min_servers: Minimum number of servers that are always marked + healthy. Default value is 0. + :type min_servers: int + :param match: Criterion for classifying a healthy probe response. + :type match: + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayProbeHealthResponseMatch + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host': {'key': 'properties.host', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, + 'pick_host_name_from_backend_http_settings': {'key': 'properties.pickHostNameFromBackendHttpSettings', 'type': 'bool'}, + 'min_servers': {'key': 'properties.minServers', 'type': 'int'}, + 'match': {'key': 'properties.match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, protocol=None, host: str=None, path: str=None, interval: int=None, timeout: int=None, unhealthy_threshold: int=None, pick_host_name_from_backend_http_settings: bool=None, min_servers: int=None, match=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayProbe, self).__init__(id=id, **kwargs) + self.protocol = protocol + self.host = host + self.path = path + self.interval = interval + self.timeout = timeout + self.unhealthy_threshold = unhealthy_threshold + self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings + self.min_servers = min_servers + self.match = match + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_py3.py new file mode 100644 index 000000000000..c2602745c5f6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_py3.py @@ -0,0 +1,158 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGateway(Resource): + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslPolicy + :ivar operational_state: Operational state of the application gateway + resource. Possible values include: 'Stopped', 'Starting', 'Running', + 'Stopping' + :vartype operational_state: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayOperationalState + :param gateway_ip_configurations: Subnets of application the gateway + resource. + :type gateway_ip_configurations: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayIPConfiguration] + :param authentication_certificates: Authentication certificates of the + application gateway resource. + :type authentication_certificates: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayAuthenticationCertificate] + :param ssl_certificates: SSL certificates of the application gateway + resource. + :type ssl_certificates: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslCertificate] + :param frontend_ip_configurations: Frontend IP addresses of the + application gateway resource. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayFrontendIPConfiguration] + :param frontend_ports: Frontend ports of the application gateway resource. + :type frontend_ports: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayProbe] + :param backend_address_pools: Backend address pool of the application + gateway resource. + :type backend_address_pools: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendAddressPool] + :param backend_http_settings_collection: Backend http settings of the + application gateway resource. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendHttpSettings] + :param http_listeners: Http listeners of the application gateway resource. + :type http_listeners: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayHttpListener] + :param url_path_maps: URL path map of the application gateway resource. + :type url_path_maps: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application + gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayRequestRoutingRule] + :param redirect_configurations: Redirect configurations of the application + gateway resource. + :type redirect_configurations: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayRedirectConfiguration] + :param web_application_firewall_configuration: Web application firewall + configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param enable_http2: Whether HTTP2 is enabled on the application gateway + resource. + :type enable_http2: bool + :param resource_guid: Resource GUID property of the application gateway + resource. + :type resource_guid: str + :param provisioning_state: Provisioning state of the application gateway + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operational_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, + 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, + 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, + 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, + 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, + 'redirect_configurations': {'key': 'properties.redirectConfigurations', 'type': '[ApplicationGatewayRedirectConfiguration]'}, + 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, + 'enable_http2': {'key': 'properties.enableHttp2', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, redirect_configurations=None, web_application_firewall_configuration=None, enable_http2: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.ssl_policy = ssl_policy + self.operational_state = None + self.gateway_ip_configurations = gateway_ip_configurations + self.authentication_certificates = authentication_certificates + self.ssl_certificates = ssl_certificates + self.frontend_ip_configurations = frontend_ip_configurations + self.frontend_ports = frontend_ports + self.probes = probes + self.backend_address_pools = backend_address_pools + self.backend_http_settings_collection = backend_http_settings_collection + self.http_listeners = http_listeners + self.url_path_maps = url_path_maps + self.request_routing_rules = request_routing_rules + self.redirect_configurations = redirect_configurations + self.web_application_firewall_configuration = web_application_firewall_configuration + self.enable_http2 = enable_http2 + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_redirect_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_redirect_configuration.py index 0f61f7577e90..d1f36cf7bb25 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_redirect_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_redirect_configuration.py @@ -66,16 +66,16 @@ class ApplicationGatewayRedirectConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, redirect_type=None, target_listener=None, target_url=None, include_path=None, include_query_string=None, request_routing_rules=None, url_path_maps=None, path_rules=None, name=None, etag=None, type=None): - super(ApplicationGatewayRedirectConfiguration, self).__init__(id=id) - self.redirect_type = redirect_type - self.target_listener = target_listener - self.target_url = target_url - self.include_path = include_path - self.include_query_string = include_query_string - self.request_routing_rules = request_routing_rules - self.url_path_maps = url_path_maps - self.path_rules = path_rules - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayRedirectConfiguration, self).__init__(**kwargs) + self.redirect_type = kwargs.get('redirect_type', None) + self.target_listener = kwargs.get('target_listener', None) + self.target_url = kwargs.get('target_url', None) + self.include_path = kwargs.get('include_path', None) + self.include_query_string = kwargs.get('include_query_string', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.path_rules = kwargs.get('path_rules', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_redirect_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_redirect_configuration_py3.py new file mode 100644 index 000000000000..117ba9bda7bd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_redirect_configuration_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRedirectConfiguration(SubResource): + """Redirect configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param redirect_type: Supported http redirection types - Permanent, + Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', + 'SeeOther', 'Temporary' + :type redirect_type: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayRedirectType + :param target_listener: Reference to a listener to redirect the request + to. + :type target_listener: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param target_url: Url to redirect the request to. + :type target_url: str + :param include_path: Include path in the redirected url. + :type include_path: bool + :param include_query_string: Include query string in the redirected url. + :type include_query_string: bool + :param request_routing_rules: Request routing specifying redirect + configuration. + :type request_routing_rules: + list[~azure.mgmt.network.v2017_10_01.models.SubResource] + :param url_path_maps: Url path maps specifying default redirect + configuration. + :type url_path_maps: + list[~azure.mgmt.network.v2017_10_01.models.SubResource] + :param path_rules: Path rules specifying redirect configuration. + :type path_rules: list[~azure.mgmt.network.v2017_10_01.models.SubResource] + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'redirect_type': {'key': 'properties.redirectType', 'type': 'str'}, + 'target_listener': {'key': 'properties.targetListener', 'type': 'SubResource'}, + 'target_url': {'key': 'properties.targetUrl', 'type': 'str'}, + 'include_path': {'key': 'properties.includePath', 'type': 'bool'}, + 'include_query_string': {'key': 'properties.includeQueryString', 'type': 'bool'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[SubResource]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[SubResource]'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[SubResource]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, redirect_type=None, target_listener=None, target_url: str=None, include_path: bool=None, include_query_string: bool=None, request_routing_rules=None, url_path_maps=None, path_rules=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayRedirectConfiguration, self).__init__(id=id, **kwargs) + self.redirect_type = redirect_type + self.target_listener = target_listener + self.target_url = target_url + self.include_path = include_path + self.include_query_string = include_query_string + self.request_routing_rules = request_routing_rules + self.url_path_maps = url_path_maps + self.path_rules = path_rules + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_request_routing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_request_routing_rule.py index 6184ecb7b0f3..7f39535a19de 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_request_routing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_request_routing_rule.py @@ -64,15 +64,15 @@ class ApplicationGatewayRequestRoutingRule(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, redirect_configuration=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id) - self.rule_type = rule_type - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.http_listener = http_listener - self.url_path_map = url_path_map - self.redirect_configuration = redirect_configuration - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayRequestRoutingRule, self).__init__(**kwargs) + self.rule_type = kwargs.get('rule_type', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.http_listener = kwargs.get('http_listener', None) + self.url_path_map = kwargs.get('url_path_map', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_request_routing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_request_routing_rule_py3.py new file mode 100644 index 000000000000..4f3af9d6a4ee --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_request_routing_rule_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRequestRoutingRule(SubResource): + """Request routing rule of an application gateway. + + :param id: Resource ID. + :type id: str + :param rule_type: Rule type. Possible values include: 'Basic', + 'PathBasedRouting' + :type rule_type: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayRequestRoutingRuleType + :param backend_address_pool: Backend address pool resource of the + application gateway. + :type backend_address_pool: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param backend_http_settings: Frontend port resource of the application + gateway. + :type backend_http_settings: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of the + application gateway. + :type redirect_configuration: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param provisioning_state: Provisioning state of the request routing rule + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, + 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, redirect_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id, **kwargs) + self.rule_type = rule_type + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.http_listener = http_listener + self.url_path_map = url_path_map + self.redirect_configuration = redirect_configuration + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_sku.py index 4a71b3f924e9..1c4ec6f15efd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_sku.py @@ -34,8 +34,8 @@ class ApplicationGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(ApplicationGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_sku_py3.py new file mode 100644 index 000000000000..a569cbf9ef5d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_sku_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySku(Model): + """SKU of an application gateway. + + :param name: Name of an application gateway SKU. Possible values include: + 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', + 'WAF_Large' + :type name: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySkuName + :param tier: Tier of an application gateway. Possible values include: + 'Standard', 'WAF' + :type tier: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayTier + :param capacity: Capacity (instance count) of an application gateway. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_certificate.py index 104629e84a5c..1dfedd4908df 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_certificate.py @@ -50,12 +50,12 @@ class ApplicationGatewaySslCertificate(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, data=None, password=None, public_cert_data=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewaySslCertificate, self).__init__(id=id) - self.data = data - self.password = password - self.public_cert_data = public_cert_data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewaySslCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.password = kwargs.get('password', None) + self.public_cert_data = kwargs.get('public_cert_data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_certificate_py3.py new file mode 100644 index 000000000000..ddb6745c9005 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_certificate_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Base-64 encoded pfx certificate. Only applicable in PUT + Request. + :type data: str + :param password: Password for the pfx file specified in data. Only + applicable in PUT request. + :type password: str + :param public_cert_data: Base-64 encoded Public cert data corresponding to + pfx specified in data. Only applicable in GET request. + :type public_cert_data: str + :param provisioning_state: Provisioning state of the SSL certificate + resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, password: str=None, public_cert_data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewaySslCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.password = password + self.public_cert_data = public_cert_data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_policy.py index 3af04060dc18..28a1755d1a66 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_policy.py @@ -47,10 +47,10 @@ class ApplicationGatewaySslPolicy(Model): 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, } - def __init__(self, disabled_ssl_protocols=None, policy_type=None, policy_name=None, cipher_suites=None, min_protocol_version=None): - super(ApplicationGatewaySslPolicy, self).__init__() - self.disabled_ssl_protocols = disabled_ssl_protocols - self.policy_type = policy_type - self.policy_name = policy_name - self.cipher_suites = cipher_suites - self.min_protocol_version = min_protocol_version + def __init__(self, **kwargs): + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = kwargs.get('disabled_ssl_protocols', None) + self.policy_type = kwargs.get('policy_type', None) + self.policy_name = kwargs.get('policy_name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_policy_py3.py new file mode 100644 index 000000000000..5c01d6283b40 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_policy_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySslPolicy(Model): + """Application Gateway Ssl policy. + + :param disabled_ssl_protocols: Ssl protocols to be disabled on application + gateway. + :type disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslProtocol] + :param policy_type: Type of Ssl Policy. Possible values include: + 'Predefined', 'Custom' + :type policy_type: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslPolicyType + :param policy_name: Name of Ssl predefined policy. Possible values + include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type policy_name: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslPolicyName + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order to application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, + 'policy_type': {'key': 'policyType', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'cipher_suites': {'key': 'cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, *, disabled_ssl_protocols=None, policy_type=None, policy_name=None, cipher_suites=None, min_protocol_version=None, **kwargs) -> None: + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = disabled_ssl_protocols + self.policy_type = policy_type + self.policy_name = policy_name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_predefined_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_predefined_policy.py index 9638e6bf204a..3aae0e4050e2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_predefined_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_predefined_policy.py @@ -37,8 +37,8 @@ class ApplicationGatewaySslPredefinedPolicy(SubResource): 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, } - def __init__(self, id=None, name=None, cipher_suites=None, min_protocol_version=None): - super(ApplicationGatewaySslPredefinedPolicy, self).__init__(id=id) - self.name = name - self.cipher_suites = cipher_suites - self.min_protocol_version = min_protocol_version + def __init__(self, **kwargs): + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_predefined_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_predefined_policy_py3.py new file mode 100644 index 000000000000..57d613d53330 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_ssl_predefined_policy_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslPredefinedPolicy(SubResource): + """An Ssl predefined policy. + + :param id: Resource ID. + :type id: str + :param name: Name of Ssl predefined policy. + :type name: str + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order for application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, cipher_suites=None, min_protocol_version=None, **kwargs) -> None: + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(id=id, **kwargs) + self.name = name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_url_path_map.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_url_path_map.py index bf5d50290ab2..6ece7c54d09d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_url_path_map.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_url_path_map.py @@ -58,13 +58,13 @@ class ApplicationGatewayUrlPathMap(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, default_backend_address_pool=None, default_backend_http_settings=None, default_redirect_configuration=None, path_rules=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayUrlPathMap, self).__init__(id=id) - self.default_backend_address_pool = default_backend_address_pool - self.default_backend_http_settings = default_backend_http_settings - self.default_redirect_configuration = default_redirect_configuration - self.path_rules = path_rules - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayUrlPathMap, self).__init__(**kwargs) + self.default_backend_address_pool = kwargs.get('default_backend_address_pool', None) + self.default_backend_http_settings = kwargs.get('default_backend_http_settings', None) + self.default_redirect_configuration = kwargs.get('default_redirect_configuration', None) + self.path_rules = kwargs.get('path_rules', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_url_path_map_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_url_path_map_py3.py new file mode 100644 index 000000000000..460120a75504 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_url_path_map_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayUrlPathMap(SubResource): + """UrlPathMaps give a url path to the backend mapping information for + PathBasedRouting. + + :param id: Resource ID. + :type id: str + :param default_backend_address_pool: Default backend address pool resource + of URL path map. + :type default_backend_address_pool: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param default_backend_http_settings: Default backend http settings + resource of URL path map. + :type default_backend_http_settings: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param default_redirect_configuration: Default redirect configuration + resource of URL path map. + :type default_redirect_configuration: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayPathRule] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, + 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, + 'default_redirect_configuration': {'key': 'properties.defaultRedirectConfiguration', 'type': 'SubResource'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, default_backend_address_pool=None, default_backend_http_settings=None, default_redirect_configuration=None, path_rules=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayUrlPathMap, self).__init__(id=id, **kwargs) + self.default_backend_address_pool = default_backend_address_pool + self.default_backend_http_settings = default_backend_http_settings + self.default_redirect_configuration = default_redirect_configuration + self.path_rules = path_rules + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_web_application_firewall_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_web_application_firewall_configuration.py index 4184423e3032..1d24a8dff009 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_web_application_firewall_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_web_application_firewall_configuration.py @@ -15,16 +15,19 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): """Application gateway web application firewall configuration. - :param enabled: Whether the web application firewall is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. :type enabled: bool - :param firewall_mode: Web application firewall mode. Possible values - include: 'Detection', 'Prevention' + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' :type firewall_mode: str or ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayFirewallMode - :param rule_set_type: The type of the web application firewall rule set. - Possible values are: 'OWASP'. + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. :type rule_set_type: str - :param rule_set_version: The version of the rule set type. + :param rule_set_version: Required. The version of the rule set type. :type rule_set_version: str :param disabled_rule_groups: The disabled rule groups. :type disabled_rule_groups: @@ -46,10 +49,10 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, } - def __init__(self, enabled, firewall_mode, rule_set_type, rule_set_version, disabled_rule_groups=None): - super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__() - self.enabled = enabled - self.firewall_mode = firewall_mode - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.disabled_rule_groups = disabled_rule_groups + def __init__(self, **kwargs): + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.firewall_mode = kwargs.get('firewall_mode', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.disabled_rule_groups = kwargs.get('disabled_rule_groups', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_web_application_firewall_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_web_application_firewall_configuration_py3.py new file mode 100644 index 000000000000..e1e10cd9eb7b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_web_application_firewall_configuration_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayWebApplicationFirewallConfiguration(Model): + """Application gateway web application firewall configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. + :type enabled: bool + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' + :type firewall_mode: str or + ~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayFirewallMode + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. + :type rule_set_type: str + :param rule_set_version: Required. The version of the rule set type. + :type rule_set_version: str + :param disabled_rule_groups: The disabled rule groups. + :type disabled_rule_groups: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayFirewallDisabledRuleGroup] + """ + + _validation = { + 'enabled': {'required': True}, + 'firewall_mode': {'required': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, + } + + def __init__(self, *, enabled: bool, firewall_mode, rule_set_type: str, rule_set_version: str, disabled_rule_groups=None, **kwargs) -> None: + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = enabled + self.firewall_mode = firewall_mode + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.disabled_rule_groups = disabled_rule_groups diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_security_group.py index 302abc528319..1372f778ae62 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_security_group.py @@ -61,8 +61,8 @@ class ApplicationSecurityGroup(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None): - super(ApplicationSecurityGroup, self).__init__(id=id, location=location, tags=tags) + def __init__(self, **kwargs): + super(ApplicationSecurityGroup, self).__init__(**kwargs) self.resource_guid = None self.provisioning_state = None self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_security_group_py3.py new file mode 100644 index 000000000000..f14f84e29b86 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_security_group_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationSecurityGroup(Resource): + """An application security group in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar resource_guid: The resource GUID property of the application + security group resource. It uniquely identifies a resource, even if the + user changes its name or migrate the resource across subscriptions or + resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the application + security group resource. Possible values are: 'Succeeded', 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(ApplicationSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.resource_guid = None + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/availability.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/availability.py index c45356ed4847..16b7cfa04955 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/availability.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/availability.py @@ -29,8 +29,8 @@ class Availability(Model): 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, } - def __init__(self, time_grain=None, retention=None, blob_duration=None): - super(Availability, self).__init__() - self.time_grain = time_grain - self.retention = retention - self.blob_duration = blob_duration + def __init__(self, **kwargs): + super(Availability, self).__init__(**kwargs) + self.time_grain = kwargs.get('time_grain', None) + self.retention = kwargs.get('retention', None) + self.blob_duration = kwargs.get('blob_duration', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/availability_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/availability_py3.py new file mode 100644 index 000000000000..874d8878184f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/availability_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Availability(Model): + """Availability of the metric. + + :param time_grain: The time grain of the availability. + :type time_grain: str + :param retention: The retention of the availability. + :type retention: str + :param blob_duration: Duration of the availability blob. + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, time_grain: str=None, retention: str=None, blob_duration: str=None, **kwargs) -> None: + super(Availability, self).__init__(**kwargs) + self.time_grain = time_grain + self.retention = retention + self.blob_duration = blob_duration diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list.py index 7e467a488605..e881208cc43d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list.py @@ -15,7 +15,9 @@ class AvailableProvidersList(Model): """List of available countries with details. - :param countries: List of available countries. + All required parameters must be populated in order to send to Azure. + + :param countries: Required. List of available countries. :type countries: list[~azure.mgmt.network.v2017_10_01.models.AvailableProvidersListCountry] """ @@ -28,6 +30,6 @@ class AvailableProvidersList(Model): 'countries': {'key': 'countries', 'type': '[AvailableProvidersListCountry]'}, } - def __init__(self, countries): - super(AvailableProvidersList, self).__init__() - self.countries = countries + def __init__(self, **kwargs): + super(AvailableProvidersList, self).__init__(**kwargs) + self.countries = kwargs.get('countries', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_city.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_city.py index cfd9fa55e297..5f9aa271b981 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_city.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_city.py @@ -26,7 +26,7 @@ class AvailableProvidersListCity(Model): 'providers': {'key': 'providers', 'type': '[str]'}, } - def __init__(self, city_name=None, providers=None): - super(AvailableProvidersListCity, self).__init__() - self.city_name = city_name - self.providers = providers + def __init__(self, **kwargs): + super(AvailableProvidersListCity, self).__init__(**kwargs) + self.city_name = kwargs.get('city_name', None) + self.providers = kwargs.get('providers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_city_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_city_py3.py new file mode 100644 index 000000000000..888aa46a7cfc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_city_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListCity(Model): + """City or town details. + + :param city_name: The city or town name. + :type city_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + """ + + _attribute_map = { + 'city_name': {'key': 'cityName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + } + + def __init__(self, *, city_name: str=None, providers=None, **kwargs) -> None: + super(AvailableProvidersListCity, self).__init__(**kwargs) + self.city_name = city_name + self.providers = providers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_country.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_country.py index 04113d9c3db0..4338cf03d06c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_country.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_country.py @@ -30,8 +30,8 @@ class AvailableProvidersListCountry(Model): 'states': {'key': 'states', 'type': '[AvailableProvidersListState]'}, } - def __init__(self, country_name=None, providers=None, states=None): - super(AvailableProvidersListCountry, self).__init__() - self.country_name = country_name - self.providers = providers - self.states = states + def __init__(self, **kwargs): + super(AvailableProvidersListCountry, self).__init__(**kwargs) + self.country_name = kwargs.get('country_name', None) + self.providers = kwargs.get('providers', None) + self.states = kwargs.get('states', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_country_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_country_py3.py new file mode 100644 index 000000000000..b4c22566100c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_country_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListCountry(Model): + """Country details. + + :param country_name: The country name. + :type country_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param states: List of available states in the country. + :type states: + list[~azure.mgmt.network.v2017_10_01.models.AvailableProvidersListState] + """ + + _attribute_map = { + 'country_name': {'key': 'countryName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'states': {'key': 'states', 'type': '[AvailableProvidersListState]'}, + } + + def __init__(self, *, country_name: str=None, providers=None, states=None, **kwargs) -> None: + super(AvailableProvidersListCountry, self).__init__(**kwargs) + self.country_name = country_name + self.providers = providers + self.states = states diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_parameters.py index 4eb335e056b6..152b3b787c2b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_parameters.py @@ -33,9 +33,9 @@ class AvailableProvidersListParameters(Model): 'city': {'key': 'city', 'type': 'str'}, } - def __init__(self, azure_locations=None, country=None, state=None, city=None): - super(AvailableProvidersListParameters, self).__init__() - self.azure_locations = azure_locations - self.country = country - self.state = state - self.city = city + def __init__(self, **kwargs): + super(AvailableProvidersListParameters, self).__init__(**kwargs) + self.azure_locations = kwargs.get('azure_locations', None) + self.country = kwargs.get('country', None) + self.state = kwargs.get('state', None) + self.city = kwargs.get('city', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_parameters_py3.py new file mode 100644 index 000000000000..d5c541a7fcb6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_parameters_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListParameters(Model): + """Constraints that determine the list of available Internet service + providers. + + :param azure_locations: A list of Azure regions. + :type azure_locations: list[str] + :param country: The country for available providers list. + :type country: str + :param state: The state for available providers list. + :type state: str + :param city: The city or town for available providers list. + :type city: str + """ + + _attribute_map = { + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__(self, *, azure_locations=None, country: str=None, state: str=None, city: str=None, **kwargs) -> None: + super(AvailableProvidersListParameters, self).__init__(**kwargs) + self.azure_locations = azure_locations + self.country = country + self.state = state + self.city = city diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_py3.py new file mode 100644 index 000000000000..eff1e1401dff --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersList(Model): + """List of available countries with details. + + All required parameters must be populated in order to send to Azure. + + :param countries: Required. List of available countries. + :type countries: + list[~azure.mgmt.network.v2017_10_01.models.AvailableProvidersListCountry] + """ + + _validation = { + 'countries': {'required': True}, + } + + _attribute_map = { + 'countries': {'key': 'countries', 'type': '[AvailableProvidersListCountry]'}, + } + + def __init__(self, *, countries, **kwargs) -> None: + super(AvailableProvidersList, self).__init__(**kwargs) + self.countries = countries diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_state.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_state.py index 13719c3ad064..aead440af259 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_state.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_state.py @@ -30,8 +30,8 @@ class AvailableProvidersListState(Model): 'cities': {'key': 'cities', 'type': '[AvailableProvidersListCity]'}, } - def __init__(self, state_name=None, providers=None, cities=None): - super(AvailableProvidersListState, self).__init__() - self.state_name = state_name - self.providers = providers - self.cities = cities + def __init__(self, **kwargs): + super(AvailableProvidersListState, self).__init__(**kwargs) + self.state_name = kwargs.get('state_name', None) + self.providers = kwargs.get('providers', None) + self.cities = kwargs.get('cities', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_state_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_state_py3.py new file mode 100644 index 000000000000..06730e6428dc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/available_providers_list_state_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListState(Model): + """State details. + + :param state_name: The state name. + :type state_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param cities: List of available cities or towns in the state. + :type cities: + list[~azure.mgmt.network.v2017_10_01.models.AvailableProvidersListCity] + """ + + _attribute_map = { + 'state_name': {'key': 'stateName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'cities': {'key': 'cities', 'type': '[AvailableProvidersListCity]'}, + } + + def __init__(self, *, state_name: str=None, providers=None, cities=None, **kwargs) -> None: + super(AvailableProvidersListState, self).__init__(**kwargs) + self.state_name = state_name + self.providers = providers + self.cities = cities diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_async_operation_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_async_operation_result.py index d8c040288464..df4f285fd405 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_async_operation_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_async_operation_result.py @@ -36,7 +36,7 @@ class AzureAsyncOperationResult(Model): 'error': {'key': 'error', 'type': 'Error'}, } - def __init__(self, status=None, error=None): - super(AzureAsyncOperationResult, self).__init__() - self.status = status - self.error = error + def __init__(self, **kwargs): + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_async_operation_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_async_operation_result_py3.py new file mode 100644 index 000000000000..34f8a01d1bd2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_async_operation_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureAsyncOperationResult(Model): + """The response body contains the status of the specified asynchronous + operation, indicating whether it has succeeded, is in progress, or has + failed. Note that this status is distinct from the HTTP status code + returned for the Get Operation Status operation itself. If the asynchronous + operation succeeded, the response body includes the HTTP status code for + the successful request. If the asynchronous operation failed, the response + body includes the HTTP status code for the failed request and error + information regarding the failure. + + :param status: Status of the Azure async operation. Possible values are: + 'InProgress', 'Succeeded', and 'Failed'. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or + ~azure.mgmt.network.v2017_10_01.models.NetworkOperationStatus + :param error: + :type error: ~azure.mgmt.network.v2017_10_01.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, status=None, error=None, **kwargs) -> None: + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report.py index 1448a70061f9..cf54b3603389 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report.py @@ -15,13 +15,16 @@ class AzureReachabilityReport(Model): """Azure reachability report details. - :param aggregation_level: The aggregation level of Azure reachability - report. Can be Country, State or City. + All required parameters must be populated in order to send to Azure. + + :param aggregation_level: Required. The aggregation level of Azure + reachability report. Can be Country, State or City. :type aggregation_level: str - :param provider_location: + :param provider_location: Required. :type provider_location: ~azure.mgmt.network.v2017_10_01.models.AzureReachabilityReportLocation - :param reachability_report: List of Azure reachability report items. + :param reachability_report: Required. List of Azure reachability report + items. :type reachability_report: list[~azure.mgmt.network.v2017_10_01.models.AzureReachabilityReportItem] """ @@ -38,8 +41,8 @@ class AzureReachabilityReport(Model): 'reachability_report': {'key': 'reachabilityReport', 'type': '[AzureReachabilityReportItem]'}, } - def __init__(self, aggregation_level, provider_location, reachability_report): - super(AzureReachabilityReport, self).__init__() - self.aggregation_level = aggregation_level - self.provider_location = provider_location - self.reachability_report = reachability_report + def __init__(self, **kwargs): + super(AzureReachabilityReport, self).__init__(**kwargs) + self.aggregation_level = kwargs.get('aggregation_level', None) + self.provider_location = kwargs.get('provider_location', None) + self.reachability_report = kwargs.get('reachability_report', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_item.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_item.py index 1bbd0c133e43..6e0c3e8df613 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_item.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_item.py @@ -30,8 +30,8 @@ class AzureReachabilityReportItem(Model): 'latencies': {'key': 'latencies', 'type': '[AzureReachabilityReportLatencyInfo]'}, } - def __init__(self, provider=None, azure_location=None, latencies=None): - super(AzureReachabilityReportItem, self).__init__() - self.provider = provider - self.azure_location = azure_location - self.latencies = latencies + def __init__(self, **kwargs): + super(AzureReachabilityReportItem, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.azure_location = kwargs.get('azure_location', None) + self.latencies = kwargs.get('latencies', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_item_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_item_py3.py new file mode 100644 index 000000000000..83e6ab215827 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_item_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportItem(Model): + """Azure reachability report details for a given provider location. + + :param provider: The Internet service provider. + :type provider: str + :param azure_location: The Azure region. + :type azure_location: str + :param latencies: List of latency details for each of the time series. + :type latencies: + list[~azure.mgmt.network.v2017_10_01.models.AzureReachabilityReportLatencyInfo] + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'azure_location': {'key': 'azureLocation', 'type': 'str'}, + 'latencies': {'key': 'latencies', 'type': '[AzureReachabilityReportLatencyInfo]'}, + } + + def __init__(self, *, provider: str=None, azure_location: str=None, latencies=None, **kwargs) -> None: + super(AzureReachabilityReportItem, self).__init__(**kwargs) + self.provider = provider + self.azure_location = azure_location + self.latencies = latencies diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_latency_info.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_latency_info.py index c4920ffb64be..e5f77641a138 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_latency_info.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_latency_info.py @@ -31,7 +31,7 @@ class AzureReachabilityReportLatencyInfo(Model): 'score': {'key': 'score', 'type': 'int'}, } - def __init__(self, time_stamp=None, score=None): - super(AzureReachabilityReportLatencyInfo, self).__init__() - self.time_stamp = time_stamp - self.score = score + def __init__(self, **kwargs): + super(AzureReachabilityReportLatencyInfo, self).__init__(**kwargs) + self.time_stamp = kwargs.get('time_stamp', None) + self.score = kwargs.get('score', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_latency_info_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_latency_info_py3.py new file mode 100644 index 000000000000..dd9d8fda369c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_latency_info_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportLatencyInfo(Model): + """Details on latency for a time series. + + :param time_stamp: The time stamp. + :type time_stamp: datetime + :param score: The relative latency score between 1 and 100, higher values + indicating a faster connection. + :type score: int + """ + + _validation = { + 'score': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, + 'score': {'key': 'score', 'type': 'int'}, + } + + def __init__(self, *, time_stamp=None, score: int=None, **kwargs) -> None: + super(AzureReachabilityReportLatencyInfo, self).__init__(**kwargs) + self.time_stamp = time_stamp + self.score = score diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_location.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_location.py index 0da63a04e016..76c132e89575 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_location.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_location.py @@ -15,7 +15,9 @@ class AzureReachabilityReportLocation(Model): """Parameters that define a geographic location. - :param country: The name of the country. + All required parameters must be populated in order to send to Azure. + + :param country: Required. The name of the country. :type country: str :param state: The name of the state. :type state: str @@ -33,8 +35,8 @@ class AzureReachabilityReportLocation(Model): 'city': {'key': 'city', 'type': 'str'}, } - def __init__(self, country, state=None, city=None): - super(AzureReachabilityReportLocation, self).__init__() - self.country = country - self.state = state - self.city = city + def __init__(self, **kwargs): + super(AzureReachabilityReportLocation, self).__init__(**kwargs) + self.country = kwargs.get('country', None) + self.state = kwargs.get('state', None) + self.city = kwargs.get('city', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_location_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_location_py3.py new file mode 100644 index 000000000000..1db868eab46f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_location_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportLocation(Model): + """Parameters that define a geographic location. + + All required parameters must be populated in order to send to Azure. + + :param country: Required. The name of the country. + :type country: str + :param state: The name of the state. + :type state: str + :param city: The name of the city or town. + :type city: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__(self, *, country: str, state: str=None, city: str=None, **kwargs) -> None: + super(AzureReachabilityReportLocation, self).__init__(**kwargs) + self.country = country + self.state = state + self.city = city diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_parameters.py index 41de7b1d2955..c2401fd56b8e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_parameters.py @@ -15,16 +15,19 @@ class AzureReachabilityReportParameters(Model): """Geographic and time constraints for Azure reachability report. - :param provider_location: + All required parameters must be populated in order to send to Azure. + + :param provider_location: Required. :type provider_location: ~azure.mgmt.network.v2017_10_01.models.AzureReachabilityReportLocation :param providers: List of Internet service providers. :type providers: list[str] :param azure_locations: Optional Azure regions to scope the query to. :type azure_locations: list[str] - :param start_time: The start time for the Azure reachability report. + :param start_time: Required. The start time for the Azure reachability + report. :type start_time: datetime - :param end_time: The end time for the Azure reachability report. + :param end_time: Required. The end time for the Azure reachability report. :type end_time: datetime """ @@ -42,10 +45,10 @@ class AzureReachabilityReportParameters(Model): 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, } - def __init__(self, provider_location, start_time, end_time, providers=None, azure_locations=None): - super(AzureReachabilityReportParameters, self).__init__() - self.provider_location = provider_location - self.providers = providers - self.azure_locations = azure_locations - self.start_time = start_time - self.end_time = end_time + def __init__(self, **kwargs): + super(AzureReachabilityReportParameters, self).__init__(**kwargs) + self.provider_location = kwargs.get('provider_location', None) + self.providers = kwargs.get('providers', None) + self.azure_locations = kwargs.get('azure_locations', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_parameters_py3.py new file mode 100644 index 000000000000..45edaa2f5eeb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_parameters_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportParameters(Model): + """Geographic and time constraints for Azure reachability report. + + All required parameters must be populated in order to send to Azure. + + :param provider_location: Required. + :type provider_location: + ~azure.mgmt.network.v2017_10_01.models.AzureReachabilityReportLocation + :param providers: List of Internet service providers. + :type providers: list[str] + :param azure_locations: Optional Azure regions to scope the query to. + :type azure_locations: list[str] + :param start_time: Required. The start time for the Azure reachability + report. + :type start_time: datetime + :param end_time: Required. The end time for the Azure reachability report. + :type end_time: datetime + """ + + _validation = { + 'provider_location': {'required': True}, + 'start_time': {'required': True}, + 'end_time': {'required': True}, + } + + _attribute_map = { + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, provider_location, start_time, end_time, providers=None, azure_locations=None, **kwargs) -> None: + super(AzureReachabilityReportParameters, self).__init__(**kwargs) + self.provider_location = provider_location + self.providers = providers + self.azure_locations = azure_locations + self.start_time = start_time + self.end_time = end_time diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_py3.py new file mode 100644 index 000000000000..74dd667fb412 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/azure_reachability_report_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReport(Model): + """Azure reachability report details. + + All required parameters must be populated in order to send to Azure. + + :param aggregation_level: Required. The aggregation level of Azure + reachability report. Can be Country, State or City. + :type aggregation_level: str + :param provider_location: Required. + :type provider_location: + ~azure.mgmt.network.v2017_10_01.models.AzureReachabilityReportLocation + :param reachability_report: Required. List of Azure reachability report + items. + :type reachability_report: + list[~azure.mgmt.network.v2017_10_01.models.AzureReachabilityReportItem] + """ + + _validation = { + 'aggregation_level': {'required': True}, + 'provider_location': {'required': True}, + 'reachability_report': {'required': True}, + } + + _attribute_map = { + 'aggregation_level': {'key': 'aggregationLevel', 'type': 'str'}, + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'reachability_report': {'key': 'reachabilityReport', 'type': '[AzureReachabilityReportItem]'}, + } + + def __init__(self, *, aggregation_level: str, provider_location, reachability_report, **kwargs) -> None: + super(AzureReachabilityReport, self).__init__(**kwargs) + self.aggregation_level = aggregation_level + self.provider_location = provider_location + self.reachability_report = reachability_report diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/backend_address_pool.py index 3e2bf9ab6969..06c7be4f0f53 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/backend_address_pool.py @@ -59,11 +59,11 @@ class BackendAddressPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, provisioning_state=None, name=None, etag=None): - super(BackendAddressPool, self).__init__(id=id) + def __init__(self, **kwargs): + super(BackendAddressPool, self).__init__(**kwargs) self.backend_ip_configurations = None self.load_balancing_rules = None self.outbound_nat_rule = None - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/backend_address_pool_py3.py new file mode 100644 index 000000000000..f8c289700fe2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/backend_address_pool_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class BackendAddressPool(SubResource): + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar backend_ip_configurations: Gets collection of references to IP + addresses defined in network interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: Gets load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_10_01.models.SubResource] + :ivar outbound_nat_rule: Gets outbound rules that use this backend address + pool. + :vartype outbound_nat_rule: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param provisioning_state: Get provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configurations': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'outbound_nat_rule': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'outbound_nat_rule': {'key': 'properties.outboundNatRule', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(BackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = None + self.load_balancing_rules = None + self.outbound_nat_rule = None + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_community.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_community.py index 8275a0e4048c..472a170e9ceb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_community.py @@ -42,11 +42,11 @@ class BGPCommunity(Model): 'service_group': {'key': 'serviceGroup', 'type': 'str'}, } - def __init__(self, service_supported_region=None, community_name=None, community_value=None, community_prefixes=None, is_authorized_to_use=None, service_group=None): - super(BGPCommunity, self).__init__() - self.service_supported_region = service_supported_region - self.community_name = community_name - self.community_value = community_value - self.community_prefixes = community_prefixes - self.is_authorized_to_use = is_authorized_to_use - self.service_group = service_group + def __init__(self, **kwargs): + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = kwargs.get('service_supported_region', None) + self.community_name = kwargs.get('community_name', None) + self.community_value = kwargs.get('community_value', None) + self.community_prefixes = kwargs.get('community_prefixes', None) + self.is_authorized_to_use = kwargs.get('is_authorized_to_use', None) + self.service_group = kwargs.get('service_group', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_community_py3.py new file mode 100644 index 000000000000..86b740c84404 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_community_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BGPCommunity(Model): + """Contains bgp community information offered in Service Community resources. + + :param service_supported_region: The region which the service support. + e.g. For O365, region is Global. + :type service_supported_region: str + :param community_name: The name of the bgp community. e.g. Skype. + :type community_name: str + :param community_value: The value of the bgp community. For more + information: + https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + :type community_value: str + :param community_prefixes: The prefixes that the bgp community contains. + :type community_prefixes: list[str] + :param is_authorized_to_use: Customer is authorized to use bgp community + or not. + :type is_authorized_to_use: bool + :param service_group: The service group of the bgp community contains. + :type service_group: str + """ + + _attribute_map = { + 'service_supported_region': {'key': 'serviceSupportedRegion', 'type': 'str'}, + 'community_name': {'key': 'communityName', 'type': 'str'}, + 'community_value': {'key': 'communityValue', 'type': 'str'}, + 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, + 'is_authorized_to_use': {'key': 'isAuthorizedToUse', 'type': 'bool'}, + 'service_group': {'key': 'serviceGroup', 'type': 'str'}, + } + + def __init__(self, *, service_supported_region: str=None, community_name: str=None, community_value: str=None, community_prefixes=None, is_authorized_to_use: bool=None, service_group: str=None, **kwargs) -> None: + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = service_supported_region + self.community_name = community_name + self.community_value = community_value + self.community_prefixes = community_prefixes + self.is_authorized_to_use = is_authorized_to_use + self.service_group = service_group diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status.py index 5ee0599c38bb..ded51c4b7596 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status.py @@ -59,8 +59,8 @@ class BgpPeerStatus(Model): 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, } - def __init__(self): - super(BgpPeerStatus, self).__init__() + def __init__(self, **kwargs): + super(BgpPeerStatus, self).__init__(**kwargs) self.local_address = None self.neighbor = None self.asn = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status_list_result.py index c987238d1369..dbca93f59003 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status_list_result.py @@ -23,6 +23,6 @@ class BgpPeerStatusListResult(Model): 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, } - def __init__(self, value=None): - super(BgpPeerStatusListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status_list_result_py3.py new file mode 100644 index 000000000000..d614c7f69845 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatusListResult(Model): + """Response for list BGP peer status API service call. + + :param value: List of BGP peers + :type value: list[~azure.mgmt.network.v2017_10_01.models.BgpPeerStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status_py3.py new file mode 100644 index 000000000000..78bd9612e6f6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_peer_status_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatus(Model): + """BGP peer status details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The virtual network gateway's local address + :vartype local_address: str + :ivar neighbor: The remote BGP peer + :vartype neighbor: str + :ivar asn: The autonomous system number of the remote BGP peer + :vartype asn: int + :ivar state: The BGP peer state. Possible values include: 'Unknown', + 'Stopped', 'Idle', 'Connecting', 'Connected' + :vartype state: str or ~azure.mgmt.network.v2017_10_01.models.BgpPeerState + :ivar connected_duration: For how long the peering has been up + :vartype connected_duration: str + :ivar routes_received: The number of routes learned from this peer + :vartype routes_received: long + :ivar messages_sent: The number of BGP messages sent + :vartype messages_sent: long + :ivar messages_received: The number of BGP messages received + :vartype messages_received: long + """ + + _validation = { + 'local_address': {'readonly': True}, + 'neighbor': {'readonly': True}, + 'asn': {'readonly': True}, + 'state': {'readonly': True}, + 'connected_duration': {'readonly': True}, + 'routes_received': {'readonly': True}, + 'messages_sent': {'readonly': True}, + 'messages_received': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'str'}, + 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, + 'routes_received': {'key': 'routesReceived', 'type': 'long'}, + 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, + 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(BgpPeerStatus, self).__init__(**kwargs) + self.local_address = None + self.neighbor = None + self.asn = None + self.state = None + self.connected_duration = None + self.routes_received = None + self.messages_sent = None + self.messages_received = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_service_community.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_service_community.py index d693140557ab..02d7c7859196 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_service_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_service_community.py @@ -50,7 +50,7 @@ class BgpServiceCommunity(Resource): 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, } - def __init__(self, id=None, location=None, tags=None, service_name=None, bgp_communities=None): - super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags) - self.service_name = service_name - self.bgp_communities = bgp_communities + def __init__(self, **kwargs): + super(BgpServiceCommunity, self).__init__(**kwargs) + self.service_name = kwargs.get('service_name', None) + self.bgp_communities = kwargs.get('bgp_communities', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_service_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_service_community_py3.py new file mode 100644 index 000000000000..7fe2b2f4adce --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_service_community_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BgpServiceCommunity(Resource): + """Service Community Properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param service_name: The name of the bgp community. e.g. Skype. + :type service_name: str + :param bgp_communities: Get a list of bgp communities. + :type bgp_communities: + list[~azure.mgmt.network.v2017_10_01.models.BGPCommunity] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, + 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, service_name: str=None, bgp_communities=None, **kwargs) -> None: + super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.service_name = service_name + self.bgp_communities = bgp_communities diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_settings.py index c5730da2e43e..e6e8d1b90aa6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_settings.py @@ -31,8 +31,8 @@ class BgpSettings(Model): 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, } - def __init__(self, asn=None, bgp_peering_address=None, peer_weight=None): - super(BgpSettings, self).__init__() - self.asn = asn - self.bgp_peering_address = bgp_peering_address - self.peer_weight = peer_weight + def __init__(self, **kwargs): + super(BgpSettings, self).__init__(**kwargs) + self.asn = kwargs.get('asn', None) + self.bgp_peering_address = kwargs.get('bgp_peering_address', None) + self.peer_weight = kwargs.get('peer_weight', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_settings_py3.py new file mode 100644 index 000000000000..cb3b3e6795f7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/bgp_settings_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpSettings(Model): + """BGP settings details. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of + this BGP speaker. + :type bgp_peering_address: str + :param peer_weight: The weight added to routes learned from this BGP + speaker. + :type peer_weight: int + """ + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, + } + + def __init__(self, *, asn: int=None, bgp_peering_address: str=None, peer_weight: int=None, **kwargs) -> None: + super(BgpSettings, self).__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + self.peer_weight = peer_weight diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor.py index e9f8dbf5ef64..7ab732cdfe1e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor.py @@ -15,14 +15,16 @@ class ConnectionMonitor(Model): """Parameters that define the operation to create a connection monitor. + All required parameters must be populated in order to send to Azure. + :param location: Connection monitor location. :type location: str :param tags: Connection monitor tags. :type tags: dict[str, str] - :param source: + :param source: Required. :type source: ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorSource - :param destination: + :param destination: Required. :type destination: ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorDestination :param auto_start: Determines if the connection monitor will start @@ -47,11 +49,11 @@ class ConnectionMonitor(Model): 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, } - def __init__(self, source, destination, location=None, tags=None, auto_start=True, monitoring_interval_in_seconds=60): - super(ConnectionMonitor, self).__init__() - self.location = location - self.tags = tags - self.source = source - self.destination = destination - self.auto_start = auto_start - self.monitoring_interval_in_seconds = monitoring_interval_in_seconds + def __init__(self, **kwargs): + super(ConnectionMonitor, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.auto_start = kwargs.get('auto_start', True) + self.monitoring_interval_in_seconds = kwargs.get('monitoring_interval_in_seconds', 60) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_destination.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_destination.py index acaab3299666..9d1e3885cb38 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_destination.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_destination.py @@ -31,8 +31,8 @@ class ConnectionMonitorDestination(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id=None, address=None, port=None): - super(ConnectionMonitorDestination, self).__init__() - self.resource_id = resource_id - self.address = address - self.port = port + def __init__(self, **kwargs): + super(ConnectionMonitorDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_destination_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_destination_py3.py new file mode 100644 index 000000000000..59e7465804ce --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_destination_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorDestination(Model): + """Describes the destination of connection monitor. + + :param resource_id: The ID of the resource used as the destination by + connection monitor. + :type resource_id: str + :param address: Address of the connection monitor destination (IP or + domain name). + :type address: str + :param port: The destination port used by connection monitor. + :type port: int + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str=None, address: str=None, port: int=None, **kwargs) -> None: + super(ConnectionMonitorDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_parameters.py index 20abec6d8092..00145f1b64e7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_parameters.py @@ -15,10 +15,12 @@ class ConnectionMonitorParameters(Model): """Parameters that define the operation to create a connection monitor. - :param source: + All required parameters must be populated in order to send to Azure. + + :param source: Required. :type source: ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorSource - :param destination: + :param destination: Required. :type destination: ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorDestination :param auto_start: Determines if the connection monitor will start @@ -41,9 +43,9 @@ class ConnectionMonitorParameters(Model): 'monitoring_interval_in_seconds': {'key': 'monitoringIntervalInSeconds', 'type': 'int'}, } - def __init__(self, source, destination, auto_start=True, monitoring_interval_in_seconds=60): - super(ConnectionMonitorParameters, self).__init__() - self.source = source - self.destination = destination - self.auto_start = auto_start - self.monitoring_interval_in_seconds = monitoring_interval_in_seconds + def __init__(self, **kwargs): + super(ConnectionMonitorParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.auto_start = kwargs.get('auto_start', True) + self.monitoring_interval_in_seconds = kwargs.get('monitoring_interval_in_seconds', 60) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_parameters_py3.py new file mode 100644 index 000000000000..efba5ebb8ff7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_parameters_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorParameters(Model): + """Parameters that define the operation to create a connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. + :type source: + ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorSource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start + automatically once created. Default value: True . + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + Default value: 60 . + :type monitoring_interval_in_seconds: int + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'monitoringIntervalInSeconds', 'type': 'int'}, + } + + def __init__(self, *, source, destination, auto_start: bool=True, monitoring_interval_in_seconds: int=60, **kwargs) -> None: + super(ConnectionMonitorParameters, self).__init__(**kwargs) + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_py3.py new file mode 100644 index 000000000000..8cbcecfe3b53 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitor(Model): + """Parameters that define the operation to create a connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param location: Connection monitor location. + :type location: str + :param tags: Connection monitor tags. + :type tags: dict[str, str] + :param source: Required. + :type source: + ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorSource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start + automatically once created. Default value: True . + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + Default value: 60 . + :type monitoring_interval_in_seconds: int + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'properties.destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'properties.autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, + } + + def __init__(self, *, source, destination, location: str=None, tags=None, auto_start: bool=True, monitoring_interval_in_seconds: int=60, **kwargs) -> None: + super(ConnectionMonitor, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_query_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_query_result.py index a6a15d611cd8..90ba5d3ea15c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_query_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_query_result.py @@ -24,6 +24,6 @@ class ConnectionMonitorQueryResult(Model): 'states': {'key': 'states', 'type': '[ConnectionStateSnapshot]'}, } - def __init__(self, states=None): - super(ConnectionMonitorQueryResult, self).__init__() - self.states = states + def __init__(self, **kwargs): + super(ConnectionMonitorQueryResult, self).__init__(**kwargs) + self.states = kwargs.get('states', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_query_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_query_result_py3.py new file mode 100644 index 000000000000..34fb39a24eba --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_query_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorQueryResult(Model): + """List of connection states snaphots. + + :param states: Information about connection states. + :type states: + list[~azure.mgmt.network.v2017_10_01.models.ConnectionStateSnapshot] + """ + + _attribute_map = { + 'states': {'key': 'states', 'type': '[ConnectionStateSnapshot]'}, + } + + def __init__(self, *, states=None, **kwargs) -> None: + super(ConnectionMonitorQueryResult, self).__init__(**kwargs) + self.states = states diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_result.py index dbce6bfe7ada..eb87fd864e37 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_result.py @@ -18,6 +18,8 @@ class ConnectionMonitorResult(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar name: Name of the connection monitor. :vartype name: str :ivar id: ID of the connection monitor. @@ -31,10 +33,10 @@ class ConnectionMonitorResult(Model): :type location: str :param tags: Connection monitor tags. :type tags: dict[str, str] - :param source: + :param source: Required. :type source: ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorSource - :param destination: + :param destination: Required. :type destination: ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorDestination :param auto_start: Determines if the connection monitor will start @@ -79,18 +81,18 @@ class ConnectionMonitorResult(Model): 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, } - def __init__(self, source, destination, etag="A unique read-only string that changes whenever the resource is updated.", location=None, tags=None, auto_start=True, monitoring_interval_in_seconds=60, provisioning_state=None, start_time=None, monitoring_status=None): - super(ConnectionMonitorResult, self).__init__() + def __init__(self, **kwargs): + super(ConnectionMonitorResult, self).__init__(**kwargs) self.name = None self.id = None - self.etag = etag + self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") self.type = None - self.location = location - self.tags = tags - self.source = source - self.destination = destination - self.auto_start = auto_start - self.monitoring_interval_in_seconds = monitoring_interval_in_seconds - self.provisioning_state = provisioning_state - self.start_time = start_time - self.monitoring_status = monitoring_status + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.auto_start = kwargs.get('auto_start', True) + self.monitoring_interval_in_seconds = kwargs.get('monitoring_interval_in_seconds', 60) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.start_time = kwargs.get('start_time', None) + self.monitoring_status = kwargs.get('monitoring_status', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_result_py3.py new file mode 100644 index 000000000000..2bcfb0b39d71 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_result_py3.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorResult(Model): + """Information about the connection monitor. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the connection monitor. + :vartype name: str + :ivar id: ID of the connection monitor. + :vartype id: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :ivar type: Connection monitor type. + :vartype type: str + :param location: Connection monitor location. + :type location: str + :param tags: Connection monitor tags. + :type tags: dict[str, str] + :param source: Required. + :type source: + ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorSource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start + automatically once created. Default value: True . + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + Default value: 60 . + :type monitoring_interval_in_seconds: int + :param provisioning_state: The provisioning state of the connection + monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2017_10_01.models.ProvisioningState + :param start_time: The date and time when the connection monitor was + started. + :type start_time: datetime + :param monitoring_status: The monitoring status of the connection monitor. + :type monitoring_status: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'properties.destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'properties.autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + } + + def __init__(self, *, source, destination, etag: str="A unique read-only string that changes whenever the resource is updated.", location: str=None, tags=None, auto_start: bool=True, monitoring_interval_in_seconds: int=60, provisioning_state=None, start_time=None, monitoring_status: str=None, **kwargs) -> None: + super(ConnectionMonitorResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = etag + self.type = None + self.location = location + self.tags = tags + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds + self.provisioning_state = provisioning_state + self.start_time = start_time + self.monitoring_status = monitoring_status diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_source.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_source.py index c80aa3a2676d..1425fa613ce5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_source.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_source.py @@ -15,7 +15,9 @@ class ConnectionMonitorSource(Model): """Describes the source of connection monitor. - :param resource_id: The ID of the resource used as the source by + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource used as the source by connection monitor. :type resource_id: str :param port: The source port used by connection monitor. @@ -31,7 +33,7 @@ class ConnectionMonitorSource(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id, port=None): - super(ConnectionMonitorSource, self).__init__() - self.resource_id = resource_id - self.port = port + def __init__(self, **kwargs): + super(ConnectionMonitorSource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_source_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_source_py3.py new file mode 100644 index 000000000000..4d44fcaf8bf0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_monitor_source_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorSource(Model): + """Describes the source of connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource used as the source by + connection monitor. + :type resource_id: str + :param port: The source port used by connection monitor. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str, port: int=None, **kwargs) -> None: + super(ConnectionMonitorSource, self).__init__(**kwargs) + self.resource_id = resource_id + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_reset_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_reset_shared_key.py index 3338112a7fe7..1ade077795ed 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_reset_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_reset_shared_key.py @@ -15,8 +15,10 @@ class ConnectionResetSharedKey(Model): """The virtual network connection reset shared key. - :param key_length: The virtual network connection reset shared key length, - should between 1 and 128. + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. :type key_length: int """ @@ -28,6 +30,6 @@ class ConnectionResetSharedKey(Model): 'key_length': {'key': 'keyLength', 'type': 'int'}, } - def __init__(self, key_length): - super(ConnectionResetSharedKey, self).__init__() - self.key_length = key_length + def __init__(self, **kwargs): + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = kwargs.get('key_length', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_reset_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_reset_shared_key_py3.py new file mode 100644 index 000000000000..47326d4c2082 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_reset_shared_key_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionResetSharedKey(Model): + """The virtual network connection reset shared key. + + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. + :type key_length: int + """ + + _validation = { + 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, + } + + _attribute_map = { + 'key_length': {'key': 'keyLength', 'type': 'int'}, + } + + def __init__(self, *, key_length: int, **kwargs) -> None: + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = key_length diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_shared_key.py index 2c1b0ed9a914..742f1cb15126 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_shared_key.py @@ -15,7 +15,9 @@ class ConnectionSharedKey(Model): """Response for GetConnectionSharedKey API service call. - :param value: The virtual network connection shared key value. + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. :type value: str """ @@ -27,6 +29,6 @@ class ConnectionSharedKey(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, value): - super(ConnectionSharedKey, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_shared_key_py3.py new file mode 100644 index 000000000000..11b88da35e17 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_shared_key_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionSharedKey(Model): + """Response for GetConnectionSharedKey API service call. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, **kwargs) -> None: + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_state_snapshot.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_state_snapshot.py index d5f6c321e9a9..e4ce11906076 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_state_snapshot.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_state_snapshot.py @@ -47,10 +47,10 @@ class ConnectionStateSnapshot(Model): 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, } - def __init__(self, connection_state=None, start_time=None, end_time=None, evaluation_state=None): - super(ConnectionStateSnapshot, self).__init__() - self.connection_state = connection_state - self.start_time = start_time - self.end_time = end_time - self.evaluation_state = evaluation_state + def __init__(self, **kwargs): + super(ConnectionStateSnapshot, self).__init__(**kwargs) + self.connection_state = kwargs.get('connection_state', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.evaluation_state = kwargs.get('evaluation_state', None) self.hops = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_state_snapshot_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_state_snapshot_py3.py new file mode 100644 index 000000000000..0b9d47ca503e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connection_state_snapshot_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionStateSnapshot(Model): + """Connection state snapshot. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param connection_state: The connection state. Possible values include: + 'Reachable', 'Unreachable', 'Unknown' + :type connection_state: str or + ~azure.mgmt.network.v2017_10_01.models.ConnectionState + :param start_time: The start time of the connection snapshot. + :type start_time: datetime + :param end_time: The end time of the connection snapshot. + :type end_time: datetime + :param evaluation_state: Connectivity analysis evaluation state. Possible + values include: 'NotStarted', 'InProgress', 'Completed' + :type evaluation_state: str or + ~azure.mgmt.network.v2017_10_01.models.EvaluationState + :ivar hops: List of hops between the source and the destination. + :vartype hops: + list[~azure.mgmt.network.v2017_10_01.models.ConnectivityHop] + """ + + _validation = { + 'hops': {'readonly': True}, + } + + _attribute_map = { + 'connection_state': {'key': 'connectionState', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'evaluation_state': {'key': 'evaluationState', 'type': 'str'}, + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + } + + def __init__(self, *, connection_state=None, start_time=None, end_time=None, evaluation_state=None, **kwargs) -> None: + super(ConnectionStateSnapshot, self).__init__(**kwargs) + self.connection_state = connection_state + self.start_time = start_time + self.end_time = end_time + self.evaluation_state = evaluation_state + self.hops = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_destination.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_destination.py index cd0e8818b591..964c425a29d3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_destination.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_destination.py @@ -31,8 +31,8 @@ class ConnectivityDestination(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id=None, address=None, port=None): - super(ConnectivityDestination, self).__init__() - self.resource_id = resource_id - self.address = address - self.port = port + def __init__(self, **kwargs): + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_destination_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_destination_py3.py new file mode 100644 index 000000000000..c51619081ed6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_destination_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityDestination(Model): + """Parameters that define destination of connection. + + :param resource_id: The ID of the resource to which a connection attempt + will be made. + :type resource_id: str + :param address: The IP address or URI the resource to which a connection + attempt will be made. + :type address: str + :param port: Port on which check connectivity will be performed. + :type port: int + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str=None, address: str=None, port: int=None, **kwargs) -> None: + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_hop.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_hop.py index 7ae7006531c3..d6c16aa90ae6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_hop.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_hop.py @@ -51,8 +51,8 @@ class ConnectivityHop(Model): 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, } - def __init__(self): - super(ConnectivityHop, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityHop, self).__init__(**kwargs) self.type = None self.id = None self.address = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_hop_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_hop_py3.py new file mode 100644 index 000000000000..0aa7ad9c2e57 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_hop_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityHop(Model): + """Information about a hop between the source and the destination. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the hop. + :vartype type: str + :ivar id: The ID of the hop. + :vartype id: str + :ivar address: The IP address of the hop. + :vartype address: str + :ivar resource_id: The ID of the resource corresponding to this hop. + :vartype resource_id: str + :ivar next_hop_ids: List of next hop identifiers. + :vartype next_hop_ids: list[str] + :ivar issues: List of issues. + :vartype issues: + list[~azure.mgmt.network.v2017_10_01.models.ConnectivityIssue] + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'address': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'next_hop_ids': {'readonly': True}, + 'issues': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'next_hop_ids': {'key': 'nextHopIds', 'type': '[str]'}, + 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityHop, self).__init__(**kwargs) + self.type = None + self.id = None + self.address = None + self.resource_id = None + self.next_hop_ids = None + self.issues = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_information.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_information.py index 09caa9a5fd52..902469bbb641 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_information.py @@ -57,8 +57,8 @@ class ConnectivityInformation(Model): 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, } - def __init__(self): - super(ConnectivityInformation, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityInformation, self).__init__(**kwargs) self.hops = None self.connection_status = None self.avg_latency_in_ms = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_information_py3.py new file mode 100644 index 000000000000..a7b260ec1d8e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_information_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityInformation(Model): + """Information on the connectivity status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar hops: List of hops between the source and the destination. + :vartype hops: + list[~azure.mgmt.network.v2017_10_01.models.ConnectivityHop] + :ivar connection_status: The connection status. Possible values include: + 'Unknown', 'Connected', 'Disconnected', 'Degraded' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_10_01.models.ConnectionStatus + :ivar avg_latency_in_ms: Average latency in milliseconds. + :vartype avg_latency_in_ms: int + :ivar min_latency_in_ms: Minimum latency in milliseconds. + :vartype min_latency_in_ms: int + :ivar max_latency_in_ms: Maximum latency in milliseconds. + :vartype max_latency_in_ms: int + :ivar probes_sent: Total number of probes sent. + :vartype probes_sent: int + :ivar probes_failed: Number of failed probes. + :vartype probes_failed: int + """ + + _validation = { + 'hops': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'avg_latency_in_ms': {'readonly': True}, + 'min_latency_in_ms': {'readonly': True}, + 'max_latency_in_ms': {'readonly': True}, + 'probes_sent': {'readonly': True}, + 'probes_failed': {'readonly': True}, + } + + _attribute_map = { + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, + 'probes_sent': {'key': 'probesSent', 'type': 'int'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityInformation, self).__init__(**kwargs) + self.hops = None + self.connection_status = None + self.avg_latency_in_ms = None + self.min_latency_in_ms = None + self.max_latency_in_ms = None + self.probes_sent = None + self.probes_failed = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_issue.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_issue.py index 3ff451e35605..79fe0081503f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_issue.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_issue.py @@ -47,8 +47,8 @@ class ConnectivityIssue(Model): 'context': {'key': 'context', 'type': '[{str}]'}, } - def __init__(self): - super(ConnectivityIssue, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityIssue, self).__init__(**kwargs) self.origin = None self.severity = None self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_issue_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_issue_py3.py new file mode 100644 index 000000000000..563dec4a3d92 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_issue_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityIssue(Model): + """Information about an issue encountered in the process of checking for + connectivity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar origin: The origin of the issue. Possible values include: 'Local', + 'Inbound', 'Outbound' + :vartype origin: str or ~azure.mgmt.network.v2017_10_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: + 'Error', 'Warning' + :vartype severity: str or ~azure.mgmt.network.v2017_10_01.models.Severity + :ivar type: The type of issue. Possible values include: 'Unknown', + 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', + 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform' + :vartype type: str or ~azure.mgmt.network.v2017_10_01.models.IssueType + :ivar context: Provides additional context on the issue. + :vartype context: list[dict[str, str]] + """ + + _validation = { + 'origin': {'readonly': True}, + 'severity': {'readonly': True}, + 'type': {'readonly': True}, + 'context': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'context': {'key': 'context', 'type': '[{str}]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityIssue, self).__init__(**kwargs) + self.origin = None + self.severity = None + self.type = None + self.context = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_parameters.py index c1cab3b4ea34..f8bf65e1bc40 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_parameters.py @@ -15,9 +15,11 @@ class ConnectivityParameters(Model): """Parameters that determine how the connectivity check will be performed. - :param source: + All required parameters must be populated in order to send to Azure. + + :param source: Required. :type source: ~azure.mgmt.network.v2017_10_01.models.ConnectivitySource - :param destination: + :param destination: Required. :type destination: ~azure.mgmt.network.v2017_10_01.models.ConnectivityDestination """ @@ -32,7 +34,7 @@ class ConnectivityParameters(Model): 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, } - def __init__(self, source, destination): - super(ConnectivityParameters, self).__init__() - self.source = source - self.destination = destination + def __init__(self, **kwargs): + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_parameters_py3.py new file mode 100644 index 000000000000..65ee8a19732d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_parameters_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityParameters(Model): + """Parameters that determine how the connectivity check will be performed. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. + :type source: ~azure.mgmt.network.v2017_10_01.models.ConnectivitySource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2017_10_01.models.ConnectivityDestination + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectivitySource'}, + 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, + } + + def __init__(self, *, source, destination, **kwargs) -> None: + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = source + self.destination = destination diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_source.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_source.py index c42bfc0aa09d..3fd82793f8d7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_source.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_source.py @@ -15,8 +15,10 @@ class ConnectivitySource(Model): """Parameters that define the source of the connection. - :param resource_id: The ID of the resource from which a connectivity check - will be initiated. + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. :type resource_id: str :param port: The source port from which a connectivity check will be performed. @@ -32,7 +34,7 @@ class ConnectivitySource(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id, port=None): - super(ConnectivitySource, self).__init__() - self.resource_id = resource_id - self.port = port + def __init__(self, **kwargs): + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_source_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_source_py3.py new file mode 100644 index 000000000000..f7833d1bef76 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/connectivity_source_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivitySource(Model): + """Parameters that define the source of the connection. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. + :type resource_id: str + :param port: The source port from which a connectivity check will be + performed. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str, port: int=None, **kwargs) -> None: + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = resource_id + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dhcp_options.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dhcp_options.py index 8744ba6fc9b1..93b68a7f037c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dhcp_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dhcp_options.py @@ -25,6 +25,6 @@ class DhcpOptions(Model): 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, } - def __init__(self, dns_servers=None): - super(DhcpOptions, self).__init__() - self.dns_servers = dns_servers + def __init__(self, **kwargs): + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dhcp_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dhcp_options_py3.py new file mode 100644 index 000000000000..7dc4651973a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dhcp_options_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DhcpOptions(Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in + the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + options. + + :param dns_servers: The list of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = dns_servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dimension.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dimension.py index f18204215221..e9c8cd977a54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dimension.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dimension.py @@ -29,8 +29,8 @@ class Dimension(Model): 'internal_name': {'key': 'internalName', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, internal_name=None): - super(Dimension, self).__init__() - self.name = name - self.display_name = display_name - self.internal_name = internal_name + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.internal_name = kwargs.get('internal_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dimension_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dimension_py3.py new file mode 100644 index 000000000000..20743b6424c1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dimension_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dimension(Model): + """Dimension of the metric. + + :param name: The name of the dimension. + :type name: str + :param display_name: The display name of the dimension. + :type display_name: str + :param internal_name: The internal name of the dimension. + :type internal_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, internal_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dns_name_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dns_name_availability_result.py index 15a0238e49a7..86ba19eb407b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dns_name_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dns_name_availability_result.py @@ -23,6 +23,6 @@ class DnsNameAvailabilityResult(Model): 'available': {'key': 'available', 'type': 'bool'}, } - def __init__(self, available=None): - super(DnsNameAvailabilityResult, self).__init__() - self.available = available + def __init__(self, **kwargs): + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dns_name_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dns_name_availability_result_py3.py new file mode 100644 index 000000000000..de0117c27715 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/dns_name_availability_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DnsNameAvailabilityResult(Model): + """Response for the CheckDnsNameAvailability API service call. + + :param available: Domain availability (True/False). + :type available: bool + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + } + + def __init__(self, *, available: bool=None, **kwargs) -> None: + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = available diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group.py index 8cb4f05b9493..52edd4b129ec 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group.py @@ -37,9 +37,9 @@ class EffectiveNetworkSecurityGroup(Model): 'tag_map': {'key': 'tagMap', 'type': '{[str]}'}, } - def __init__(self, network_security_group=None, association=None, effective_security_rules=None, tag_map=None): - super(EffectiveNetworkSecurityGroup, self).__init__() - self.network_security_group = network_security_group - self.association = association - self.effective_security_rules = effective_security_rules - self.tag_map = tag_map + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = kwargs.get('network_security_group', None) + self.association = kwargs.get('association', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) + self.tag_map = kwargs.get('tag_map', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_association.py index 89d7dffdfe9c..9b4e02c4568e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_association.py @@ -27,7 +27,7 @@ class EffectiveNetworkSecurityGroupAssociation(Model): 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, } - def __init__(self, subnet=None, network_interface=None): - super(EffectiveNetworkSecurityGroupAssociation, self).__init__() - self.subnet = subnet - self.network_interface = network_interface + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.network_interface = kwargs.get('network_interface', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_association_py3.py new file mode 100644 index 000000000000..bd4f6fe2d007 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_association_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupAssociation(Model): + """The effective network security group association. + + :param subnet: The ID of the subnet if assigned. + :type subnet: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: + ~azure.mgmt.network.v2017_10_01.models.SubResource + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, + } + + def __init__(self, *, subnet=None, network_interface=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = subnet + self.network_interface = network_interface diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_list_result.py index 9f2f2b313cca..717e3b712639 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_list_result.py @@ -34,7 +34,7 @@ class EffectiveNetworkSecurityGroupListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None): - super(EffectiveNetworkSecurityGroupListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_list_result_py3.py new file mode 100644 index 000000000000..c13fcc79aac9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_list_result_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupListResult(Model): + """Response for list effective network security groups API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective network security groups. + :type value: + list[~azure.mgmt.network.v2017_10_01.models.EffectiveNetworkSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_py3.py new file mode 100644 index 000000000000..5e7af84af32e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_group_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroup(Model): + """Effective network security group. + + :param network_security_group: The ID of network security group that is + applied. + :type network_security_group: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param association: Associated resources. + :type association: + ~azure.mgmt.network.v2017_10_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2017_10_01.models.EffectiveNetworkSecurityRule] + :param tag_map: Mapping of tags to list of IP Addresses included within + the tag. + :type tag_map: dict[str, list[str]] + """ + + _attribute_map = { + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, + 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + 'tag_map': {'key': 'tagMap', 'type': '{[str]}'}, + } + + def __init__(self, *, network_security_group=None, association=None, effective_security_rules=None, tag_map=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = network_security_group + self.association = association + self.effective_security_rules = effective_security_rules + self.tag_map = tag_map diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_rule.py index db0d917f2c70..e0319dccd265 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_rule.py @@ -82,20 +82,20 @@ class EffectiveNetworkSecurityRule(Model): 'direction': {'key': 'direction', 'type': 'str'}, } - def __init__(self, name=None, protocol=None, source_port_range=None, destination_port_range=None, source_port_ranges=None, destination_port_ranges=None, source_address_prefix=None, destination_address_prefix=None, source_address_prefixes=None, destination_address_prefixes=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority=None, direction=None): - super(EffectiveNetworkSecurityRule, self).__init__() - self.name = name - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_port_ranges = source_port_ranges - self.destination_port_ranges = destination_port_ranges - self.source_address_prefix = source_address_prefix - self.destination_address_prefix = destination_address_prefix - self.source_address_prefixes = source_address_prefixes - self.destination_address_prefixes = destination_address_prefixes - self.expanded_source_address_prefix = expanded_source_address_prefix - self.expanded_destination_address_prefix = expanded_destination_address_prefix - self.access = access - self.priority = priority - self.direction = direction + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.expanded_source_address_prefix = kwargs.get('expanded_source_address_prefix', None) + self.expanded_destination_address_prefix = kwargs.get('expanded_destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_rule_py3.py new file mode 100644 index 000000000000..a58dc9f7795f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_network_security_rule_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityRule(Model): + """Effective network security rules. + + :param name: The name of the security rule specified by the user (if + created by the user). + :type name: str + :param protocol: The network protocol this rule applies to. Possible + values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', + 'Udp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_10_01.models.EffectiveSecurityRuleProtocol + :param source_port_range: The source port or range. + :type source_port_range: str + :param destination_port_range: The destination port or range. + :type destination_port_range: str + :param source_port_ranges: The source port ranges. Expected values include + a single integer between 0 and 65535, a range using '-' as seperator (e.g. + 100-400), or an asterix (*) + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. Expected + values include a single integer between 0 and 65535, a range using '-' as + seperator (e.g. 100-400), or an asterix (*) + :type destination_port_ranges: list[str] + :param source_address_prefix: The source address prefix. + :type source_address_prefix: str + :param destination_address_prefix: The destination address prefix. + :type destination_address_prefix: str + :param source_address_prefixes: The source address prefixes. Expected + values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type source_address_prefixes: list[str] + :param destination_address_prefixes: The destination address prefixes. + Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type destination_address_prefixes: list[str] + :param expanded_source_address_prefix: The expanded source address prefix. + :type expanded_source_address_prefix: list[str] + :param expanded_destination_address_prefix: Expanded destination address + prefix. + :type expanded_destination_address_prefix: list[str] + :param access: Whether network traffic is allowed or denied. Possible + values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or + ~azure.mgmt.network.v2017_10_01.models.SecurityRuleAccess + :param priority: The priority of the rule. + :type priority: int + :param direction: The direction of the rule. Possible values are: 'Inbound + and Outbound'. Possible values include: 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2017_10_01.models.SecurityRuleDirection + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'source_port_ranges': {'key': 'sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'destinationPortRanges', 'type': '[str]'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'sourceAddressPrefixes', 'type': '[str]'}, + 'destination_address_prefixes': {'key': 'destinationAddressPrefixes', 'type': '[str]'}, + 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, + 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, + 'access': {'key': 'access', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, protocol=None, source_port_range: str=None, destination_port_range: str=None, source_port_ranges=None, destination_port_ranges=None, source_address_prefix: str=None, destination_address_prefix: str=None, source_address_prefixes=None, destination_address_prefixes=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority: int=None, direction=None, **kwargs) -> None: + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = name + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.source_address_prefixes = source_address_prefixes + self.destination_address_prefixes = destination_address_prefixes + self.expanded_source_address_prefix = expanded_source_address_prefix + self.expanded_destination_address_prefix = expanded_destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route.py index 2be46c9c4aec..9f1aeb7af1f2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route.py @@ -50,11 +50,11 @@ class EffectiveRoute(Model): 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, } - def __init__(self, name=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None): - super(EffectiveRoute, self).__init__() - self.name = name - self.source = source - self.state = state - self.address_prefix = address_prefix - self.next_hop_ip_address = next_hop_ip_address - self.next_hop_type = next_hop_type + def __init__(self, **kwargs): + super(EffectiveRoute, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.next_hop_type = kwargs.get('next_hop_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route_list_result.py index 03778f406106..f4981f8c4f46 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route_list_result.py @@ -33,7 +33,7 @@ class EffectiveRouteListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None): - super(EffectiveRouteListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route_list_result_py3.py new file mode 100644 index 000000000000..54aeeb4343f9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route_list_result_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRouteListResult(Model): + """Response for list effective route API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective routes. + :type value: list[~azure.mgmt.network.v2017_10_01.models.EffectiveRoute] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route_py3.py new file mode 100644 index 000000000000..68dca1bf4c57 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/effective_route_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRoute(Model): + """Effective Route. + + :param name: The name of the user defined route. This is optional. + :type name: str + :param source: Who created the route. Possible values are: 'Unknown', + 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: + 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' + :type source: str or + ~azure.mgmt.network.v2017_10_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values are: 'Active' + and 'Invalid'. Possible values include: 'Active', 'Invalid' + :type state: str or + ~azure.mgmt.network.v2017_10_01.models.EffectiveRouteState + :param address_prefix: The address prefixes of the effective routes in + CIDR notation. + :type address_prefix: list[str] + :param next_hop_ip_address: The IP address of the next hop of the + effective route. + :type next_hop_ip_address: list[str] + :param next_hop_type: The type of Azure hop the packet should be sent to. + Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_10_01.models.RouteNextHopType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None, **kwargs) -> None: + super(EffectiveRoute, self).__init__(**kwargs) + self.name = name + self.source = source + self.state = state + self.address_prefix = address_prefix + self.next_hop_ip_address = next_hop_ip_address + self.next_hop_type = next_hop_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/endpoint_service_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/endpoint_service_result.py index 9098a41ff164..9ca0e203a834 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/endpoint_service_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/endpoint_service_result.py @@ -37,7 +37,7 @@ class EndpointServiceResult(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None): - super(EndpointServiceResult, self).__init__(id=id) + def __init__(self, **kwargs): + super(EndpointServiceResult, self).__init__(**kwargs) self.name = None self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/endpoint_service_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/endpoint_service_result_py3.py new file mode 100644 index 000000000000..c45df94a6533 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/endpoint_service_result_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class EndpointServiceResult(SubResource): + """Endpoint service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Name of the endpoint service. + :vartype name: str + :ivar type: Type of the endpoint service. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(EndpointServiceResult, self).__init__(id=id, **kwargs) + self.name = None + self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error.py index 9ff1ae2f35d2..3daf52faf40d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error.py @@ -35,10 +35,10 @@ class Error(Model): 'inner_error': {'key': 'innerError', 'type': 'str'}, } - def __init__(self, code=None, message=None, target=None, details=None, inner_error=None): - super(Error, self).__init__() - self.code = code - self.message = message - self.target = target - self.details = details - self.inner_error = inner_error + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error_details.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error_details.py index 40bea00aa2fb..a8c4da6ba955 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error_details.py @@ -29,8 +29,8 @@ class ErrorDetails(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ErrorDetails, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error_details_py3.py new file mode 100644 index 000000000000..d791f0895345 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error_details_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """ErrorDetails. + + :param code: + :type code: str + :param target: + :type target: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error_py3.py new file mode 100644 index 000000000000..1fb450b982d0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(Model): + """Error. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.network.v2017_10_01.models.ErrorDetails] + :param inner_error: + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, inner_error: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit.py index 49019bfcdc92..291f39681fe5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit.py @@ -91,17 +91,17 @@ class ExpressRouteCircuit(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, allow_classic_operations=None, circuit_provisioning_state=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key=None, service_provider_notes=None, service_provider_properties=None, provisioning_state=None, gateway_manager_etag=None): - super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.allow_classic_operations = allow_classic_operations - self.circuit_provisioning_state = circuit_provisioning_state - self.service_provider_provisioning_state = service_provider_provisioning_state - self.authorizations = authorizations - self.peerings = peerings - self.service_key = service_key - self.service_provider_notes = service_provider_notes - self.service_provider_properties = service_provider_properties - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag + def __init__(self, **kwargs): + super(ExpressRouteCircuit, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.allow_classic_operations = kwargs.get('allow_classic_operations', None) + self.circuit_provisioning_state = kwargs.get('circuit_provisioning_state', None) + self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) + self.authorizations = kwargs.get('authorizations', None) + self.peerings = kwargs.get('peerings', None) + self.service_key = kwargs.get('service_key', None) + self.service_provider_notes = kwargs.get('service_provider_notes', None) + self.service_provider_properties = kwargs.get('service_provider_properties', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_arp_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_arp_table.py index ace325747ee5..826796619769 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_arp_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_arp_table.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitArpTable(Model): 'mac_address': {'key': 'macAddress', 'type': 'str'}, } - def __init__(self, age=None, interface=None, ip_address=None, mac_address=None): - super(ExpressRouteCircuitArpTable, self).__init__() - self.age = age - self.interface = interface - self.ip_address = ip_address - self.mac_address = mac_address + def __init__(self, **kwargs): + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = kwargs.get('age', None) + self.interface = kwargs.get('interface', None) + self.ip_address = kwargs.get('ip_address', None) + self.mac_address = kwargs.get('mac_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_arp_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_arp_table_py3.py new file mode 100644 index 000000000000..4401108c6001 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_arp_table_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitArpTable(Model): + """The ARP table associated with the ExpressRouteCircuit. + + :param age: Age + :type age: int + :param interface: Interface + :type interface: str + :param ip_address: The IP address. + :type ip_address: str + :param mac_address: The MAC address. + :type mac_address: str + """ + + _attribute_map = { + 'age': {'key': 'age', 'type': 'int'}, + 'interface': {'key': 'interface', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, *, age: int=None, interface: str=None, ip_address: str=None, mac_address: str=None, **kwargs) -> None: + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = age + self.interface = interface + self.ip_address = ip_address + self.mac_address = mac_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_authorization.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_authorization.py index 9a90a905ee9b..13e640ebe955 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_authorization.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_authorization.py @@ -51,10 +51,10 @@ class ExpressRouteCircuitAuthorization(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, authorization_key=None, authorization_use_status=None, provisioning_state=None, name=None): - super(ExpressRouteCircuitAuthorization, self).__init__(id=id) - self.authorization_key = authorization_key - self.authorization_use_status = authorization_use_status - self.provisioning_state = provisioning_state - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitAuthorization, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.authorization_use_status = kwargs.get('authorization_use_status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_authorization_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_authorization_py3.py new file mode 100644 index 000000000000..5faa5656c917 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_authorization_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param authorization_use_status: AuthorizationUseStatus. Possible values + are: 'Available' and 'InUse'. Possible values include: 'Available', + 'InUse' + :type authorization_use_status: str or + ~azure.mgmt.network.v2017_10_01.models.AuthorizationUseStatus + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, authorization_key: str=None, authorization_use_status=None, provisioning_state: str=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitAuthorization, self).__init__(id=id, **kwargs) + self.authorization_key = authorization_key + self.authorization_use_status = authorization_use_status + self.provisioning_state = provisioning_state + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering.py index fb1e847c5585..6f23d20bff88 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering.py @@ -101,24 +101,24 @@ class ExpressRouteCircuitPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, peering_type=None, state=None, azure_asn=None, peer_asn=None, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, primary_azure_port=None, secondary_azure_port=None, shared_key=None, vlan_id=None, microsoft_peering_config=None, stats=None, provisioning_state=None, gateway_manager_etag=None, last_modified_by=None, route_filter=None, ipv6_peering_config=None, name=None): - super(ExpressRouteCircuitPeering, self).__init__(id=id) - self.peering_type = peering_type - self.state = state - self.azure_asn = azure_asn - self.peer_asn = peer_asn - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.primary_azure_port = primary_azure_port - self.secondary_azure_port = secondary_azure_port - self.shared_key = shared_key - self.vlan_id = vlan_id - self.microsoft_peering_config = microsoft_peering_config - self.stats = stats - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag - self.last_modified_by = last_modified_by - self.route_filter = route_filter - self.ipv6_peering_config = ipv6_peering_config - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeering, self).__init__(**kwargs) + self.peering_type = kwargs.get('peering_type', None) + self.state = kwargs.get('state', None) + self.azure_asn = kwargs.get('azure_asn', None) + self.peer_asn = kwargs.get('peer_asn', None) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.primary_azure_port = kwargs.get('primary_azure_port', None) + self.secondary_azure_port = kwargs.get('secondary_azure_port', None) + self.shared_key = kwargs.get('shared_key', None) + self.vlan_id = kwargs.get('vlan_id', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.stats = kwargs.get('stats', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.route_filter = kwargs.get('route_filter', None) + self.ipv6_peering_config = kwargs.get('ipv6_peering_config', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering_config.py index 7dcc918be5cd..0b46aac29615 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering_config.py @@ -45,11 +45,11 @@ class ExpressRouteCircuitPeeringConfig(Model): 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, } - def __init__(self, advertised_public_prefixes=None, advertised_communities=None, advertised_public_prefixes_state=None, legacy_mode=None, customer_asn=None, routing_registry_name=None): - super(ExpressRouteCircuitPeeringConfig, self).__init__() - self.advertised_public_prefixes = advertised_public_prefixes - self.advertised_communities = advertised_communities - self.advertised_public_prefixes_state = advertised_public_prefixes_state - self.legacy_mode = legacy_mode - self.customer_asn = customer_asn - self.routing_registry_name = routing_registry_name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = kwargs.get('advertised_public_prefixes', None) + self.advertised_communities = kwargs.get('advertised_communities', None) + self.advertised_public_prefixes_state = kwargs.get('advertised_public_prefixes_state', None) + self.legacy_mode = kwargs.get('legacy_mode', None) + self.customer_asn = kwargs.get('customer_asn', None) + self.routing_registry_name = kwargs.get('routing_registry_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..e215423ddba7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering_config_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitPeeringConfig(Model): + """Specifies the peering configuration. + + :param advertised_public_prefixes: The reference of + AdvertisedPublicPrefixes. + :type advertised_public_prefixes: list[str] + :param advertised_communities: The communities of bgp peering. Spepcified + for microsoft peering + :type advertised_communities: list[str] + :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of + the Peering resource. Possible values are 'NotConfigured', 'Configuring', + 'Configured', and 'ValidationNeeded'. Possible values include: + 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' + :type advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :param legacy_mode: The legacy mode of the peering. + :type legacy_mode: int + :param customer_asn: The CustomerASN of the peering. + :type customer_asn: int + :param routing_registry_name: The RoutingRegistryName of the + configuration. + :type routing_registry_name: str + """ + + _attribute_map = { + 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, + 'advertised_communities': {'key': 'advertisedCommunities', 'type': '[str]'}, + 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, + 'legacy_mode': {'key': 'legacyMode', 'type': 'int'}, + 'customer_asn': {'key': 'customerASN', 'type': 'int'}, + 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, + } + + def __init__(self, *, advertised_public_prefixes=None, advertised_communities=None, advertised_public_prefixes_state=None, legacy_mode: int=None, customer_asn: int=None, routing_registry_name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = advertised_public_prefixes + self.advertised_communities = advertised_communities + self.advertised_public_prefixes_state = advertised_public_prefixes_state + self.legacy_mode = legacy_mode + self.customer_asn = customer_asn + self.routing_registry_name = routing_registry_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering_py3.py new file mode 100644 index 000000000000..e182d310bb1c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_peering_py3.py @@ -0,0 +1,124 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitPeering(SubResource): + """Peering in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param peering_type: The PeeringType. Possible values are: + 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. + Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + 'MicrosoftPeering' + :type peering_type: str or + ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeeringType + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeeringState + :param azure_asn: The Azure ASN. + :type azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: long + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param primary_azure_port: The primary port. + :type primary_azure_port: str + :param secondary_azure_port: The secondary port. + :type secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeeringConfig + :param stats: Gets peering stats. + :type stats: + ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitStats + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :param last_modified_by: Gets whether the provider or the customer last + modified the peering. + :type last_modified_by: str + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2017_10_01.models.RouteFilter + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2017_10_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'peer_asn': {'maximum': 4294967295, 'minimum': 1}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'long'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'route_filter': {'key': 'properties.routeFilter', 'type': 'RouteFilter'}, + 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, peering_type=None, state=None, azure_asn: int=None, peer_asn: int=None, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, primary_azure_port: str=None, secondary_azure_port: str=None, shared_key: str=None, vlan_id: int=None, microsoft_peering_config=None, stats=None, provisioning_state: str=None, gateway_manager_etag: str=None, last_modified_by: str=None, route_filter=None, ipv6_peering_config=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeering, self).__init__(id=id, **kwargs) + self.peering_type = peering_type + self.state = state + self.azure_asn = azure_asn + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = primary_azure_port + self.secondary_azure_port = secondary_azure_port + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.stats = stats + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.last_modified_by = last_modified_by + self.route_filter = route_filter + self.ipv6_peering_config = ipv6_peering_config + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_py3.py new file mode 100644 index 000000000000..e768d1dc401e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteCircuit(Resource): + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The SKU. + :type sku: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitSku + :param allow_classic_operations: Allow classic operations + :type allow_classic_operations: bool + :param circuit_provisioning_state: The CircuitProvisioningState state of + the resource. + :type circuit_provisioning_state: str + :param service_provider_provisioning_state: The + ServiceProviderProvisioningState state of the resource. Possible values + are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + 'Deprovisioning' + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2017_10_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: + list[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeering] + :param service_key: The ServiceKey. + :type service_key: str + :param service_provider_notes: The ServiceProviderNotes. + :type service_provider_notes: str + :param service_provider_properties: The ServiceProviderProperties. + :type service_provider_properties: + ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitServiceProviderProperties + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, + 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, + 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, allow_classic_operations: bool=None, circuit_provisioning_state: str=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key: str=None, service_provider_notes: str=None, service_provider_properties=None, provisioning_state: str=None, gateway_manager_etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.allow_classic_operations = allow_classic_operations + self.circuit_provisioning_state = circuit_provisioning_state + self.service_provider_provisioning_state = service_provider_provisioning_state + self.authorizations = authorizations + self.peerings = peerings + self.service_key = service_key + self.service_provider_notes = service_provider_notes + self.service_provider_properties = service_provider_properties + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table.py index 804d29a2f9bb..7517e9867cfb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table.py @@ -35,10 +35,10 @@ class ExpressRouteCircuitRoutesTable(Model): 'path': {'key': 'path', 'type': 'str'}, } - def __init__(self, network=None, next_hop=None, loc_prf=None, weight=None, path=None): - super(ExpressRouteCircuitRoutesTable, self).__init__() - self.network = network - self.next_hop = next_hop - self.loc_prf = loc_prf - self.weight = weight - self.path = path + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = kwargs.get('network', None) + self.next_hop = kwargs.get('next_hop', None) + self.loc_prf = kwargs.get('loc_prf', None) + self.weight = kwargs.get('weight', None) + self.path = kwargs.get('path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table_py3.py new file mode 100644 index 000000000000..38ea85cf642d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTable(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param network: network + :type network: str + :param next_hop: nextHop + :type next_hop: str + :param loc_prf: locPrf + :type loc_prf: str + :param weight: weight. + :type weight: int + :param path: path + :type path: str + """ + + _attribute_map = { + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'loc_prf': {'key': 'locPrf', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, *, network: str=None, next_hop: str=None, loc_prf: str=None, weight: int=None, path: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = network + self.next_hop = next_hop + self.loc_prf = loc_prf + self.weight = weight + self.path = path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table_summary.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table_summary.py index 6f5f89764dd4..577c3c2edd45 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table_summary.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table_summary.py @@ -37,10 +37,10 @@ class ExpressRouteCircuitRoutesTableSummary(Model): 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, } - def __init__(self, neighbor=None, v=None, as_property=None, up_down=None, state_pfx_rcd=None): - super(ExpressRouteCircuitRoutesTableSummary, self).__init__() - self.neighbor = neighbor - self.v = v - self.as_property = as_property - self.up_down = up_down - self.state_pfx_rcd = state_pfx_rcd + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = kwargs.get('neighbor', None) + self.v = kwargs.get('v', None) + self.as_property = kwargs.get('as_property', None) + self.up_down = kwargs.get('up_down', None) + self.state_pfx_rcd = kwargs.get('state_pfx_rcd', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table_summary_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table_summary_py3.py new file mode 100644 index 000000000000..e18d0051d218 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_routes_table_summary_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTableSummary(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: Neighbor + :type neighbor: str + :param v: BGP version number spoken to the neighbor. + :type v: int + :param as_property: Autonomous system number. + :type as_property: int + :param up_down: The length of time that the BGP session has been in the + Established state, or the current status if not in the Established state. + :type up_down: str + :param state_pfx_rcd: Current state of the BGP session, and the number of + prefixes that have been received from a neighbor or peer group. + :type state_pfx_rcd: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'v': {'key': 'v', 'type': 'int'}, + 'as_property': {'key': 'as', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, + } + + def __init__(self, *, neighbor: str=None, v: int=None, as_property: int=None, up_down: str=None, state_pfx_rcd: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = neighbor + self.v = v + self.as_property = as_property + self.up_down = up_down + self.state_pfx_rcd = state_pfx_rcd diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_service_provider_properties.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_service_provider_properties.py index 7a6b4ba96061..c51e6d8d653b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_service_provider_properties.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_service_provider_properties.py @@ -29,8 +29,8 @@ class ExpressRouteCircuitServiceProviderProperties(Model): 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, } - def __init__(self, service_provider_name=None, peering_location=None, bandwidth_in_mbps=None): - super(ExpressRouteCircuitServiceProviderProperties, self).__init__() - self.service_provider_name = service_provider_name - self.peering_location = peering_location - self.bandwidth_in_mbps = bandwidth_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = kwargs.get('service_provider_name', None) + self.peering_location = kwargs.get('peering_location', None) + self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_service_provider_properties_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_service_provider_properties_py3.py new file mode 100644 index 000000000000..ea701a54c3fe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_service_provider_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitServiceProviderProperties(Model): + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :param service_provider_name: The serviceProviderName. + :type service_provider_name: str + :param peering_location: The peering location. + :type peering_location: str + :param bandwidth_in_mbps: The BandwidthInMbps. + :type bandwidth_in_mbps: int + """ + + _attribute_map = { + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + } + + def __init__(self, *, service_provider_name: str=None, peering_location: str=None, bandwidth_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = service_provider_name + self.peering_location = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_sku.py index efacb32005b2..05b7f268760f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_sku.py @@ -33,8 +33,8 @@ class ExpressRouteCircuitSku(Model): 'family': {'key': 'family', 'type': 'str'}, } - def __init__(self, name=None, tier=None, family=None): - super(ExpressRouteCircuitSku, self).__init__() - self.name = name - self.tier = tier - self.family = family + def __init__(self, **kwargs): + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.family = kwargs.get('family', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_sku_py3.py new file mode 100644 index 000000000000..62f97a2fb060 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_sku_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitSku(Model): + """Contains SKU in an ExpressRouteCircuit. + + :param name: The name of the SKU. + :type name: str + :param tier: The tier of the SKU. Possible values are 'Standard' and + 'Premium'. Possible values include: 'Standard', 'Premium' + :type tier: str or + ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values are: 'UnlimitedData' + and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' + :type family: str or + ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, tier=None, family=None, **kwargs) -> None: + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.family = family diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_stats.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_stats.py index e26f6f7d2f74..41c45ae2b19a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_stats.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_stats.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitStats(Model): 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, } - def __init__(self, primarybytes_in=None, primarybytes_out=None, secondarybytes_in=None, secondarybytes_out=None): - super(ExpressRouteCircuitStats, self).__init__() - self.primarybytes_in = primarybytes_in - self.primarybytes_out = primarybytes_out - self.secondarybytes_in = secondarybytes_in - self.secondarybytes_out = secondarybytes_out + def __init__(self, **kwargs): + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = kwargs.get('primarybytes_in', None) + self.primarybytes_out = kwargs.get('primarybytes_out', None) + self.secondarybytes_in = kwargs.get('secondarybytes_in', None) + self.secondarybytes_out = kwargs.get('secondarybytes_out', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_stats_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_stats_py3.py new file mode 100644 index 000000000000..f78335343544 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuit_stats_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitStats(Model): + """Contains stats associated with the peering. + + :param primarybytes_in: Gets BytesIn of the peering. + :type primarybytes_in: long + :param primarybytes_out: Gets BytesOut of the peering. + :type primarybytes_out: long + :param secondarybytes_in: Gets BytesIn of the peering. + :type secondarybytes_in: long + :param secondarybytes_out: Gets BytesOut of the peering. + :type secondarybytes_out: long + """ + + _attribute_map = { + 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, + 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, + 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, + 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, + } + + def __init__(self, *, primarybytes_in: int=None, primarybytes_out: int=None, secondarybytes_in: int=None, secondarybytes_out: int=None, **kwargs) -> None: + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = primarybytes_in + self.primarybytes_out = primarybytes_out + self.secondarybytes_in = secondarybytes_in + self.secondarybytes_out = secondarybytes_out diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_arp_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_arp_table_list_result.py index 931aed56d4c4..b55805f89e7e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_arp_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_arp_table_list_result.py @@ -27,7 +27,7 @@ class ExpressRouteCircuitsArpTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsArpTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_arp_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_arp_table_list_result_py3.py new file mode 100644 index 000000000000..06d80080b1fa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_arp_table_list_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsArpTableListResult(Model): + """Response for ListArpTable associated with the Express Route Circuits API. + + :param value: Gets list of the ARP table. + :type value: + list[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitArpTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_list_result.py index 47d01cd41c19..4cd6d0c732c1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_list_result_py3.py new file mode 100644 index 000000000000..64b26f0c214f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: The list of routes table. + :type value: + list[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitRoutesTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_summary_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_summary_list_result.py index 732349f9e45c..1878e932c3bf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_summary_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_summary_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_summary_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_summary_list_result_py3.py new file mode 100644 index 000000000000..4efe481681d0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_circuits_routes_table_summary_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: A list of the routes table. + :type value: + list[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitRoutesTableSummary] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider.py index 79527dd1fda6..d3b514acdccc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider.py @@ -53,8 +53,8 @@ class ExpressRouteServiceProvider(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state=None): - super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags) - self.peering_locations = peering_locations - self.bandwidths_offered = bandwidths_offered - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ExpressRouteServiceProvider, self).__init__(**kwargs) + self.peering_locations = kwargs.get('peering_locations', None) + self.bandwidths_offered = kwargs.get('bandwidths_offered', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider_bandwidths_offered.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider_bandwidths_offered.py index 9cbba2fcfe97..b27622af42d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider_bandwidths_offered.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider_bandwidths_offered.py @@ -26,7 +26,7 @@ class ExpressRouteServiceProviderBandwidthsOffered(Model): 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, } - def __init__(self, offer_name=None, value_in_mbps=None): - super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__() - self.offer_name = offer_name - self.value_in_mbps = value_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = kwargs.get('offer_name', None) + self.value_in_mbps = kwargs.get('value_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider_bandwidths_offered_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider_bandwidths_offered_py3.py new file mode 100644 index 000000000000..88516a0dfcf8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider_bandwidths_offered_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteServiceProviderBandwidthsOffered(Model): + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :param offer_name: The OfferName. + :type offer_name: str + :param value_in_mbps: The ValueInMbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__(self, *, offer_name: str=None, value_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = offer_name + self.value_in_mbps = value_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider_py3.py new file mode 100644 index 000000000000..c8562e7e4503 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/express_route_service_provider_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param peering_locations: Get a list of peering locations. + :type peering_locations: list[str] + :param bandwidths_offered: Gets bandwidths offered. + :type bandwidths_offered: + list[~azure.mgmt.network.v2017_10_01.models.ExpressRouteServiceProviderBandwidthsOffered] + :param provisioning_state: Gets the provisioning state of the resource. + :type provisioning_state: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, + 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state: str=None, **kwargs) -> None: + super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.peering_locations = peering_locations + self.bandwidths_offered = bandwidths_offered + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_information.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_information.py index e6d307338238..5c20714d154d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_information.py @@ -15,13 +15,15 @@ class FlowLogInformation(Model): """Information on the configuration of flow log. - :param target_resource_id: The ID of the resource to configure for flow - logging. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. :type target_resource_id: str - :param storage_id: ID of the storage account which is used to store the - flow log. + :param storage_id: Required. ID of the storage account which is used to + store the flow log. :type storage_id: str - :param enabled: Flag to enable/disable flow logging. + :param enabled: Required. Flag to enable/disable flow logging. :type enabled: bool :param retention_policy: :type retention_policy: @@ -41,9 +43,9 @@ class FlowLogInformation(Model): 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, } - def __init__(self, target_resource_id, storage_id, enabled, retention_policy=None): - super(FlowLogInformation, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.enabled = enabled - self.retention_policy = retention_policy + def __init__(self, **kwargs): + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.enabled = kwargs.get('enabled', None) + self.retention_policy = kwargs.get('retention_policy', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_information_py3.py new file mode 100644 index 000000000000..3d9b9ee591ee --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_information_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogInformation(Model): + """Information on the configuration of flow log. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. + :type target_resource_id: str + :param storage_id: Required. ID of the storage account which is used to + store the flow log. + :type storage_id: str + :param enabled: Required. Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: + :type retention_policy: + ~azure.mgmt.network.v2017_10_01.models.RetentionPolicyParameters + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, enabled: bool, retention_policy=None, **kwargs) -> None: + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.enabled = enabled + self.retention_policy = retention_policy diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_status_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_status_parameters.py index 4cd22222bb45..5a48e938f2d6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_status_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_status_parameters.py @@ -15,8 +15,10 @@ class FlowLogStatusParameters(Model): """Parameters that define a resource to query flow log status. - :param target_resource_id: The target resource where getting the flow - logging status. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class FlowLogStatusParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(FlowLogStatusParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_status_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_status_parameters_py3.py new file mode 100644 index 000000000000..0768d2495150 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/flow_log_status_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogStatusParameters(Model): + """Parameters that define a resource to query flow log status. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/frontend_ip_configuration.py index 116bba5a1ef9..dab37aec2b62 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/frontend_ip_configuration.py @@ -85,17 +85,17 @@ class FrontendIPConfiguration(SubResource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None, zones=None): - super(FrontendIPConfiguration, self).__init__(id=id) + def __init__(self, **kwargs): + super(FrontendIPConfiguration, self).__init__(**kwargs) self.inbound_nat_rules = None self.inbound_nat_pools = None self.outbound_nat_rules = None self.load_balancing_rules = None - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.zones = zones + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..bdf80682bc7d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/frontend_ip_configuration_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class FrontendIPConfiguration(SubResource): + """Frontend IP address of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar inbound_nat_rules: Read only. Inbound rules URIs that use this + frontend IP. + :vartype inbound_nat_rules: + list[~azure.mgmt.network.v2017_10_01.models.SubResource] + :ivar inbound_nat_pools: Read only. Inbound pools URIs that use this + frontend IP. + :vartype inbound_nat_pools: + list[~azure.mgmt.network.v2017_10_01.models.SubResource] + :ivar outbound_nat_rules: Read only. Outbound rules URIs that use this + frontend IP. + :vartype outbound_nat_rules: + list[~azure.mgmt.network.v2017_10_01.models.SubResource] + :ivar load_balancing_rules: Gets load balancing rules URIs that use this + frontend IP. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_10_01.models.SubResource] + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The Private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_10_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_10_01.models.Subnet + :param public_ip_address: The reference of the Public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_10_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'inbound_nat_rules': {'readonly': True}, + 'inbound_nat_pools': {'readonly': True}, + 'outbound_nat_rules': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[SubResource]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, zones=None, **kwargs) -> None: + super(FrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.inbound_nat_rules = None + self.inbound_nat_pools = None + self.outbound_nat_rules = None + self.load_balancing_rules = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.zones = zones diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route.py index 64a53f146c0b..0b96cb661e70 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route.py @@ -54,8 +54,8 @@ class GatewayRoute(Model): 'weight': {'key': 'weight', 'type': 'int'}, } - def __init__(self): - super(GatewayRoute, self).__init__() + def __init__(self, **kwargs): + super(GatewayRoute, self).__init__(**kwargs) self.local_address = None self.network = None self.next_hop = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route_list_result.py index 6da7f1ff2957..04be784f85d2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route_list_result.py @@ -23,6 +23,6 @@ class GatewayRouteListResult(Model): 'value': {'key': 'value', 'type': '[GatewayRoute]'}, } - def __init__(self, value=None): - super(GatewayRouteListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route_list_result_py3.py new file mode 100644 index 000000000000..b20e407d88d2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRouteListResult(Model): + """List of virtual network gateway routes. + + :param value: List of gateway routes + :type value: list[~azure.mgmt.network.v2017_10_01.models.GatewayRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayRoute]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route_py3.py new file mode 100644 index 000000000000..1aa3ba60605f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/gateway_route_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRoute(Model): + """Gateway routing details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The gateway's local address + :vartype local_address: str + :ivar network: The route's network prefix + :vartype network: str + :ivar next_hop: The route's next hop + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from + :vartype source_peer: str + :ivar origin: The source this route was learned from + :vartype origin: str + :ivar as_path: The route's AS path sequence + :vartype as_path: str + :ivar weight: The route's weight + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(GatewayRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_pool.py index 8394ec76ce7f..23f1f3c6870c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_pool.py @@ -15,24 +15,28 @@ class InboundNatPool(SubResource): """Inbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. :type frontend_ip_configuration: ~azure.mgmt.network.v2017_10_01.models.SubResource - :param protocol: Possible values include: 'Udp', 'Tcp', 'All' + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' :type protocol: str or ~azure.mgmt.network.v2017_10_01.models.TransportProtocol - :param frontend_port_range_start: The first port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65534. + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. :type frontend_port_range_start: int - :param frontend_port_range_end: The last port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65535. + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. :type frontend_port_range_end: int - :param backend_port: The port used for internal connections on the - endpoint. Acceptable values are between 1 and 65535. + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. :type backend_port: int :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. @@ -64,13 +68,13 @@ class InboundNatPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port_range_start, frontend_port_range_end, backend_port, id=None, frontend_ip_configuration=None, provisioning_state=None, name=None, etag=None): - super(InboundNatPool, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.protocol = protocol - self.frontend_port_range_start = frontend_port_range_start - self.frontend_port_range_end = frontend_port_range_end - self.backend_port = backend_port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(InboundNatPool, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.protocol = kwargs.get('protocol', None) + self.frontend_port_range_start = kwargs.get('frontend_port_range_start', None) + self.frontend_port_range_end = kwargs.get('frontend_port_range_end', None) + self.backend_port = kwargs.get('backend_port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_pool_py3.py new file mode 100644 index 000000000000..82c04cf8e53f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_pool_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatPool(SubResource): + """Inbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_10_01.models.TransportProtocol + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. + :type frontend_port_range_start: int + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. + :type frontend_port_range_end: int + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port_range_start': {'required': True}, + 'frontend_port_range_end': {'required': True}, + 'backend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, + 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port_range_start: int, frontend_port_range_end: int, backend_port: int, id: str=None, frontend_ip_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatPool, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.protocol = protocol + self.frontend_port_range_start = frontend_port_range_start + self.frontend_port_range_end = frontend_port_range_end + self.backend_port = backend_port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_rule.py index 7b755c26bfd4..3006e498eed2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_rule.py @@ -77,15 +77,15 @@ class InboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, protocol=None, frontend_port=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(InboundNatRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration + def __init__(self, **kwargs): + super(InboundNatRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) self.backend_ip_configuration = None - self.protocol = protocol - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_rule_py3.py new file mode 100644 index 000000000000..0576d787c73e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/inbound_nat_rule_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatRule(SubResource): + """Inbound NAT rule of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :ivar backend_ip_configuration: A reference to a private IP address + defined on a network interface of a VM. Traffic sent to the frontend port + of each of the frontend IP configurations is forwarded to the backend IP. + :vartype backend_ip_configuration: + ~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceIPConfiguration + :param protocol: Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_10_01.models.TransportProtocol + :param frontend_port: The port for the external endpoint. Port numbers for + each rule must be unique within the Load Balancer. Acceptable values range + from 1 to 65534. + :type frontend_port: int + :param backend_port: The port used for the internal endpoint. Acceptable + values range from 1 to 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, protocol=None, frontend_port: int=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_ip_configuration = None + self.protocol = protocol + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_address_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_address_availability_result.py index f2cb36a550ec..6bcf52275711 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_address_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_address_availability_result.py @@ -27,7 +27,7 @@ class IPAddressAvailabilityResult(Model): 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, } - def __init__(self, available=None, available_ip_addresses=None): - super(IPAddressAvailabilityResult, self).__init__() - self.available = available - self.available_ip_addresses = available_ip_addresses + def __init__(self, **kwargs): + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) + self.available_ip_addresses = kwargs.get('available_ip_addresses', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_address_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_address_availability_result_py3.py new file mode 100644 index 000000000000..e5fc4340d370 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_address_availability_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPAddressAvailabilityResult(Model): + """Response for CheckIPAddressAvailability API service call. + + :param available: Private IP address availability. + :type available: bool + :param available_ip_addresses: Contains other available private IP + addresses if the asked for address is taken. + :type available_ip_addresses: list[str] + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, + } + + def __init__(self, *, available: bool=None, available_ip_addresses=None, **kwargs) -> None: + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = available + self.available_ip_addresses = available_ip_addresses diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_configuration.py index 708aa486879f..4d287ef62134 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_configuration.py @@ -51,12 +51,12 @@ class IPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(IPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(IPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_configuration_py3.py new file mode 100644 index 000000000000..6b4f706020bc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_configuration_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class IPConfiguration(SubResource): + """IP configuration. + + :param id: Resource ID. + :type id: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_10_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_10_01.models.Subnet + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_10_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(IPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipsec_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipsec_policy.py index d339d9d22ccb..906016bb05fa 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipsec_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipsec_policy.py @@ -15,39 +15,41 @@ class IpsecPolicy(Model): """An IPSec Policy configuration for a virtual network gateway connection. - :param sa_life_time_seconds: The IPSec Security Association (also called - Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN - tunnel. + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. :type sa_life_time_seconds: int - :param sa_data_size_kilobytes: The IPSec Security Association (also called - Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN - tunnel. + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. :type sa_data_size_kilobytes: int - :param ipsec_encryption: The IPSec encryption algorithm (IKE phase 1). - Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', - 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' :type ipsec_encryption: str or ~azure.mgmt.network.v2017_10_01.models.IpsecEncryption - :param ipsec_integrity: The IPSec integrity algorithm (IKE phase 1). - Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256' :type ipsec_integrity: str or ~azure.mgmt.network.v2017_10_01.models.IpsecIntegrity - :param ike_encryption: The IKE encryption algorithm (IKE phase 2). - Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' :type ike_encryption: str or ~azure.mgmt.network.v2017_10_01.models.IkeEncryption - :param ike_integrity: The IKE integrity algorithm (IKE phase 2). Possible - values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' :type ike_integrity: str or ~azure.mgmt.network.v2017_10_01.models.IkeIntegrity - :param dh_group: The DH Groups used in IKE Phase 1 for initial SA. - Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' :type dh_group: str or ~azure.mgmt.network.v2017_10_01.models.DhGroup - :param pfs_group: The DH Groups used in IKE Phase 2 for new child SA. - Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', - 'ECP384', 'PFS24' + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' :type pfs_group: str or ~azure.mgmt.network.v2017_10_01.models.PfsGroup """ @@ -73,13 +75,13 @@ class IpsecPolicy(Model): 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, } - def __init__(self, sa_life_time_seconds, sa_data_size_kilobytes, ipsec_encryption, ipsec_integrity, ike_encryption, ike_integrity, dh_group, pfs_group): - super(IpsecPolicy, self).__init__() - self.sa_life_time_seconds = sa_life_time_seconds - self.sa_data_size_kilobytes = sa_data_size_kilobytes - self.ipsec_encryption = ipsec_encryption - self.ipsec_integrity = ipsec_integrity - self.ike_encryption = ike_encryption - self.ike_integrity = ike_integrity - self.dh_group = dh_group - self.pfs_group = pfs_group + def __init__(self, **kwargs): + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = kwargs.get('sa_life_time_seconds', None) + self.sa_data_size_kilobytes = kwargs.get('sa_data_size_kilobytes', None) + self.ipsec_encryption = kwargs.get('ipsec_encryption', None) + self.ipsec_integrity = kwargs.get('ipsec_integrity', None) + self.ike_encryption = kwargs.get('ike_encryption', None) + self.ike_integrity = kwargs.get('ike_integrity', None) + self.dh_group = kwargs.get('dh_group', None) + self.pfs_group = kwargs.get('pfs_group', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipsec_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipsec_policy_py3.py new file mode 100644 index 000000000000..2c7f9f4284de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipsec_policy_py3.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IpsecPolicy(Model): + """An IPSec Policy configuration for a virtual network gateway connection. + + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. + :type sa_life_time_seconds: int + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. + :type sa_data_size_kilobytes: int + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :type ipsec_encryption: str or + ~azure.mgmt.network.v2017_10_01.models.IpsecEncryption + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + 'GCMAES192', 'GCMAES256' + :type ipsec_integrity: str or + ~azure.mgmt.network.v2017_10_01.models.IpsecIntegrity + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :type ike_encryption: str or + ~azure.mgmt.network.v2017_10_01.models.IkeEncryption + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :type ike_integrity: str or + ~azure.mgmt.network.v2017_10_01.models.IkeIntegrity + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + :type dh_group: str or ~azure.mgmt.network.v2017_10_01.models.DhGroup + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' + :type pfs_group: str or ~azure.mgmt.network.v2017_10_01.models.PfsGroup + """ + + _validation = { + 'sa_life_time_seconds': {'required': True}, + 'sa_data_size_kilobytes': {'required': True}, + 'ipsec_encryption': {'required': True}, + 'ipsec_integrity': {'required': True}, + 'ike_encryption': {'required': True}, + 'ike_integrity': {'required': True}, + 'dh_group': {'required': True}, + 'pfs_group': {'required': True}, + } + + _attribute_map = { + 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, + 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, + 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, + 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, + 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, + 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, + 'dh_group': {'key': 'dhGroup', 'type': 'str'}, + 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, + } + + def __init__(self, *, sa_life_time_seconds: int, sa_data_size_kilobytes: int, ipsec_encryption, ipsec_integrity, ike_encryption, ike_integrity, dh_group, pfs_group, **kwargs) -> None: + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = sa_life_time_seconds + self.sa_data_size_kilobytes = sa_data_size_kilobytes + self.ipsec_encryption = ipsec_encryption + self.ipsec_integrity = ipsec_integrity + self.ike_encryption = ike_encryption + self.ike_integrity = ike_integrity + self.dh_group = dh_group + self.pfs_group = pfs_group diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipv6_express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipv6_express_route_circuit_peering_config.py index b74e8080657e..9002f04c557a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipv6_express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipv6_express_route_circuit_peering_config.py @@ -38,10 +38,10 @@ class Ipv6ExpressRouteCircuitPeeringConfig(Model): 'state': {'key': 'state', 'type': 'str'}, } - def __init__(self, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, microsoft_peering_config=None, route_filter=None, state=None): - super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__() - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.microsoft_peering_config = microsoft_peering_config - self.route_filter = route_filter - self.state = state + def __init__(self, **kwargs): + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.route_filter = kwargs.get('route_filter', None) + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipv6_express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipv6_express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..e18a99adf7a9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ipv6_express_route_circuit_peering_config_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv6ExpressRouteCircuitPeeringConfig(Model): + """Contains IPv6 peering config. + + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2017_10_01.models.RouteFilter + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeeringState + """ + + _attribute_map = { + 'primary_peer_address_prefix': {'key': 'primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'secondaryPeerAddressPrefix', 'type': 'str'}, + 'microsoft_peering_config': {'key': 'microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'route_filter': {'key': 'routeFilter', 'type': 'RouteFilter'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, microsoft_peering_config=None, route_filter=None, state=None, **kwargs) -> None: + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.microsoft_peering_config = microsoft_peering_config + self.route_filter = route_filter + self.state = state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer.py index 0ae077dba098..0391792fba07 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer.py @@ -100,16 +100,16 @@ class LoadBalancer(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(LoadBalancer, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pools = backend_address_pools - self.load_balancing_rules = load_balancing_rules - self.probes = probes - self.inbound_nat_rules = inbound_nat_rules - self.inbound_nat_pools = inbound_nat_pools - self.outbound_nat_rules = outbound_nat_rules - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancer, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.load_balancing_rules = kwargs.get('load_balancing_rules', None) + self.probes = kwargs.get('probes', None) + self.inbound_nat_rules = kwargs.get('inbound_nat_rules', None) + self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) + self.outbound_nat_rules = kwargs.get('outbound_nat_rules', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer_py3.py new file mode 100644 index 000000000000..233dd65279ec --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer_py3.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LoadBalancer(Resource): + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The load balancer SKU. + :type sku: ~azure.mgmt.network.v2017_10_01.models.LoadBalancerSku + :param frontend_ip_configurations: Object representing the frontend IPs to + be used for the load balancer + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_10_01.models.FrontendIPConfiguration] + :param backend_address_pools: Collection of backend address pools used by + a load balancer + :type backend_address_pools: + list[~azure.mgmt.network.v2017_10_01.models.BackendAddressPool] + :param load_balancing_rules: Object collection representing the load + balancing rules Gets the provisioning + :type load_balancing_rules: + list[~azure.mgmt.network.v2017_10_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer + :type probes: list[~azure.mgmt.network.v2017_10_01.models.Probe] + :param inbound_nat_rules: Collection of inbound NAT Rules used by a load + balancer. Defining inbound NAT rules on your load balancer is mutually + exclusive with defining an inbound NAT pool. Inbound NAT pools are + referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an Inbound NAT pool. They + have to reference individual inbound NAT rules. + :type inbound_nat_rules: + list[~azure.mgmt.network.v2017_10_01.models.InboundNatRule] + :param inbound_nat_pools: Defines an external port range for inbound NAT + to a single backend port on NICs associated with a load balancer. Inbound + NAT rules are created automatically for each NIC associated with the Load + Balancer using an external port from this range. Defining an Inbound NAT + pool on your Load Balancer is mutually exclusive with defining inbound Nat + rules. Inbound NAT pools are referenced from virtual machine scale sets. + NICs that are associated with individual virtual machines cannot reference + an inbound NAT pool. They have to reference individual inbound NAT rules. + :type inbound_nat_pools: + list[~azure.mgmt.network.v2017_10_01.models.InboundNatPool] + :param outbound_nat_rules: The outbound NAT rules. + :type outbound_nat_rules: + list[~azure.mgmt.network.v2017_10_01.models.OutboundNatRule] + :param resource_guid: The resource GUID property of the load balancer + resource. + :type resource_guid: str + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'LoadBalancerSku'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, + 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[OutboundNatRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancer, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pools = backend_address_pools + self.load_balancing_rules = load_balancing_rules + self.probes = probes + self.inbound_nat_rules = inbound_nat_rules + self.inbound_nat_pools = inbound_nat_pools + self.outbound_nat_rules = outbound_nat_rules + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer_sku.py index b74365daf396..f2420b1c9df4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer_sku.py @@ -25,6 +25,6 @@ class LoadBalancerSku(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - super(LoadBalancerSku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer_sku_py3.py new file mode 100644 index 000000000000..0b223b5dc38b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancer_sku_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LoadBalancerSku(Model): + """SKU of a load balancer. + + :param name: Name of a load balancer SKU. Possible values include: + 'Basic', 'Standard' + :type name: str or + ~azure.mgmt.network.v2017_10_01.models.LoadBalancerSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancing_rule.py index 325618438f4d..d982d36b7c4a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancing_rule.py @@ -15,6 +15,8 @@ class LoadBalancingRule(SubResource): """A load balancing rule for a load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. @@ -27,7 +29,7 @@ class LoadBalancingRule(SubResource): :param probe: The reference of the load balancer probe used by the load balancing rule. :type probe: ~azure.mgmt.network.v2017_10_01.models.SubResource - :param protocol: Possible values include: 'Udp', 'Tcp', 'All' + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' :type protocol: str or ~azure.mgmt.network.v2017_10_01.models.TransportProtocol :param load_distribution: The load distribution policy for this rule. @@ -35,9 +37,9 @@ class LoadBalancingRule(SubResource): Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' :type load_distribution: str or ~azure.mgmt.network.v2017_10_01.models.LoadDistribution - :param frontend_port: The port for the external endpoint. Port numbers for - each rule must be unique within the Load Balancer. Acceptable values are - between 0 and 65534. Note that value 0 enables "Any Port" + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 0 and 65534. Note that value 0 enables "Any Port" :type frontend_port: int :param backend_port: The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 @@ -90,18 +92,18 @@ class LoadBalancingRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port, id=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, disable_outbound_snat=None, provisioning_state=None, name=None, etag=None): - super(LoadBalancingRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.backend_address_pool = backend_address_pool - self.probe = probe - self.protocol = protocol - self.load_distribution = load_distribution - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.disable_outbound_snat = disable_outbound_snat - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancingRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.probe = kwargs.get('probe', None) + self.protocol = kwargs.get('protocol', None) + self.load_distribution = kwargs.get('load_distribution', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.disable_outbound_snat = kwargs.get('disable_outbound_snat', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancing_rule_py3.py new file mode 100644 index 000000000000..cc419a23e08b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/load_balancing_rule_py3.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class LoadBalancingRule(SubResource): + """A load balancing rule for a load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param backend_address_pool: A reference to a pool of DIPs. Inbound + traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param probe: The reference of the load balancer probe used by the load + balancing rule. + :type probe: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_10_01.models.TransportProtocol + :param load_distribution: The load distribution policy for this rule. + Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + :type load_distribution: str or + ~azure.mgmt.network.v2017_10_01.models.LoadDistribution + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 0 and 65534. Note that value 0 enables "Any Port" + :type frontend_port: int + :param backend_port: The port used for internal connections on the + endpoint. Acceptable values are between 0 and 65535. Note that value 0 + enables "Any Port" + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param disable_outbound_snat: Configures SNAT for the VMs in the backend + pool to use the publicIP address specified in the frontend of the load + balancing rule. + :type disable_outbound_snat: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'disable_outbound_snat': {'key': 'properties.disableOutboundSnat', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port: int, id: str=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, disable_outbound_snat: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancingRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_address_pool = backend_address_pool + self.probe = probe + self.protocol = protocol + self.load_distribution = load_distribution + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.disable_outbound_snat = disable_outbound_snat + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/local_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/local_network_gateway.py index 4b6c53ab25e6..dc6d828f4974 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/local_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/local_network_gateway.py @@ -67,11 +67,11 @@ class LocalNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, local_network_address_space=None, gateway_ip_address=None, bgp_settings=None, resource_guid=None, etag=None): - super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.local_network_address_space = local_network_address_space - self.gateway_ip_address = gateway_ip_address - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(LocalNetworkGateway, self).__init__(**kwargs) + self.local_network_address_space = kwargs.get('local_network_address_space', None) + self.gateway_ip_address = kwargs.get('gateway_ip_address', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/local_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/local_network_gateway_py3.py new file mode 100644 index 000000000000..9929d4071578 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/local_network_gateway_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LocalNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param local_network_address_space: Local network site address space. + :type local_network_address_space: + ~azure.mgmt.network.v2017_10_01.models.AddressSpace + :param gateway_ip_address: IP address of local network gateway. + :type gateway_ip_address: str + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2017_10_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + LocalNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', + and 'Failed'. + :vartype provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, + 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, local_network_address_space=None, gateway_ip_address: str=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.local_network_address_space = local_network_address_space + self.gateway_ip_address = gateway_ip_address + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/log_specification.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/log_specification.py index 2386ea5f799f..ab592992d904 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/log_specification.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/log_specification.py @@ -29,8 +29,8 @@ class LogSpecification(Model): 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, blob_duration=None): - super(LogSpecification, self).__init__() - self.name = name - self.display_name = display_name - self.blob_duration = blob_duration + def __init__(self, **kwargs): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/log_specification_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/log_specification_py3.py new file mode 100644 index 000000000000..6184811d393e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/log_specification_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LogSpecification(Model): + """Description of logging specification. + + :param name: The name of the specification. + :type name: str + :param display_name: The display name of the specification. + :type display_name: str + :param blob_duration: Duration of the blob. + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str=None, **kwargs) -> None: + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/metric_specification.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/metric_specification.py index a86668fcff8d..e6469d454430 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/metric_specification.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/metric_specification.py @@ -64,19 +64,19 @@ class MetricSpecification(Model): 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, display_description=None, unit=None, aggregation_type=None, availabilities=None, enable_regional_mdm_account=None, fill_gap_with_zero=None, metric_filter_pattern=None, dimensions=None, is_internal=None, source_mdm_account=None, source_mdm_namespace=None, resource_id_dimension_name_override=None): - super(MetricSpecification, self).__init__() - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.aggregation_type = aggregation_type - self.availabilities = availabilities - self.enable_regional_mdm_account = enable_regional_mdm_account - self.fill_gap_with_zero = fill_gap_with_zero - self.metric_filter_pattern = metric_filter_pattern - self.dimensions = dimensions - self.is_internal = is_internal - self.source_mdm_account = source_mdm_account - self.source_mdm_namespace = source_mdm_namespace - self.resource_id_dimension_name_override = resource_id_dimension_name_override + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.availabilities = kwargs.get('availabilities', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.metric_filter_pattern = kwargs.get('metric_filter_pattern', None) + self.dimensions = kwargs.get('dimensions', None) + self.is_internal = kwargs.get('is_internal', None) + self.source_mdm_account = kwargs.get('source_mdm_account', None) + self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/metric_specification_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/metric_specification_py3.py new file mode 100644 index 000000000000..f21890c295bb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/metric_specification_py3.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricSpecification(Model): + """Description of metrics specification. + + :param name: The name of the metric. + :type name: str + :param display_name: The display name of the metric. + :type display_name: str + :param display_description: The description of the metric. + :type display_description: str + :param unit: Units the metric to be displayed in. + :type unit: str + :param aggregation_type: The aggregation type. + :type aggregation_type: str + :param availabilities: List of availability. + :type availabilities: + list[~azure.mgmt.network.v2017_10_01.models.Availability] + :param enable_regional_mdm_account: Whether regional MDM account enabled. + :type enable_regional_mdm_account: bool + :param fill_gap_with_zero: Whether gaps would be filled with zeros. + :type fill_gap_with_zero: bool + :param metric_filter_pattern: Pattern for the filter of the metric. + :type metric_filter_pattern: str + :param dimensions: List of dimensions. + :type dimensions: list[~azure.mgmt.network.v2017_10_01.models.Dimension] + :param is_internal: Whether the metric is internal. + :type is_internal: bool + :param source_mdm_account: The source MDM account. + :type source_mdm_account: str + :param source_mdm_namespace: The source MDM namespace. + :type source_mdm_namespace: str + :param resource_id_dimension_name_override: The resource Id dimension name + override. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[Availability]'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, availabilities=None, enable_regional_mdm_account: bool=None, fill_gap_with_zero: bool=None, metric_filter_pattern: str=None, dimensions=None, is_internal: bool=None, source_mdm_account: str=None, source_mdm_namespace: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.availabilities = availabilities + self.enable_regional_mdm_account = enable_regional_mdm_account + self.fill_gap_with_zero = fill_gap_with_zero + self.metric_filter_pattern = metric_filter_pattern + self.dimensions = dimensions + self.is_internal = is_internal + self.source_mdm_account = source_mdm_account + self.source_mdm_namespace = source_mdm_namespace + self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface.py index e654713e2dcb..786e6a709a1c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface.py @@ -87,16 +87,16 @@ class NetworkInterface(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address=None, primary=None, enable_accelerated_networking=None, enable_ip_forwarding=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkInterface, self).__init__(id=id, location=location, tags=tags) - self.virtual_machine = virtual_machine - self.network_security_group = network_security_group - self.ip_configurations = ip_configurations - self.dns_settings = dns_settings - self.mac_address = mac_address - self.primary = primary - self.enable_accelerated_networking = enable_accelerated_networking - self.enable_ip_forwarding = enable_ip_forwarding - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.virtual_machine = kwargs.get('virtual_machine', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.mac_address = kwargs.get('mac_address', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_association.py index bbe5bc114504..762ae03f9123 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_association.py @@ -34,7 +34,7 @@ class NetworkInterfaceAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(NetworkInterfaceAssociation, self).__init__() + def __init__(self, **kwargs): + super(NetworkInterfaceAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_association_py3.py new file mode 100644 index 000000000000..65e43355a845 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Network interface ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2017_10_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(NetworkInterfaceAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_dns_settings.py index 675a4a1eb08a..b6ee0ff40d51 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_dns_settings.py @@ -46,10 +46,10 @@ class NetworkInterfaceDnsSettings(Model): 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, } - def __init__(self, dns_servers=None, applied_dns_servers=None, internal_dns_name_label=None, internal_fqdn=None, internal_domain_name_suffix=None): - super(NetworkInterfaceDnsSettings, self).__init__() - self.dns_servers = dns_servers - self.applied_dns_servers = applied_dns_servers - self.internal_dns_name_label = internal_dns_name_label - self.internal_fqdn = internal_fqdn - self.internal_domain_name_suffix = internal_domain_name_suffix + def __init__(self, **kwargs): + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + self.applied_dns_servers = kwargs.get('applied_dns_servers', None) + self.internal_dns_name_label = kwargs.get('internal_dns_name_label', None) + self.internal_fqdn = kwargs.get('internal_fqdn', None) + self.internal_domain_name_suffix = kwargs.get('internal_domain_name_suffix', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_dns_settings_py3.py new file mode 100644 index 000000000000..ccdcc937def8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_dns_settings_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceDnsSettings(Model): + """DNS settings of a network interface. + + :param dns_servers: List of DNS servers IP addresses. Use + 'AzureProvidedDNS' to switch to azure provided DNS resolution. + 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + only value in dnsServers collection. + :type dns_servers: list[str] + :param applied_dns_servers: If the VM that uses this NIC is part of an + Availability Set, then this list will have the union of all DNS servers + from all NICs that are part of the Availability Set. This property is what + is configured on each of those VMs. + :type applied_dns_servers: list[str] + :param internal_dns_name_label: Relative DNS name for this NIC used for + internal communications between VMs in the same virtual network. + :type internal_dns_name_label: str + :param internal_fqdn: Fully qualified DNS name supporting internal + communications between VMs in the same virtual network. + :type internal_fqdn: str + :param internal_domain_name_suffix: Even if internalDnsNameLabel is not + specified, a DNS entry is created for the primary NIC of the VM. This DNS + name can be constructed by concatenating the VM name with the value of + internalDomainNameSuffix. + :type internal_domain_name_suffix: str + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, + 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, + } + + def __init__(self, *, dns_servers=None, applied_dns_servers=None, internal_dns_name_label: str=None, internal_fqdn: str=None, internal_domain_name_suffix: str=None, **kwargs) -> None: + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers + self.applied_dns_servers = applied_dns_servers + self.internal_dns_name_label = internal_dns_name_label + self.internal_fqdn = internal_fqdn + self.internal_domain_name_suffix = internal_domain_name_suffix diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_ip_configuration.py index 127ec7c3580a..5ebe2d8e0bb7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_ip_configuration.py @@ -83,18 +83,18 @@ class NetworkInterfaceIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary=None, public_ip_address=None, application_security_groups=None, provisioning_state=None, name=None, etag=None): - super(NetworkInterfaceIPConfiguration, self).__init__(id=id) - self.application_gateway_backend_address_pools = application_gateway_backend_address_pools - self.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.private_ip_address_version = private_ip_address_version - self.subnet = subnet - self.primary = primary - self.public_ip_address = public_ip_address - self.application_security_groups = application_security_groups - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterfaceIPConfiguration, self).__init__(**kwargs) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_rules = kwargs.get('load_balancer_inbound_nat_rules', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.application_security_groups = kwargs.get('application_security_groups', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_ip_configuration_py3.py new file mode 100644 index 000000000000..b3b170f91255 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_ip_configuration_py3.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class NetworkInterfaceIPConfiguration(SubResource): + """IPConfiguration in a network interface. + + :param id: Resource ID. + :type id: str + :param application_gateway_backend_address_pools: The reference of + ApplicationGatewayBackendAddressPool resource. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendAddressPool] + :param load_balancer_backend_address_pools: The reference of + LoadBalancerBackendAddressPool resource. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2017_10_01.models.BackendAddressPool] + :param load_balancer_inbound_nat_rules: A list of references of + LoadBalancerInboundNatRules. + :type load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2017_10_01.models.InboundNatRule] + :param private_ip_address: Private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: Defines how a private IP address is + assigned. Possible values are: 'Static' and 'Dynamic'. Possible values + include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_10_01.models.IPAllocationMethod + :param private_ip_address_version: Available from Api-Version 2016-03-30 + onwards, it represents whether the specific ipconfiguration is IPv4 or + IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.network.v2017_10_01.models.IPVersion + :param subnet: Subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.network.v2017_10_01.models.Subnet + :param primary: Gets whether this is a primary customer address on the + network interface. + :type primary: bool + :param public_ip_address: Public IP address bound to the IP configuration. + :type public_ip_address: + ~azure.mgmt.network.v2017_10_01.models.PublicIPAddress + :param application_security_groups: Application security groups in which + the IP configuration is included. + :type application_security_groups: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroup] + :param provisioning_state: The provisioning state of the network interface + IP configuration. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'application_security_groups': {'key': 'properties.applicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address: str=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary: bool=None, public_ip_address=None, application_security_groups=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterfaceIPConfiguration, self).__init__(id=id, **kwargs) + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.private_ip_address_version = private_ip_address_version + self.subnet = subnet + self.primary = primary + self.public_ip_address = public_ip_address + self.application_security_groups = application_security_groups + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_py3.py new file mode 100644 index 000000000000..53b601081482 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_interface_py3.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkInterface(Resource): + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param virtual_machine: The reference of a virtual machine. + :type virtual_machine: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroup + :param ip_configurations: A list of IPConfigurations of the network + interface. + :type ip_configurations: + list[~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceIPConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: + ~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceDnsSettings + :param mac_address: The MAC address of the network interface. + :type mac_address: str + :param primary: Gets whether this is a primary network interface on a + virtual machine. + :type primary: bool + :param enable_accelerated_networking: If the network interface is + accelerated networking enabled. + :type enable_accelerated_networking: bool + :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on + this network interface. + :type enable_ip_forwarding: bool + :param resource_guid: The resource GUID property of the network interface + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, + 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address: str=None, primary: bool=None, enable_accelerated_networking: bool=None, enable_ip_forwarding: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterface, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.virtual_machine = virtual_machine + self.network_security_group = network_security_group + self.ip_configurations = ip_configurations + self.dns_settings = dns_settings + self.mac_address = mac_address + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.enable_ip_forwarding = enable_ip_forwarding + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_management_client_enums.py index abd139a2762c..80779ff26b9f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_management_client_enums.py @@ -12,45 +12,45 @@ from enum import Enum -class TransportProtocol(Enum): +class TransportProtocol(str, Enum): udp = "Udp" tcp = "Tcp" all = "All" -class IPAllocationMethod(Enum): +class IPAllocationMethod(str, Enum): static = "Static" dynamic = "Dynamic" -class IPVersion(Enum): +class IPVersion(str, Enum): ipv4 = "IPv4" ipv6 = "IPv6" -class SecurityRuleProtocol(Enum): +class SecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" asterisk = "*" -class SecurityRuleAccess(Enum): +class SecurityRuleAccess(str, Enum): allow = "Allow" deny = "Deny" -class SecurityRuleDirection(Enum): +class SecurityRuleDirection(str, Enum): inbound = "Inbound" outbound = "Outbound" -class RouteNextHopType(Enum): +class RouteNextHopType(str, Enum): virtual_network_gateway = "VirtualNetworkGateway" vnet_local = "VnetLocal" @@ -59,25 +59,25 @@ class RouteNextHopType(Enum): none = "None" -class PublicIPAddressSkuName(Enum): +class PublicIPAddressSkuName(str, Enum): basic = "Basic" standard = "Standard" -class ApplicationGatewayProtocol(Enum): +class ApplicationGatewayProtocol(str, Enum): http = "Http" https = "Https" -class ApplicationGatewayCookieBasedAffinity(Enum): +class ApplicationGatewayCookieBasedAffinity(str, Enum): enabled = "Enabled" disabled = "Disabled" -class ApplicationGatewayBackendHealthServerHealth(Enum): +class ApplicationGatewayBackendHealthServerHealth(str, Enum): unknown = "Unknown" up = "Up" @@ -86,7 +86,7 @@ class ApplicationGatewayBackendHealthServerHealth(Enum): draining = "Draining" -class ApplicationGatewaySkuName(Enum): +class ApplicationGatewaySkuName(str, Enum): standard_small = "Standard_Small" standard_medium = "Standard_Medium" @@ -95,33 +95,33 @@ class ApplicationGatewaySkuName(Enum): waf_large = "WAF_Large" -class ApplicationGatewayTier(Enum): +class ApplicationGatewayTier(str, Enum): standard = "Standard" waf = "WAF" -class ApplicationGatewaySslProtocol(Enum): +class ApplicationGatewaySslProtocol(str, Enum): tl_sv1_0 = "TLSv1_0" tl_sv1_1 = "TLSv1_1" tl_sv1_2 = "TLSv1_2" -class ApplicationGatewaySslPolicyType(Enum): +class ApplicationGatewaySslPolicyType(str, Enum): predefined = "Predefined" custom = "Custom" -class ApplicationGatewaySslPolicyName(Enum): +class ApplicationGatewaySslPolicyName(str, Enum): app_gw_ssl_policy20150501 = "AppGwSslPolicy20150501" app_gw_ssl_policy20170401 = "AppGwSslPolicy20170401" app_gw_ssl_policy20170401_s = "AppGwSslPolicy20170401S" -class ApplicationGatewaySslCipherSuite(Enum): +class ApplicationGatewaySslCipherSuite(str, Enum): tls_ecdhe_rsa_with_aes_256_cbc_sha384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" tls_ecdhe_rsa_with_aes_128_cbc_sha256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" @@ -150,13 +150,13 @@ class ApplicationGatewaySslCipherSuite(Enum): tls_rsa_with_3_des_ede_cbc_sha = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" -class ApplicationGatewayRequestRoutingRuleType(Enum): +class ApplicationGatewayRequestRoutingRuleType(str, Enum): basic = "Basic" path_based_routing = "PathBasedRouting" -class ApplicationGatewayRedirectType(Enum): +class ApplicationGatewayRedirectType(str, Enum): permanent = "Permanent" found = "Found" @@ -164,7 +164,7 @@ class ApplicationGatewayRedirectType(Enum): temporary = "Temporary" -class ApplicationGatewayOperationalState(Enum): +class ApplicationGatewayOperationalState(str, Enum): stopped = "Stopped" starting = "Starting" @@ -172,19 +172,19 @@ class ApplicationGatewayOperationalState(Enum): stopping = "Stopping" -class ApplicationGatewayFirewallMode(Enum): +class ApplicationGatewayFirewallMode(str, Enum): detection = "Detection" prevention = "Prevention" -class AuthorizationUseStatus(Enum): +class AuthorizationUseStatus(str, Enum): available = "Available" in_use = "InUse" -class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(str, Enum): not_configured = "NotConfigured" configuring = "Configuring" @@ -192,38 +192,38 @@ class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): validation_needed = "ValidationNeeded" -class Access(Enum): +class Access(str, Enum): allow = "Allow" deny = "Deny" -class ExpressRouteCircuitPeeringType(Enum): +class ExpressRouteCircuitPeeringType(str, Enum): azure_public_peering = "AzurePublicPeering" azure_private_peering = "AzurePrivatePeering" microsoft_peering = "MicrosoftPeering" -class ExpressRouteCircuitPeeringState(Enum): +class ExpressRouteCircuitPeeringState(str, Enum): disabled = "Disabled" enabled = "Enabled" -class ExpressRouteCircuitSkuTier(Enum): +class ExpressRouteCircuitSkuTier(str, Enum): standard = "Standard" premium = "Premium" -class ExpressRouteCircuitSkuFamily(Enum): +class ExpressRouteCircuitSkuFamily(str, Enum): unlimited_data = "UnlimitedData" metered_data = "MeteredData" -class ServiceProviderProvisioningState(Enum): +class ServiceProviderProvisioningState(str, Enum): not_provisioned = "NotProvisioned" provisioning = "Provisioning" @@ -231,40 +231,40 @@ class ServiceProviderProvisioningState(Enum): deprovisioning = "Deprovisioning" -class LoadBalancerSkuName(Enum): +class LoadBalancerSkuName(str, Enum): basic = "Basic" standard = "Standard" -class LoadDistribution(Enum): +class LoadDistribution(str, Enum): default = "Default" source_ip = "SourceIP" source_ip_protocol = "SourceIPProtocol" -class ProbeProtocol(Enum): +class ProbeProtocol(str, Enum): http = "Http" tcp = "Tcp" -class NetworkOperationStatus(Enum): +class NetworkOperationStatus(str, Enum): in_progress = "InProgress" succeeded = "Succeeded" failed = "Failed" -class EffectiveSecurityRuleProtocol(Enum): +class EffectiveSecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" all = "All" -class EffectiveRouteSource(Enum): +class EffectiveRouteSource(str, Enum): unknown = "Unknown" user = "User" @@ -272,13 +272,13 @@ class EffectiveRouteSource(Enum): default = "Default" -class EffectiveRouteState(Enum): +class EffectiveRouteState(str, Enum): active = "Active" invalid = "Invalid" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): succeeded = "Succeeded" updating = "Updating" @@ -286,25 +286,25 @@ class ProvisioningState(Enum): failed = "Failed" -class AssociationType(Enum): +class AssociationType(str, Enum): associated = "Associated" contains = "Contains" -class Direction(Enum): +class Direction(str, Enum): inbound = "Inbound" outbound = "Outbound" -class Protocol(Enum): +class Protocol(str, Enum): tcp = "TCP" udp = "UDP" -class NextHopType(Enum): +class NextHopType(str, Enum): internet = "Internet" virtual_appliance = "VirtualAppliance" @@ -314,14 +314,14 @@ class NextHopType(Enum): none = "None" -class PcProtocol(Enum): +class PcProtocol(str, Enum): tcp = "TCP" udp = "UDP" any = "Any" -class PcStatus(Enum): +class PcStatus(str, Enum): not_started = "NotStarted" running = "Running" @@ -330,7 +330,7 @@ class PcStatus(Enum): unknown = "Unknown" -class PcError(Enum): +class PcError(str, Enum): internal_error = "InternalError" agent_stopped = "AgentStopped" @@ -339,20 +339,20 @@ class PcError(Enum): storage_failed = "StorageFailed" -class Origin(Enum): +class Origin(str, Enum): local = "Local" inbound = "Inbound" outbound = "Outbound" -class Severity(Enum): +class Severity(str, Enum): error = "Error" warning = "Warning" -class IssueType(Enum): +class IssueType(str, Enum): unknown = "Unknown" agent_stopped = "AgentStopped" @@ -365,7 +365,7 @@ class IssueType(Enum): platform = "Platform" -class ConnectionStatus(Enum): +class ConnectionStatus(str, Enum): unknown = "Unknown" connected = "Connected" @@ -373,40 +373,40 @@ class ConnectionStatus(Enum): degraded = "Degraded" -class ConnectionState(Enum): +class ConnectionState(str, Enum): reachable = "Reachable" unreachable = "Unreachable" unknown = "Unknown" -class EvaluationState(Enum): +class EvaluationState(str, Enum): not_started = "NotStarted" in_progress = "InProgress" completed = "Completed" -class VirtualNetworkPeeringState(Enum): +class VirtualNetworkPeeringState(str, Enum): initiated = "Initiated" connected = "Connected" disconnected = "Disconnected" -class VirtualNetworkGatewayType(Enum): +class VirtualNetworkGatewayType(str, Enum): vpn = "Vpn" express_route = "ExpressRoute" -class VpnType(Enum): +class VpnType(str, Enum): policy_based = "PolicyBased" route_based = "RouteBased" -class VirtualNetworkGatewaySkuName(Enum): +class VirtualNetworkGatewaySkuName(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -417,7 +417,7 @@ class VirtualNetworkGatewaySkuName(Enum): vpn_gw3 = "VpnGw3" -class VirtualNetworkGatewaySkuTier(Enum): +class VirtualNetworkGatewaySkuTier(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -428,13 +428,13 @@ class VirtualNetworkGatewaySkuTier(Enum): vpn_gw3 = "VpnGw3" -class VpnClientProtocol(Enum): +class VpnClientProtocol(str, Enum): ike_v2 = "IkeV2" sstp = "SSTP" -class BgpPeerState(Enum): +class BgpPeerState(str, Enum): unknown = "Unknown" stopped = "Stopped" @@ -443,19 +443,19 @@ class BgpPeerState(Enum): connected = "Connected" -class ProcessorArchitecture(Enum): +class ProcessorArchitecture(str, Enum): amd64 = "Amd64" x86 = "X86" -class AuthenticationMethod(Enum): +class AuthenticationMethod(str, Enum): eaptls = "EAPTLS" eapmscha_pv2 = "EAPMSCHAPv2" -class VirtualNetworkGatewayConnectionStatus(Enum): +class VirtualNetworkGatewayConnectionStatus(str, Enum): unknown = "Unknown" connecting = "Connecting" @@ -463,7 +463,7 @@ class VirtualNetworkGatewayConnectionStatus(Enum): not_connected = "NotConnected" -class VirtualNetworkGatewayConnectionType(Enum): +class VirtualNetworkGatewayConnectionType(str, Enum): ipsec = "IPsec" vnet2_vnet = "Vnet2Vnet" @@ -471,7 +471,7 @@ class VirtualNetworkGatewayConnectionType(Enum): vpn_client = "VPNClient" -class IpsecEncryption(Enum): +class IpsecEncryption(str, Enum): none = "None" des = "DES" @@ -484,7 +484,7 @@ class IpsecEncryption(Enum): gcmaes256 = "GCMAES256" -class IpsecIntegrity(Enum): +class IpsecIntegrity(str, Enum): md5 = "MD5" sha1 = "SHA1" @@ -494,7 +494,7 @@ class IpsecIntegrity(Enum): gcmaes256 = "GCMAES256" -class IkeEncryption(Enum): +class IkeEncryption(str, Enum): des = "DES" des3 = "DES3" @@ -503,7 +503,7 @@ class IkeEncryption(Enum): aes256 = "AES256" -class IkeIntegrity(Enum): +class IkeIntegrity(str, Enum): md5 = "MD5" sha1 = "SHA1" @@ -511,7 +511,7 @@ class IkeIntegrity(Enum): sha384 = "SHA384" -class DhGroup(Enum): +class DhGroup(str, Enum): none = "None" dh_group1 = "DHGroup1" @@ -523,7 +523,7 @@ class DhGroup(Enum): dh_group24 = "DHGroup24" -class PfsGroup(Enum): +class PfsGroup(str, Enum): none = "None" pfs1 = "PFS1" diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_security_group.py index 971703bfb4ee..d655f8d99a11 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_security_group.py @@ -75,12 +75,12 @@ class NetworkSecurityGroup(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, security_rules=None, default_security_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags) - self.security_rules = security_rules - self.default_security_rules = default_security_rules + def __init__(self, **kwargs): + super(NetworkSecurityGroup, self).__init__(**kwargs) + self.security_rules = kwargs.get('security_rules', None) + self.default_security_rules = kwargs.get('default_security_rules', None) self.network_interfaces = None self.subnets = None - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_security_group_py3.py new file mode 100644 index 000000000000..8b95cc2ee2c0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_security_group_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkSecurityGroup(Resource): + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param security_rules: A collection of security rules of the network + security group. + :type security_rules: + list[~azure.mgmt.network.v2017_10_01.models.SecurityRule] + :param default_security_rules: The default security rules of network + security group. + :type default_security_rules: + list[~azure.mgmt.network.v2017_10_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network + interfaces. + :vartype network_interfaces: + list[~azure.mgmt.network.v2017_10_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2017_10_01.models.Subnet] + :param resource_guid: The resource GUID property of the network security + group resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, + 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, security_rules=None, default_security_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.security_rules = security_rules + self.default_security_rules = default_security_rules + self.network_interfaces = None + self.subnets = None + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_watcher.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_watcher.py index e03e08069de9..f02fb735431f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_watcher.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_watcher.py @@ -53,7 +53,7 @@ class NetworkWatcher(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, etag=None): - super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags) - self.etag = etag + def __init__(self, **kwargs): + super(NetworkWatcher, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_watcher_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_watcher_py3.py new file mode 100644 index 000000000000..9f68c93f5cdf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/network_watcher_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkWatcher(Resource): + """Network watcher in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.network.v2017_10_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, etag: str=None, **kwargs) -> None: + super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = etag + self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_parameters.py index 3e1478409a0a..54d8674c8884 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_parameters.py @@ -15,12 +15,14 @@ class NextHopParameters(Model): """Parameters that define the source and destination endpoint. - :param target_resource_id: The resource identifier of the target resource - against which the action is to be performed. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. :type target_resource_id: str - :param source_ip_address: The source IP address. + :param source_ip_address: Required. The source IP address. :type source_ip_address: str - :param destination_ip_address: The destination IP address. + :param destination_ip_address: Required. The destination IP address. :type destination_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be @@ -41,9 +43,9 @@ class NextHopParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, source_ip_address, destination_ip_address, target_nic_resource_id=None): - super(NextHopParameters, self).__init__() - self.target_resource_id = target_resource_id - self.source_ip_address = source_ip_address - self.destination_ip_address = destination_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.source_ip_address = kwargs.get('source_ip_address', None) + self.destination_ip_address = kwargs.get('destination_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_parameters_py3.py new file mode 100644 index 000000000000..50ee3d334e91 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_parameters_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopParameters(Model): + """Parameters that define the source and destination endpoint. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. + :type target_resource_id: str + :param source_ip_address: Required. The source IP address. + :type source_ip_address: str + :param destination_ip_address: Required. The destination IP address. + :type destination_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of the nics, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'source_ip_address': {'required': True}, + 'destination_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, + 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, source_ip_address: str, destination_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.source_ip_address = source_ip_address + self.destination_ip_address = destination_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_result.py index 1d4e7908be5c..f8071c7a363d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_result.py @@ -35,8 +35,8 @@ class NextHopResult(Model): 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, } - def __init__(self, next_hop_type=None, next_hop_ip_address=None, route_table_id=None): - super(NextHopResult, self).__init__() - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.route_table_id = route_table_id + def __init__(self, **kwargs): + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.route_table_id = kwargs.get('route_table_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_result_py3.py new file mode 100644 index 000000000000..7efd58ea8c0c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/next_hop_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopResult(Model): + """The information about next hop from the specified VM. + + :param next_hop_type: Next hop type. Possible values include: 'Internet', + 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', + 'HyperNetGateway', 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_10_01.models.NextHopType + :param next_hop_ip_address: Next hop IP Address + :type next_hop_ip_address: str + :param route_table_id: The resource identifier for the route table + associated with the route being returned. If the route being returned does + not correspond to any user created routes then this field will be the + string 'System Route'. + :type route_table_id: str + """ + + _attribute_map = { + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type=None, next_hop_ip_address: str=None, route_table_id: str=None, **kwargs) -> None: + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.route_table_id = route_table_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation.py index 0d3a855708d5..fb4126190b3c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation.py @@ -33,9 +33,9 @@ class Operation(Model): 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationPropertiesFormatServiceSpecification'}, } - def __init__(self, name=None, display=None, origin=None, service_specification=None): - super(Operation, self).__init__() - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_display.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_display.py index 91ea63defbf0..6e37c2433f56 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_display.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_display.py @@ -32,9 +32,9 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_display_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_display_py3.py new file mode 100644 index 000000000000..c0508a41bd48 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Network. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of the operation: get, read, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_properties_format_service_specification.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_properties_format_service_specification.py index 9bb07d4788ff..d4a209eb7bc1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_properties_format_service_specification.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_properties_format_service_specification.py @@ -28,7 +28,7 @@ class OperationPropertiesFormatServiceSpecification(Model): 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, } - def __init__(self, metric_specifications=None, log_specifications=None): - super(OperationPropertiesFormatServiceSpecification, self).__init__() - self.metric_specifications = metric_specifications - self.log_specifications = log_specifications + def __init__(self, **kwargs): + super(OperationPropertiesFormatServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + self.log_specifications = kwargs.get('log_specifications', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_properties_format_service_specification_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_properties_format_service_specification_py3.py new file mode 100644 index 000000000000..8f6cef8b1f7a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_properties_format_service_specification_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationPropertiesFormatServiceSpecification(Model): + """Specification of the service. + + :param metric_specifications: Operation service specification. + :type metric_specifications: + list[~azure.mgmt.network.v2017_10_01.models.MetricSpecification] + :param log_specifications: Operation log specification. + :type log_specifications: + list[~azure.mgmt.network.v2017_10_01.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, log_specifications=None, **kwargs) -> None: + super(OperationPropertiesFormatServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + self.log_specifications = log_specifications diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_py3.py new file mode 100644 index 000000000000..1da2f07cec5c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/operation_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Network REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.network.v2017_10_01.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param service_specification: Specification of the service. + :type service_specification: + ~azure.mgmt.network.v2017_10_01.models.OperationPropertiesFormatServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationPropertiesFormatServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/outbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/outbound_nat_rule.py index 4c7f58701c82..e4bbf3ad28c7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/outbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/outbound_nat_rule.py @@ -15,6 +15,8 @@ class OutboundNatRule(SubResource): """Outbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param allocated_outbound_ports: The number of outbound ports to be used @@ -24,8 +26,8 @@ class OutboundNatRule(SubResource): balancer. :type frontend_ip_configurations: list[~azure.mgmt.network.v2017_10_01.models.SubResource] - :param backend_address_pool: A reference to a pool of DIPs. Outbound - traffic is randomly load balanced across IPs in the backend IPs. + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. :type backend_address_pool: ~azure.mgmt.network.v2017_10_01.models.SubResource :param provisioning_state: Gets the provisioning state of the PublicIP @@ -53,11 +55,11 @@ class OutboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, backend_address_pool, id=None, allocated_outbound_ports=None, frontend_ip_configurations=None, provisioning_state=None, name=None, etag=None): - super(OutboundNatRule, self).__init__(id=id) - self.allocated_outbound_ports = allocated_outbound_ports - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pool = backend_address_pool - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(OutboundNatRule, self).__init__(**kwargs) + self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/outbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/outbound_nat_rule_py3.py new file mode 100644 index 000000000000..fb895be14974 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/outbound_nat_rule_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class OutboundNatRule(SubResource): + """Outbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param allocated_outbound_ports: The number of outbound ports to be used + for NAT. + :type allocated_outbound_ports: int + :param frontend_ip_configurations: The Frontend IP addresses of the load + balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_10_01.models.SubResource] + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_address_pool': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, backend_address_pool, id: str=None, allocated_outbound_ports: int=None, frontend_ip_configurations=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(OutboundNatRule, self).__init__(id=id, **kwargs) + self.allocated_outbound_ports = allocated_outbound_ports + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pool = backend_address_pool + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture.py index e61486a55bef..81ac42a8d6fa 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture.py @@ -15,8 +15,10 @@ class PacketCapture(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCapture(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_10_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCapture(Model): 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCapture, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCapture, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_filter.py index 33436dc93310..a13e10e539ce 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_filter.py @@ -51,10 +51,10 @@ class PacketCaptureFilter(Model): 'remote_port': {'key': 'remotePort', 'type': 'str'}, } - def __init__(self, protocol="Any", local_ip_address=None, remote_ip_address=None, local_port=None, remote_port=None): - super(PacketCaptureFilter, self).__init__() - self.protocol = protocol - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.local_port = local_port - self.remote_port = remote_port + def __init__(self, **kwargs): + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', "Any") + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_filter_py3.py new file mode 100644 index 000000000000..9c10676f3fe2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_filter_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureFilter(Model): + """Filter that is applied to packet capture request. Multiple filters can be + applied. + + :param protocol: Protocol to be filtered on. Possible values include: + 'TCP', 'UDP', 'Any'. Default value: "Any" . + :type protocol: str or ~azure.mgmt.network.v2017_10_01.models.PcProtocol + :param local_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type local_ip_address: str + :param remote_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type remote_ip_address: str + :param local_port: Local port to be filtered on. Notation: "80" for single + port entry."80-85" for range. "80;443;" for multiple entries. Multiple + ranges not currently supported. Mixing ranges with multiple entries not + currently supported. Default = null. + :type local_port: str + :param remote_port: Remote port to be filtered on. Notation: "80" for + single port entry."80-85" for range. "80;443;" for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple + entries not currently supported. Default = null. + :type remote_port: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + } + + def __init__(self, *, protocol="Any", local_ip_address: str=None, remote_ip_address: str=None, local_port: str=None, remote_port: str=None, **kwargs) -> None: + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = protocol + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.local_port = local_port + self.remote_port = remote_port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_parameters.py index 5f556f54e795..32837055dc49 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_parameters.py @@ -15,8 +15,10 @@ class PacketCaptureParameters(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCaptureParameters(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_10_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCaptureParameters(Model): 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCaptureParameters, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_parameters_py3.py new file mode 100644 index 000000000000..ec0327a90c4f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_parameters_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureParameters(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_10_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_10_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_py3.py new file mode 100644 index 000000000000..b98268d09d23 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCapture(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_10_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_10_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCapture, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_query_status_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_query_status_result.py index e2999e7ee958..542f8f8b5252 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_query_status_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_query_status_result.py @@ -43,11 +43,11 @@ class PacketCaptureQueryStatusResult(Model): 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, } - def __init__(self, name=None, id=None, capture_start_time=None, packet_capture_status=None, stop_reason=None, packet_capture_error=None): - super(PacketCaptureQueryStatusResult, self).__init__() - self.name = name - self.id = id - self.capture_start_time = capture_start_time - self.packet_capture_status = packet_capture_status - self.stop_reason = stop_reason - self.packet_capture_error = packet_capture_error + def __init__(self, **kwargs): + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.capture_start_time = kwargs.get('capture_start_time', None) + self.packet_capture_status = kwargs.get('packet_capture_status', None) + self.stop_reason = kwargs.get('stop_reason', None) + self.packet_capture_error = kwargs.get('packet_capture_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_query_status_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_query_status_result_py3.py new file mode 100644 index 000000000000..aa96cb0d3263 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_query_status_result_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureQueryStatusResult(Model): + """Status of packet capture session. + + :param name: The name of the packet capture resource. + :type name: str + :param id: The ID of the packet capture resource. + :type id: str + :param capture_start_time: The start time of the packet capture session. + :type capture_start_time: datetime + :param packet_capture_status: The status of the packet capture session. + Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', + 'Unknown' + :type packet_capture_status: str or + ~azure.mgmt.network.v2017_10_01.models.PcStatus + :param stop_reason: The reason the current packet capture session was + stopped. + :type stop_reason: str + :param packet_capture_error: List of errors of packet capture session. + :type packet_capture_error: list[str or + ~azure.mgmt.network.v2017_10_01.models.PcError] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, + 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, + 'stop_reason': {'key': 'stopReason', 'type': 'str'}, + 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, id: str=None, capture_start_time=None, packet_capture_status=None, stop_reason: str=None, packet_capture_error=None, **kwargs) -> None: + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = name + self.id = id + self.capture_start_time = capture_start_time + self.packet_capture_status = packet_capture_status + self.stop_reason = stop_reason + self.packet_capture_error = packet_capture_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_result.py index d065ca709d38..662f845d716e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_result.py @@ -18,6 +18,8 @@ class PacketCaptureResult(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar name: Name of the packet capture session. :vartype name: str :ivar id: ID of the packet capture operation. @@ -25,8 +27,8 @@ class PacketCaptureResult(Model): :param etag: Default value: "A unique read-only string that changes whenever the resource is updated." . :type etag: str - :param target: The ID of the targeted resource, only VM is currently - supported. + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -37,7 +39,7 @@ class PacketCaptureResult(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_10_01.models.PacketCaptureStorageLocation :param filters: @@ -70,15 +72,15 @@ class PacketCaptureResult(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, target, storage_location, etag="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None, provisioning_state=None): - super(PacketCaptureResult, self).__init__() + def __init__(self, **kwargs): + super(PacketCaptureResult, self).__init__(**kwargs) self.name = None self.id = None - self.etag = etag - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters - self.provisioning_state = provisioning_state + self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_result_py3.py new file mode 100644 index 000000000000..d03bdc0f8eff --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_result_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureResult(Model): + """Information about packet capture session. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the packet capture session. + :vartype name: str + :ivar id: ID of the packet capture operation. + :vartype id: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_10_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_10_01.models.PacketCaptureFilter] + :param provisioning_state: The provisioning state of the packet capture + session. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2017_10_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, target: str, storage_location, etag: str="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, provisioning_state=None, **kwargs) -> None: + super(PacketCaptureResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = etag + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_storage_location.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_storage_location.py index 773b04d22501..62ed83d592b3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_storage_location.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_storage_location.py @@ -35,8 +35,8 @@ class PacketCaptureStorageLocation(Model): 'file_path': {'key': 'filePath', 'type': 'str'}, } - def __init__(self, storage_id=None, storage_path=None, file_path=None): - super(PacketCaptureStorageLocation, self).__init__() - self.storage_id = storage_id - self.storage_path = storage_path - self.file_path = file_path + def __init__(self, **kwargs): + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) + self.file_path = kwargs.get('file_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_storage_location_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_storage_location_py3.py new file mode 100644 index 000000000000..6925dd4f9bdf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/packet_capture_storage_location_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureStorageLocation(Model): + """Describes the storage location for a packet capture session. + + :param storage_id: The ID of the storage account to save the packet + capture session. Required if no local file path is provided. + :type storage_id: str + :param storage_path: The URI of the storage path to save the packet + capture. Must be a well-formed URI describing the location to save the + packet capture. + :type storage_path: str + :param file_path: A valid local path on the targeting VM. Must include the + name of the capture file (*.cap). For linux virtual machine it must start + with /var/captures. Required if no storage ID is provided, otherwise + optional. + :type file_path: str + """ + + _attribute_map = { + 'storage_id': {'key': 'storageId', 'type': 'str'}, + 'storage_path': {'key': 'storagePath', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + } + + def __init__(self, *, storage_id: str=None, storage_path: str=None, file_path: str=None, **kwargs) -> None: + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = storage_id + self.storage_path = storage_path + self.file_path = file_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter.py index 10d3aba67a39..ddb91472dbaf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter.py @@ -60,12 +60,12 @@ class PatchRouteFilter(SubResource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, rules=None, peerings=None, tags=None): - super(PatchRouteFilter, self).__init__(id=id) - self.rules = rules - self.peerings = peerings + def __init__(self, **kwargs): + super(PatchRouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.peerings = kwargs.get('peerings', None) self.provisioning_state = None self.name = None self.etag = None self.type = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter_py3.py new file mode 100644 index 000000000000..94e5a9faad97 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilter(SubResource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2017_10_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, rules=None, peerings=None, tags=None, **kwargs) -> None: + super(PatchRouteFilter, self).__init__(id=id, **kwargs) + self.rules = rules + self.peerings = peerings + self.provisioning_state = None + self.name = None + self.etag = None + self.type = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter_rule.py index 9886161a12b7..ea31c3108ced 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter_rule.py @@ -18,16 +18,18 @@ class PatchRouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2017_10_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -64,11 +66,11 @@ class PatchRouteFilterRule(SubResource): route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, tags=None): - super(PatchRouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(PatchRouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None self.name = None self.etag = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter_rule_py3.py new file mode 100644 index 000000000000..2e9c96ba39d4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/patch_route_filter_rule_py3.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_10_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, tags=None, **kwargs) -> None: + super(PatchRouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = None + self.etag = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/probe.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/probe.py index 0679b86dbaa9..2c84429988d5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/probe.py @@ -18,20 +18,22 @@ class Probe(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar load_balancing_rules: The load balancer rules that use this probe. :vartype load_balancing_rules: list[~azure.mgmt.network.v2017_10_01.models.SubResource] - :param protocol: The protocol of the end point. Possible values are: - 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the - probe to be successful. If 'Http' is specified, a 200 OK response from the - specifies URI is required for the probe to be successful. Possible values - include: 'Http', 'Tcp' + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2017_10_01.models.ProbeProtocol - :param port: The port for communicating the probe. Possible values range - from 1 to 65535, inclusive. + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. :type port: int :param interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is @@ -78,14 +80,14 @@ class Probe(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, port, id=None, interval_in_seconds=None, number_of_probes=None, request_path=None, provisioning_state=None, name=None, etag=None): - super(Probe, self).__init__(id=id) + def __init__(self, **kwargs): + super(Probe, self).__init__(**kwargs) self.load_balancing_rules = None - self.protocol = protocol - self.port = port - self.interval_in_seconds = interval_in_seconds - self.number_of_probes = number_of_probes - self.request_path = request_path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.port = kwargs.get('port', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.number_of_probes = kwargs.get('number_of_probes', None) + self.request_path = kwargs.get('request_path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/probe_py3.py new file mode 100644 index 000000000000..1280387f35d7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Probe(SubResource): + """A load balancer probe. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar load_balancing_rules: The load balancer rules that use this probe. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_10_01.models.SubResource] + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_10_01.models.ProbeProtocol + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. + :type port: int + :param interval_in_seconds: The interval, in seconds, for how frequently + to probe the endpoint for health status. Typically, the interval is + slightly less than half the allocated timeout period (in seconds) which + allows two full probes before taking the instance out of rotation. The + default value is 15, the minimum value is 5. + :type interval_in_seconds: int + :param number_of_probes: The number of probes where if no response, will + result in stopping further traffic from being delivered to the endpoint. + This values allows endpoints to be taken out of rotation faster or slower + than the typical times used in Azure. + :type number_of_probes: int + :param request_path: The URI used for requesting health status from the + VM. Path is required if a protocol is set to http. Otherwise, it is not + allowed. There is no default value. + :type request_path: str + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'load_balancing_rules': {'readonly': True}, + 'protocol': {'required': True}, + 'port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, + 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, port: int, id: str=None, interval_in_seconds: int=None, number_of_probes: int=None, request_path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Probe, self).__init__(id=id, **kwargs) + self.load_balancing_rules = None + self.protocol = protocol + self.port = port + self.interval_in_seconds = interval_in_seconds + self.number_of_probes = number_of_probes + self.request_path = request_path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address.py index b3cf8d9b8c6d..f18021ba6597 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address.py @@ -91,16 +91,16 @@ class PublicIPAddress(Resource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address=None, idle_timeout_in_minutes=None, resource_guid=None, provisioning_state=None, etag=None, zones=None): - super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.public_ip_allocation_method = public_ip_allocation_method - self.public_ip_address_version = public_ip_address_version + def __init__(self, **kwargs): + super(PublicIPAddress, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) + self.public_ip_address_version = kwargs.get('public_ip_address_version', None) self.ip_configuration = None - self.dns_settings = dns_settings - self.ip_address = ip_address - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag - self.zones = zones + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_address = kwargs.get('ip_address', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_dns_settings.py index a248461f05d7..07dfe30433a6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_dns_settings.py @@ -38,8 +38,8 @@ class PublicIPAddressDnsSettings(Model): 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, } - def __init__(self, domain_name_label=None, fqdn=None, reverse_fqdn=None): - super(PublicIPAddressDnsSettings, self).__init__() - self.domain_name_label = domain_name_label - self.fqdn = fqdn - self.reverse_fqdn = reverse_fqdn + def __init__(self, **kwargs): + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) + self.fqdn = kwargs.get('fqdn', None) + self.reverse_fqdn = kwargs.get('reverse_fqdn', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_dns_settings_py3.py new file mode 100644 index 000000000000..e84aa9c10bf5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_dns_settings_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressDnsSettings(Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :param domain_name_label: Gets or sets the Domain name label.The + concatenation of the domain name label and the regionalized DNS zone make + up the fully qualified domain name associated with the public IP address. + If a domain name label is specified, an A DNS record is created for the + public IP in the Microsoft Azure DNS system. + :type domain_name_label: str + :param fqdn: Gets the FQDN, Fully qualified domain name of the A DNS + record associated with the public IP. This is the concatenation of the + domainNameLabel and the regionalized DNS zone. + :type fqdn: str + :param reverse_fqdn: Gets or Sets the Reverse FQDN. A user-visible, fully + qualified domain name that resolves to this public IP address. If the + reverseFqdn is specified, then a PTR DNS record is created pointing from + the IP address in the in-addr.arpa domain to the reverse FQDN. + :type reverse_fqdn: str + """ + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, + } + + def __init__(self, *, domain_name_label: str=None, fqdn: str=None, reverse_fqdn: str=None, **kwargs) -> None: + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label + self.fqdn = fqdn + self.reverse_fqdn = reverse_fqdn diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_py3.py new file mode 100644 index 000000000000..51c0c061329e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_py3.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PublicIPAddress(Resource): + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The public IP address SKU. + :type sku: ~azure.mgmt.network.v2017_10_01.models.PublicIPAddressSku + :param public_ip_allocation_method: The public IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type public_ip_allocation_method: str or + ~azure.mgmt.network.v2017_10_01.models.IPAllocationMethod + :param public_ip_address_version: The public IP address version. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + :type public_ip_address_version: str or + ~azure.mgmt.network.v2017_10_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP + address. + :vartype ip_configuration: + ~azure.mgmt.network.v2017_10_01.models.IPConfiguration + :param dns_settings: The FQDN of the DNS record associated with the public + IP address. + :type dns_settings: + ~azure.mgmt.network.v2017_10_01.models.PublicIPAddressDnsSettings + :param ip_address: The IP address associated with the public IP address + resource. + :type ip_address: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param resource_guid: The resource GUID property of the public IP + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_address: str=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, zones=None, **kwargs) -> None: + super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.public_ip_allocation_method = public_ip_allocation_method + self.public_ip_address_version = public_ip_address_version + self.ip_configuration = None + self.dns_settings = dns_settings + self.ip_address = ip_address + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag + self.zones = zones diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_sku.py index 0adb0b21dcf3..d5bc3f6d48b4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_sku.py @@ -25,6 +25,6 @@ class PublicIPAddressSku(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - super(PublicIPAddressSku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_sku_py3.py new file mode 100644 index 000000000000..e284b2b76540 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/public_ip_address_sku_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressSku(Model): + """SKU of a public IP address. + + :param name: Name of a public IP address SKU. Possible values include: + 'Basic', 'Standard' + :type name: str or + ~azure.mgmt.network.v2017_10_01.models.PublicIPAddressSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/query_troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/query_troubleshooting_parameters.py index 9b6801eb7b63..6ae1924916c6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/query_troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/query_troubleshooting_parameters.py @@ -15,7 +15,9 @@ class QueryTroubleshootingParameters(Model): """Parameters that define the resource to query the troubleshooting result. - :param target_resource_id: The target resource ID to query the + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the troubleshooting result. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class QueryTroubleshootingParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(QueryTroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/query_troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/query_troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..b5fccb87857c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/query_troubleshooting_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryTroubleshootingParameters(Model): + """Parameters that define the resource to query the troubleshooting result. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the + troubleshooting result. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource.py index ff5f1f40e14e..7dabab29ac9d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource.py @@ -43,10 +43,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, location=None, tags=None): - super(Resource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource_navigation_link.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource_navigation_link.py index 9b4484be654a..705698f513f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource_navigation_link.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource_navigation_link.py @@ -49,10 +49,10 @@ class ResourceNavigationLink(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, linked_resource_type=None, link=None, name=None): - super(ResourceNavigationLink, self).__init__(id=id) - self.linked_resource_type = linked_resource_type - self.link = link + def __init__(self, **kwargs): + super(ResourceNavigationLink, self).__init__(**kwargs) + self.linked_resource_type = kwargs.get('linked_resource_type', None) + self.link = kwargs.get('link', None) self.provisioning_state = None - self.name = name + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource_navigation_link_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource_navigation_link_py3.py new file mode 100644 index 000000000000..5cb22d347836 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource_navigation_link_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ResourceNavigationLink(SubResource): + """ResourceNavigationLink resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource + :type link: str + :ivar provisioning_state: Provisioning state of the ResourceNavigationLink + resource. + :vartype provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, linked_resource_type: str=None, link: str=None, name: str=None, **kwargs) -> None: + super(ResourceNavigationLink, self).__init__(id=id, **kwargs) + self.linked_resource_type = linked_resource_type + self.link = link + self.provisioning_state = None + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource_py3.py new file mode 100644 index 000000000000..ae95b78b4f23 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/resource_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Common resource representation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/retention_policy_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/retention_policy_parameters.py index 102f4c5c3b4c..28cb43056d47 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/retention_policy_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/retention_policy_parameters.py @@ -26,7 +26,7 @@ class RetentionPolicyParameters(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, days=0, enabled=False): - super(RetentionPolicyParameters, self).__init__() - self.days = days - self.enabled = enabled + def __init__(self, **kwargs): + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = kwargs.get('days', 0) + self.enabled = kwargs.get('enabled', False) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/retention_policy_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/retention_policy_parameters_py3.py new file mode 100644 index 000000000000..3b2ffc5e741e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/retention_policy_parameters_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RetentionPolicyParameters(Model): + """Parameters that define the retention policy for flow log. + + :param days: Number of days to retain flow log records. Default value: 0 . + :type days: int + :param enabled: Flag to enable/disable retention. Default value: False . + :type enabled: bool + """ + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, days: int=0, enabled: bool=False, **kwargs) -> None: + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = days + self.enabled = enabled diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route.py index a64255e5a853..e6be06746c79 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route.py @@ -15,13 +15,15 @@ class Route(SubResource): """Route resource. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param address_prefix: The destination CIDR to which the route applies. :type address_prefix: str - :param next_hop_type: The type of Azure hop the packet should be sent to. - Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - 'VirtualAppliance', and 'None'. Possible values include: + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' :type next_hop_type: str or @@ -55,11 +57,11 @@ class Route(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, next_hop_type, id=None, address_prefix=None, next_hop_ip_address=None, provisioning_state=None, name=None, etag=None): - super(Route, self).__init__(id=id) - self.address_prefix = address_prefix - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(Route, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter.py index 2fb1830face8..10e88aea47af 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter.py @@ -62,9 +62,9 @@ class RouteFilter(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, rules=None, peerings=None): - super(RouteFilter, self).__init__(id=id, location=location, tags=tags) - self.rules = rules - self.peerings = peerings + def __init__(self, **kwargs): + super(RouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.peerings = kwargs.get('peerings', None) self.provisioning_state = None self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter_py3.py new file mode 100644 index 000000000000..a36abdd4ccb7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteFilter(Resource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2017_10_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, rules=None, peerings=None, **kwargs) -> None: + super(RouteFilter, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.rules = rules + self.peerings = peerings + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter_rule.py index 26739bf4ef3e..c355f7c9830e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter_rule.py @@ -18,16 +18,18 @@ class RouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2017_10_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -66,12 +68,12 @@ class RouteFilterRule(SubResource): route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, name=None, location=None, tags=None): - super(RouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(RouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None - self.name = name - self.location = location + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) self.etag = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter_rule_py3.py new file mode 100644 index 000000000000..f8f7c54fd5b0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_filter_rule_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class RouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_10_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param location: Resource location. + :type location: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, name: str=None, location: str=None, tags=None, **kwargs) -> None: + super(RouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = name + self.location = location + self.etag = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_py3.py new file mode 100644 index 000000000000..4eab20a96607 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Route(SubResource): + """Route resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param address_prefix: The destination CIDR to which the route applies. + :type address_prefix: str + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_10_01.models.RouteNextHopType + :param next_hop_ip_address: The IP address packets should be forwarded to. + Next hop values are only allowed in routes where the next hop type is + VirtualAppliance. + :type next_hop_ip_address: str + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'next_hop_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type, id: str=None, address_prefix: str=None, next_hop_ip_address: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Route, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_table.py index 560ec76cc201..6b037836accf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_table.py @@ -62,10 +62,10 @@ class RouteTable(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, routes=None, disable_bgp_route_propagation=None, provisioning_state=None, etag=None): - super(RouteTable, self).__init__(id=id, location=location, tags=tags) - self.routes = routes + def __init__(self, **kwargs): + super(RouteTable, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) self.subnets = None - self.disable_bgp_route_propagation = disable_bgp_route_propagation - self.provisioning_state = provisioning_state - self.etag = etag + self.disable_bgp_route_propagation = kwargs.get('disable_bgp_route_propagation', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_table_py3.py new file mode 100644 index 000000000000..91ea99bce571 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/route_table_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteTable(Resource): + """Route table resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param routes: Collection of routes contained within a route table. + :type routes: list[~azure.mgmt.network.v2017_10_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2017_10_01.models.Subnet] + :param disable_bgp_route_propagation: Gets or sets whether to disable the + routes learned by BGP on that route table. True means disable. + :type disable_bgp_route_propagation: bool + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'routes': {'key': 'properties.routes', 'type': '[Route]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'disable_bgp_route_propagation': {'key': 'properties.disableBgpRoutePropagation', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, routes=None, disable_bgp_route_propagation: bool=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(RouteTable, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.routes = routes + self.subnets = None + self.disable_bgp_route_propagation = disable_bgp_route_propagation + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_network_interface.py index e82029b238c1..a89a67db9cf2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_network_interface.py @@ -27,7 +27,7 @@ class SecurityGroupNetworkInterface(Model): 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, } - def __init__(self, id=None, security_rule_associations=None): - super(SecurityGroupNetworkInterface, self).__init__() - self.id = id - self.security_rule_associations = security_rule_associations + def __init__(self, **kwargs): + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.security_rule_associations = kwargs.get('security_rule_associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_network_interface_py3.py new file mode 100644 index 000000000000..befa56022010 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_network_interface_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupNetworkInterface(Model): + """Network interface and all its associated security rules. + + :param id: ID of the network interface. + :type id: str + :param security_rule_associations: + :type security_rule_associations: + ~azure.mgmt.network.v2017_10_01.models.SecurityRuleAssociations + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, + } + + def __init__(self, *, id: str=None, security_rule_associations=None, **kwargs) -> None: + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = id + self.security_rule_associations = security_rule_associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_parameters.py index 5c0972e5d55e..1d547b0b0e2b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_parameters.py @@ -15,7 +15,9 @@ class SecurityGroupViewParameters(Model): """Parameters that define the VM to check security groups for. - :param target_resource_id: ID of the target VM. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. :type target_resource_id: str """ @@ -27,6 +29,6 @@ class SecurityGroupViewParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(SecurityGroupViewParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_parameters_py3.py new file mode 100644 index 000000000000..7ccc48017444 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_parameters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewParameters(Model): + """Parameters that define the VM to check security groups for. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_result.py index cc51a5445369..6f1968f20f7d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_result.py @@ -24,6 +24,6 @@ class SecurityGroupViewResult(Model): 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, } - def __init__(self, network_interfaces=None): - super(SecurityGroupViewResult, self).__init__() - self.network_interfaces = network_interfaces + def __init__(self, **kwargs): + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_result_py3.py new file mode 100644 index 000000000000..f31ad2f2f59d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_group_view_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewResult(Model): + """The information about security rules applied to the specified VM. + + :param network_interfaces: List of network interfaces on the specified VM. + :type network_interfaces: + list[~azure.mgmt.network.v2017_10_01.models.SecurityGroupNetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule.py index c2f1f923a436..c9b361a1c82a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule.py @@ -15,12 +15,15 @@ class SecurityRule(SubResource): """Network security rule. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param description: A description for this rule. Restricted to 140 chars. :type description: str - :param protocol: Network protocol this rule applies to. Possible values - are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*' + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' :type protocol: str or ~azure.mgmt.network.v2017_10_01.models.SecurityRuleProtocol :param source_port_range: The source port or range. Integer or range @@ -57,8 +60,9 @@ class SecurityRule(SubResource): :type source_port_ranges: list[str] :param destination_port_ranges: The destination port ranges. :type destination_port_ranges: list[str] - :param access: The network traffic is allowed or denied. Possible values - are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' :type access: str or ~azure.mgmt.network.v2017_10_01.models.SecurityRuleAccess :param priority: The priority of the rule. The value can be between 100 @@ -66,10 +70,10 @@ class SecurityRule(SubResource): collection. The lower the priority number, the higher the priority of the rule. :type priority: int - :param direction: The direction of the rule. The direction specifies if - rule will be evaluated on incoming or outcoming traffic. Possible values - are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', - 'Outbound' + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2017_10_01.models.SecurityRuleDirection :param provisioning_state: The provisioning state of the public IP @@ -111,23 +115,23 @@ class SecurityRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, source_address_prefix=None, destination_address_prefix=None, access=None, direction=None, id=None, description=None, source_port_range=None, destination_port_range=None, source_address_prefixes=None, source_application_security_groups=None, destination_address_prefixes=None, destination_application_security_groups=None, source_port_ranges=None, destination_port_ranges=None, priority=None, provisioning_state=None, name=None, etag=None): - super(SecurityRule, self).__init__(id=id) - self.description = description - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_address_prefix = source_address_prefix - self.source_address_prefixes = source_address_prefixes - self.source_application_security_groups = source_application_security_groups - self.destination_address_prefix = destination_address_prefix - self.destination_address_prefixes = destination_address_prefixes - self.destination_application_security_groups = destination_application_security_groups - self.source_port_ranges = source_port_ranges - self.destination_port_ranges = destination_port_ranges - self.access = access - self.priority = priority - self.direction = direction - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(SecurityRule, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.source_application_security_groups = kwargs.get('source_application_security_groups', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.destination_application_security_groups = kwargs.get('destination_application_security_groups', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule_associations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule_associations.py index 72c3217ea4c7..f12f73390f04 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule_associations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule_associations.py @@ -37,9 +37,9 @@ class SecurityRuleAssociations(Model): 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, } - def __init__(self, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None): - super(SecurityRuleAssociations, self).__init__() - self.network_interface_association = network_interface_association - self.subnet_association = subnet_association - self.default_security_rules = default_security_rules - self.effective_security_rules = effective_security_rules + def __init__(self, **kwargs): + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = kwargs.get('network_interface_association', None) + self.subnet_association = kwargs.get('subnet_association', None) + self.default_security_rules = kwargs.get('default_security_rules', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule_associations_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule_associations_py3.py new file mode 100644 index 000000000000..a7189b5b23e2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule_associations_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityRuleAssociations(Model): + """All security rules associated with the network interface. + + :param network_interface_association: + :type network_interface_association: + ~azure.mgmt.network.v2017_10_01.models.NetworkInterfaceAssociation + :param subnet_association: + :type subnet_association: + ~azure.mgmt.network.v2017_10_01.models.SubnetAssociation + :param default_security_rules: Collection of default security rules of the + network security group. + :type default_security_rules: + list[~azure.mgmt.network.v2017_10_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2017_10_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, + 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, + 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__(self, *, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None, **kwargs) -> None: + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = network_interface_association + self.subnet_association = subnet_association + self.default_security_rules = default_security_rules + self.effective_security_rules = effective_security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule_py3.py new file mode 100644 index 000000000000..c8ebf259caca --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/security_rule_py3.py @@ -0,0 +1,137 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class SecurityRule(SubResource): + """Network security rule. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2017_10_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. Integer or range + between 0 and 65535. Asterix '*' can also be used to match all ports. + :type source_port_range: str + :param destination_port_range: The destination port or range. Integer or + range between 0 and 65535. Asterix '*' can also be used to match all + ports. + :type destination_port_range: str + :param source_address_prefix: The CIDR or source IP range. Asterix '*' can + also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + this is an ingress rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param source_address_prefixes: The CIDR or source IP ranges. + :type source_address_prefixes: list[str] + :param source_application_security_groups: The application security group + specified as source. + :type source_application_security_groups: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroup] + :param destination_address_prefix: The destination address prefix. CIDR or + destination IP range. Asterix '*' can also be used to match all source + IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. + :type destination_address_prefix: str + :param destination_address_prefixes: The destination address prefixes. + CIDR or destination IP ranges. + :type destination_address_prefixes: list[str] + :param destination_application_security_groups: The application security + group specified as destination. + :type destination_application_security_groups: + list[~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroup] + :param source_port_ranges: The source port ranges. + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. + :type destination_port_ranges: list[str] + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' + :type access: str or + ~azure.mgmt.network.v2017_10_01.models.SecurityRuleAccess + :param priority: The priority of the rule. The value can be between 100 + and 4096. The priority number must be unique for each rule in the + collection. The lower the priority number, the higher the priority of the + rule. + :type priority: int + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2017_10_01.models.SecurityRuleDirection + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'access': {'required': True}, + 'direction': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'properties.sourceAddressPrefixes', 'type': '[str]'}, + 'source_application_security_groups': {'key': 'properties.sourceApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, + 'destination_address_prefixes': {'key': 'properties.destinationAddressPrefixes', 'type': '[str]'}, + 'destination_application_security_groups': {'key': 'properties.destinationApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'source_port_ranges': {'key': 'properties.sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'properties.destinationPortRanges', 'type': '[str]'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, access, direction, id: str=None, description: str=None, source_port_range: str=None, destination_port_range: str=None, source_address_prefix: str=None, source_address_prefixes=None, source_application_security_groups=None, destination_address_prefix: str=None, destination_address_prefixes=None, destination_application_security_groups=None, source_port_ranges=None, destination_port_ranges=None, priority: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(SecurityRule, self).__init__(id=id, **kwargs) + self.description = description + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.source_address_prefixes = source_address_prefixes + self.source_application_security_groups = source_application_security_groups + self.destination_address_prefix = destination_address_prefix + self.destination_address_prefixes = destination_address_prefixes + self.destination_application_security_groups = destination_application_security_groups + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/service_endpoint_properties_format.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/service_endpoint_properties_format.py index 847cb9ac8b3b..87ca01e64540 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/service_endpoint_properties_format.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/service_endpoint_properties_format.py @@ -29,8 +29,8 @@ class ServiceEndpointPropertiesFormat(Model): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } - def __init__(self, service=None, locations=None, provisioning_state=None): - super(ServiceEndpointPropertiesFormat, self).__init__() - self.service = service - self.locations = locations - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = kwargs.get('service', None) + self.locations = kwargs.get('locations', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/service_endpoint_properties_format_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/service_endpoint_properties_format_py3.py new file mode 100644 index 000000000000..8d3d2e5e8347 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/service_endpoint_properties_format_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceEndpointPropertiesFormat(Model): + """The service endpoint properties. + + :param service: The type of the endpoint service. + :type service: str + :param locations: A list of locations. + :type locations: list[str] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + """ + + _attribute_map = { + 'service': {'key': 'service', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, service: str=None, locations=None, provisioning_state: str=None, **kwargs) -> None: + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = service + self.locations = locations + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/sub_resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/sub_resource.py index 491f1d1caf83..6ab81f55f21b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/sub_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/sub_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/sub_resource_py3.py new file mode 100644 index 000000000000..8f4c4c816061 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """Reference to another subresource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet.py index b122a169ccde..7470d82c1ce6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet.py @@ -66,14 +66,14 @@ class Subnet(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, address_prefix=None, network_security_group=None, route_table=None, service_endpoints=None, resource_navigation_links=None, provisioning_state=None, name=None, etag=None): - super(Subnet, self).__init__(id=id) - self.address_prefix = address_prefix - self.network_security_group = network_security_group - self.route_table = route_table - self.service_endpoints = service_endpoints + def __init__(self, **kwargs): + super(Subnet, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.route_table = kwargs.get('route_table', None) + self.service_endpoints = kwargs.get('service_endpoints', None) self.ip_configurations = None - self.resource_navigation_links = resource_navigation_links - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.resource_navigation_links = kwargs.get('resource_navigation_links', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet_association.py index 6eaa391d31e6..50a3cf2b7bbd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet_association.py @@ -34,7 +34,7 @@ class SubnetAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(SubnetAssociation, self).__init__() + def __init__(self, **kwargs): + super(SubnetAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet_association_py3.py new file mode 100644 index 000000000000..d7f54e168715 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Subnet ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2017_10_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(SubnetAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet_py3.py new file mode 100644 index 000000000000..eb563ab1c720 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/subnet_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Subnet(SubResource): + """Subnet in a virtual network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param address_prefix: The address prefix for the subnet. + :type address_prefix: str + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroup + :param route_table: The reference of the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2017_10_01.models.RouteTable + :param service_endpoints: An array of service endpoints. + :type service_endpoints: + list[~azure.mgmt.network.v2017_10_01.models.ServiceEndpointPropertiesFormat] + :ivar ip_configurations: Gets an array of references to the network + interface IP configurations using subnet. + :vartype ip_configurations: + list[~azure.mgmt.network.v2017_10_01.models.IPConfiguration] + :param resource_navigation_links: Gets an array of references to the + external resources using subnet. + :type resource_navigation_links: + list[~azure.mgmt.network.v2017_10_01.models.ResourceNavigationLink] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'ip_configurations': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, + 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, address_prefix: str=None, network_security_group=None, route_table=None, service_endpoints=None, resource_navigation_links=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Subnet, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.network_security_group = network_security_group + self.route_table = route_table + self.service_endpoints = service_endpoints + self.ip_configurations = None + self.resource_navigation_links = resource_navigation_links + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tags_object.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tags_object.py index 539129368be9..2966ec220f94 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tags_object.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tags_object.py @@ -23,6 +23,6 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, tags=None): - super(TagsObject, self).__init__() - self.tags = tags + def __init__(self, **kwargs): + super(TagsObject, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tags_object_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tags_object_py3.py new file mode 100644 index 000000000000..8be0bb4a15d7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tags_object_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagsObject(Model): + """Tags object for patch operations. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsObject, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology.py index 27e00ea286e0..654812f7f594 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology.py @@ -43,9 +43,9 @@ class Topology(Model): 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, } - def __init__(self, resources=None): - super(Topology, self).__init__() + def __init__(self, **kwargs): + super(Topology, self).__init__(**kwargs) self.id = None self.created_date_time = None self.last_modified = None - self.resources = resources + self.resources = kwargs.get('resources', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_association.py index ed5dd30a5b95..253ceabc6f24 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_association.py @@ -33,8 +33,8 @@ class TopologyAssociation(Model): 'association_type': {'key': 'associationType', 'type': 'str'}, } - def __init__(self, name=None, resource_id=None, association_type=None): - super(TopologyAssociation, self).__init__() - self.name = name - self.resource_id = resource_id - self.association_type = association_type + def __init__(self, **kwargs): + super(TopologyAssociation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.resource_id = kwargs.get('resource_id', None) + self.association_type = kwargs.get('association_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_association_py3.py new file mode 100644 index 000000000000..5142d676f5ce --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyAssociation(Model): + """Resources that have an association with the parent resource. + + :param name: The name of the resource that is associated with the parent + resource. + :type name: str + :param resource_id: The ID of the resource that is associated with the + parent resource. + :type resource_id: str + :param association_type: The association type of the child resource to the + parent resource. Possible values include: 'Associated', 'Contains' + :type association_type: str or + ~azure.mgmt.network.v2017_10_01.models.AssociationType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'association_type': {'key': 'associationType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, resource_id: str=None, association_type=None, **kwargs) -> None: + super(TopologyAssociation, self).__init__(**kwargs) + self.name = name + self.resource_id = resource_id + self.association_type = association_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_parameters.py index f53c2533dae5..32b2cffe2373 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_parameters.py @@ -32,8 +32,8 @@ class TopologyParameters(Model): 'target_subnet': {'key': 'targetSubnet', 'type': 'SubResource'}, } - def __init__(self, target_resource_group_name=None, target_virtual_network=None, target_subnet=None): - super(TopologyParameters, self).__init__() - self.target_resource_group_name = target_resource_group_name - self.target_virtual_network = target_virtual_network - self.target_subnet = target_subnet + def __init__(self, **kwargs): + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = kwargs.get('target_resource_group_name', None) + self.target_virtual_network = kwargs.get('target_virtual_network', None) + self.target_subnet = kwargs.get('target_subnet', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_parameters_py3.py new file mode 100644 index 000000000000..fcb65b532f4d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_parameters_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyParameters(Model): + """Parameters that define the representation of topology. + + :param target_resource_group_name: The name of the target resource group + to perform topology on. + :type target_resource_group_name: str + :param target_virtual_network: The reference of the Virtual Network + resource. + :type target_virtual_network: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param target_subnet: The reference of the Subnet resource. + :type target_subnet: ~azure.mgmt.network.v2017_10_01.models.SubResource + """ + + _attribute_map = { + 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, + 'target_virtual_network': {'key': 'targetVirtualNetwork', 'type': 'SubResource'}, + 'target_subnet': {'key': 'targetSubnet', 'type': 'SubResource'}, + } + + def __init__(self, *, target_resource_group_name: str=None, target_virtual_network=None, target_subnet=None, **kwargs) -> None: + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = target_resource_group_name + self.target_virtual_network = target_virtual_network + self.target_subnet = target_subnet diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_py3.py new file mode 100644 index 000000000000..541e98d69561 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Topology(Model): + """Topology of the specified resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: GUID representing the operation id. + :vartype id: str + :ivar created_date_time: The datetime when the topology was initially + created for the resource group. + :vartype created_date_time: datetime + :ivar last_modified: The datetime when the topology was last modified. + :vartype last_modified: datetime + :param resources: + :type resources: + list[~azure.mgmt.network.v2017_10_01.models.TopologyResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, + } + + def __init__(self, *, resources=None, **kwargs) -> None: + super(Topology, self).__init__(**kwargs) + self.id = None + self.created_date_time = None + self.last_modified = None + self.resources = resources diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_resource.py index 1888f92be224..6dd4c4c957eb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_resource.py @@ -34,9 +34,9 @@ class TopologyResource(Model): 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, } - def __init__(self, name=None, id=None, location=None, associations=None): - super(TopologyResource, self).__init__() - self.name = name - self.id = id - self.location = location - self.associations = associations + def __init__(self, **kwargs): + super(TopologyResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.associations = kwargs.get('associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_resource_py3.py new file mode 100644 index 000000000000..3124ffa77325 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/topology_resource_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyResource(Model): + """The network resource topology information for the given resource group. + + :param name: Name of the resource. + :type name: str + :param id: ID of the resource. + :type id: str + :param location: Resource location. + :type location: str + :param associations: Holds the associations the resource has with other + resources in the resource group. + :type associations: + list[~azure.mgmt.network.v2017_10_01.models.TopologyAssociation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, + } + + def __init__(self, *, name: str=None, id: str=None, location: str=None, associations=None, **kwargs) -> None: + super(TopologyResource, self).__init__(**kwargs) + self.name = name + self.id = id + self.location = location + self.associations = associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_details.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_details.py index 5acc197c3012..9aee1c849949 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_details.py @@ -36,10 +36,10 @@ class TroubleshootingDetails(Model): 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, } - def __init__(self, id=None, reason_type=None, summary=None, detail=None, recommended_actions=None): - super(TroubleshootingDetails, self).__init__() - self.id = id - self.reason_type = reason_type - self.summary = summary - self.detail = detail - self.recommended_actions = recommended_actions + def __init__(self, **kwargs): + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.reason_type = kwargs.get('reason_type', None) + self.summary = kwargs.get('summary', None) + self.detail = kwargs.get('detail', None) + self.recommended_actions = kwargs.get('recommended_actions', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_details_py3.py new file mode 100644 index 000000000000..8d8da261180f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_details_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingDetails(Model): + """Information gained from troubleshooting of specified resource. + + :param id: The id of the get troubleshoot operation. + :type id: str + :param reason_type: Reason type of failure. + :type reason_type: str + :param summary: A summary of troubleshooting. + :type summary: str + :param detail: Details on troubleshooting results. + :type detail: str + :param recommended_actions: List of recommended actions. + :type recommended_actions: + list[~azure.mgmt.network.v2017_10_01.models.TroubleshootingRecommendedActions] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'reason_type': {'key': 'reasonType', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'detail': {'key': 'detail', 'type': 'str'}, + 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, + } + + def __init__(self, *, id: str=None, reason_type: str=None, summary: str=None, detail: str=None, recommended_actions=None, **kwargs) -> None: + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = id + self.reason_type = reason_type + self.summary = summary + self.detail = detail + self.recommended_actions = recommended_actions diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_parameters.py index c4833fb8eeb3..6b11d3eb5ffc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_parameters.py @@ -15,13 +15,15 @@ class TroubleshootingParameters(Model): """Parameters that define the resource to troubleshoot. - :param target_resource_id: The target resource to troubleshoot. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. :type target_resource_id: str - :param storage_id: The ID for the storage account to save the troubleshoot - result. + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. :type storage_id: str - :param storage_path: The path to the blob to save the troubleshoot result - in. + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. :type storage_path: str """ @@ -37,8 +39,8 @@ class TroubleshootingParameters(Model): 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, } - def __init__(self, target_resource_id, storage_id, storage_path): - super(TroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.storage_path = storage_path + def __init__(self, **kwargs): + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..e010b7bdc9de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_parameters_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingParameters(Model): + """Parameters that define the resource to troubleshoot. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. + :type target_resource_id: str + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. + :type storage_id: str + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. + :type storage_path: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'storage_path': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, storage_path: str, **kwargs) -> None: + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.storage_path = storage_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_recommended_actions.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_recommended_actions.py index cbc5e31177c7..be395be4ad54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_recommended_actions.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_recommended_actions.py @@ -34,9 +34,9 @@ class TroubleshootingRecommendedActions(Model): 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, } - def __init__(self, action_id=None, action_text=None, action_uri=None, action_uri_text=None): - super(TroubleshootingRecommendedActions, self).__init__() - self.action_id = action_id - self.action_text = action_text - self.action_uri = action_uri - self.action_uri_text = action_uri_text + def __init__(self, **kwargs): + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = kwargs.get('action_id', None) + self.action_text = kwargs.get('action_text', None) + self.action_uri = kwargs.get('action_uri', None) + self.action_uri_text = kwargs.get('action_uri_text', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_recommended_actions_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_recommended_actions_py3.py new file mode 100644 index 000000000000..05c3f654353b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_recommended_actions_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingRecommendedActions(Model): + """Recommended actions based on discovered issues. + + :param action_id: ID of the recommended action. + :type action_id: str + :param action_text: Description of recommended actions. + :type action_text: str + :param action_uri: The uri linking to a documentation for the recommended + troubleshooting actions. + :type action_uri: str + :param action_uri_text: The information from the URI for the recommended + troubleshooting actions. + :type action_uri_text: str + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'action_text': {'key': 'actionText', 'type': 'str'}, + 'action_uri': {'key': 'actionUri', 'type': 'str'}, + 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, + } + + def __init__(self, *, action_id: str=None, action_text: str=None, action_uri: str=None, action_uri_text: str=None, **kwargs) -> None: + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = action_id + self.action_text = action_text + self.action_uri = action_uri + self.action_uri_text = action_uri_text diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_result.py index bce20980a2c0..de58f51dd069 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_result.py @@ -33,9 +33,9 @@ class TroubleshootingResult(Model): 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, } - def __init__(self, start_time=None, end_time=None, code=None, results=None): - super(TroubleshootingResult, self).__init__() - self.start_time = start_time - self.end_time = end_time - self.code = code - self.results = results + def __init__(self, **kwargs): + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.code = kwargs.get('code', None) + self.results = kwargs.get('results', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_result_py3.py new file mode 100644 index 000000000000..f1f3c43b3c2e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/troubleshooting_result_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingResult(Model): + """Troubleshooting information gained from specified resource. + + :param start_time: The start time of the troubleshooting. + :type start_time: datetime + :param end_time: The end time of the troubleshooting. + :type end_time: datetime + :param code: The result code of the troubleshooting. + :type code: str + :param results: Information from troubleshooting. + :type results: + list[~azure.mgmt.network.v2017_10_01.models.TroubleshootingDetails] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, + } + + def __init__(self, *, start_time=None, end_time=None, code: str=None, results=None, **kwargs) -> None: + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.code = code + self.results = results diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tunnel_connection_health.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tunnel_connection_health.py index 231b3ef25648..5630c214c058 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tunnel_connection_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tunnel_connection_health.py @@ -52,8 +52,8 @@ class TunnelConnectionHealth(Model): 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, } - def __init__(self): - super(TunnelConnectionHealth, self).__init__() + def __init__(self, **kwargs): + super(TunnelConnectionHealth, self).__init__(**kwargs) self.tunnel = None self.connection_status = None self.ingress_bytes_transferred = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tunnel_connection_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tunnel_connection_health_py3.py new file mode 100644 index 000000000000..927152bfdd4b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/tunnel_connection_health_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TunnelConnectionHealth(Model): + """VirtualNetworkGatewayConnection properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tunnel: Tunnel name. + :vartype tunnel: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values include: 'Unknown', 'Connecting', 'Connected', + 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnectionStatus + :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this + connection + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: The Egress Bytes Transferred in this + connection + :vartype egress_bytes_transferred: long + :ivar last_connection_established_utc_time: The time at which connection + was established in Utc format. + :vartype last_connection_established_utc_time: str + """ + + _validation = { + 'tunnel': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'last_connection_established_utc_time': {'readonly': True}, + } + + _attribute_map = { + 'tunnel': {'key': 'tunnel', 'type': 'str'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TunnelConnectionHealth, self).__init__(**kwargs) + self.tunnel = None + self.connection_status = None + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.last_connection_established_utc_time = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage.py index 62f58c028e7b..d2465f38f5ce 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage.py @@ -18,16 +18,18 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource identifier. :vartype id: str - :ivar unit: An enum describing the unit of measurement. Default value: - "Count" . + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . :vartype unit: str - :param current_value: The current value of the usage. + :param current_value: Required. The current value of the usage. :type current_value: long - :param limit: The limit of usage. + :param limit: Required. The limit of usage. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.network.v2017_10_01.models.UsageName """ @@ -49,9 +51,9 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.id = None - self.current_value = current_value - self.limit = limit - self.name = name + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage_name.py index df7f344bfb9b..bd1813944fdc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage_name_py3.py new file mode 100644 index 000000000000..4e5e3e10de15 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage_py3.py new file mode 100644 index 000000000000..0607e42d208e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/usage_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes network resource usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource identifier. + :vartype id: str + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . + :vartype unit: str + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.network.v2017_10_01.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.id = None + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_parameters.py index 8bfff5e60bc3..cb9f63b4472c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_parameters.py @@ -15,28 +15,30 @@ class VerificationIPFlowParameters(Model): """Parameters that define the IP flow to be verified. - :param target_resource_id: The ID of the target resource to perform - next-hop on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. :type target_resource_id: str - :param direction: The direction of the packet represented as a 5-tuple. - Possible values include: 'Inbound', 'Outbound' + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2017_10_01.models.Direction - :param protocol: Protocol to be verified on. Possible values include: - 'TCP', 'UDP' + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' :type protocol: str or ~azure.mgmt.network.v2017_10_01.models.Protocol - :param local_port: The local port. Acceptable values are a single integer - in the range (0-65535). Support for * for the source port, which depends - on the direction. + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type local_port: str - :param remote_port: The remote port. Acceptable values are a single - integer in the range (0-65535). Support for * for the source port, which - depends on the direction. + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type remote_port: str - :param local_ip_address: The local IP address. Acceptable values are valid - IPv4 addresses. + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. :type local_ip_address: str - :param remote_ip_address: The remote IP address. Acceptable values are - valid IPv4 addresses. + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. :type remote_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be @@ -65,13 +67,13 @@ class VerificationIPFlowParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, direction, protocol, local_port, remote_port, local_ip_address, remote_ip_address, target_nic_resource_id=None): - super(VerificationIPFlowParameters, self).__init__() - self.target_resource_id = target_resource_id - self.direction = direction - self.protocol = protocol - self.local_port = local_port - self.remote_port = remote_port - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.direction = kwargs.get('direction', None) + self.protocol = kwargs.get('protocol', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_parameters_py3.py new file mode 100644 index 000000000000..dd9ba7b70c0b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_parameters_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowParameters(Model): + """Parameters that define the IP flow to be verified. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. + :type target_resource_id: str + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' + :type direction: str or ~azure.mgmt.network.v2017_10_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' + :type protocol: str or ~azure.mgmt.network.v2017_10_01.models.Protocol + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type local_port: str + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type remote_port: str + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. + :type local_ip_address: str + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. + :type remote_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of them, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'local_port': {'required': True}, + 'remote_port': {'required': True}, + 'local_ip_address': {'required': True}, + 'remote_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, direction, protocol, local_port: str, remote_port: str, local_ip_address: str, remote_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.direction = direction + self.protocol = protocol + self.local_port = local_port + self.remote_port = remote_port + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_result.py index cf8f232996bf..c5bedbd1a362 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_result.py @@ -28,7 +28,7 @@ class VerificationIPFlowResult(Model): 'rule_name': {'key': 'ruleName', 'type': 'str'}, } - def __init__(self, access=None, rule_name=None): - super(VerificationIPFlowResult, self).__init__() - self.access = access - self.rule_name = rule_name + def __init__(self, **kwargs): + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.rule_name = kwargs.get('rule_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_result_py3.py new file mode 100644 index 000000000000..3769de2c2aaf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/verification_ip_flow_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowResult(Model): + """Results of IP flow verification on the target resource. + + :param access: Indicates whether the traffic is allowed or denied. + Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_10_01.models.Access + :param rule_name: Name of the rule. If input is not matched against any + security rule, it is not displayed. + :type rule_name: str + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + } + + def __init__(self, *, access=None, rule_name: str=None, **kwargs) -> None: + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = access + self.rule_name = rule_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network.py index 0622ab4e3c1a..0a206831f3ed 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network.py @@ -78,14 +78,14 @@ class VirtualNetwork(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid=None, provisioning_state=None, enable_ddos_protection=None, enable_vm_protection=None, etag=None): - super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags) - self.address_space = address_space - self.dhcp_options = dhcp_options - self.subnets = subnets - self.virtual_network_peerings = virtual_network_peerings - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.enable_ddos_protection = enable_ddos_protection - self.enable_vm_protection = enable_vm_protection - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetwork, self).__init__(**kwargs) + self.address_space = kwargs.get('address_space', None) + self.dhcp_options = kwargs.get('dhcp_options', None) + self.subnets = kwargs.get('subnets', None) + self.virtual_network_peerings = kwargs.get('virtual_network_peerings', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.enable_ddos_protection = kwargs.get('enable_ddos_protection', None) + self.enable_vm_protection = kwargs.get('enable_vm_protection', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_connection_gateway_reference.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_connection_gateway_reference.py index eb18a3c124ff..aa10101778f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_connection_gateway_reference.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_connection_gateway_reference.py @@ -15,8 +15,10 @@ class VirtualNetworkConnectionGatewayReference(Model): """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. - :param id: The ID of VirtualNetworkGateway or LocalNetworkGateway - resource. + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or + LocalNetworkGateway resource. :type id: str """ @@ -28,6 +30,6 @@ class VirtualNetworkConnectionGatewayReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id): - super(VirtualNetworkConnectionGatewayReference, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_connection_gateway_reference_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_connection_gateway_reference_py3.py new file mode 100644 index 000000000000..b2d9734baf3c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_connection_gateway_reference_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkConnectionGatewayReference(Model): + """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or + LocalNetworkGateway resource. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway.py index 3ffe2615136a..1f6fe9d5b574 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway.py @@ -98,17 +98,17 @@ class VirtualNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp=None, active_active=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid=None, etag=None): - super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.ip_configurations = ip_configurations - self.gateway_type = gateway_type - self.vpn_type = vpn_type - self.enable_bgp = enable_bgp - self.active_active = active_active - self.gateway_default_site = gateway_default_site - self.sku = sku - self.vpn_client_configuration = vpn_client_configuration - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(VirtualNetworkGateway, self).__init__(**kwargs) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.gateway_type = kwargs.get('gateway_type', None) + self.vpn_type = kwargs.get('vpn_type', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.active_active = kwargs.get('active_active', None) + self.gateway_default_site = kwargs.get('gateway_default_site', None) + self.sku = kwargs.get('sku', None) + self.vpn_client_configuration = kwargs.get('vpn_client_configuration', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection.py index 5235e40f63ed..2db26c840203 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayConnection(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -30,8 +32,8 @@ class VirtualNetworkGatewayConnection(Resource): :type tags: dict[str, str] :param authorization_key: The authorizationKey. :type authorization_key: str - :param virtual_network_gateway1: The reference to virtual network gateway - resource. + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. :type virtual_network_gateway1: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway :param virtual_network_gateway2: The reference to virtual network gateway @@ -42,8 +44,8 @@ class VirtualNetworkGatewayConnection(Resource): resource. :type local_network_gateway2: ~azure.mgmt.network.v2017_10_01.models.LocalNetworkGateway - :param connection_type: Gateway connection type. Possible values are: - 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' :type connection_type: str or ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnectionType @@ -128,23 +130,23 @@ class VirtualNetworkGatewayConnection(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, virtual_network_gateway1, connection_type, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight=None, shared_key=None, peer=None, enable_bgp=None, use_policy_based_traffic_selectors=None, ipsec_policies=None, resource_guid=None, etag=None): - super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnection, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) self.connection_status = None self.tunnel_connection_status = None self.egress_bytes_transferred = None self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors - self.ipsec_policies = ipsec_policies - self.resource_guid = resource_guid + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection_list_entity.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection_list_entity.py index bd200da3eb05..c29bd82a2194 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection_list_entity.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection_list_entity.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -30,8 +32,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): :type tags: dict[str, str] :param authorization_key: The authorizationKey. :type authorization_key: str - :param virtual_network_gateway1: The reference to virtual network gateway - resource. + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. :type virtual_network_gateway1: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkConnectionGatewayReference :param virtual_network_gateway2: The reference to virtual network gateway @@ -42,8 +44,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): resource. :type local_network_gateway2: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkConnectionGatewayReference - :param connection_type: Gateway connection type. Possible values are: - 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' :type connection_type: str or ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnectionType @@ -128,23 +130,23 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, virtual_network_gateway1, connection_type, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight=None, shared_key=None, peer=None, enable_bgp=None, use_policy_based_traffic_selectors=None, ipsec_policies=None, resource_guid=None, etag=None): - super(VirtualNetworkGatewayConnectionListEntity, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) self.connection_status = None self.tunnel_connection_status = None self.egress_bytes_transferred = None self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors - self.ipsec_policies = ipsec_policies - self.resource_guid = resource_guid + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection_list_entity_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection_list_entity_py3.py new file mode 100644 index 000000000000..50a8b42b6ef1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection_list_entity_py3.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnectionListEntity(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkConnectionGatewayReference + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkConnectionGatewayReference + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkConnectionGatewayReference + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2017_10_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2017_10_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, use_policy_based_traffic_selectors: bool=None, ipsec_policies=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection_py3.py new file mode 100644 index 000000000000..b22cb39d8632 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_connection_py3.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnection(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2017_10_01.models.LocalNetworkGateway + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2017_10_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2017_10_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, use_policy_based_traffic_selectors: bool=None, ipsec_policies=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_ip_configuration.py index 9984dd3400e7..ea78289011e9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_ip_configuration.py @@ -55,11 +55,11 @@ class VirtualNetworkGatewayIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name=None, etag=None): - super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id) - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address + def __init__(self, **kwargs): + super(VirtualNetworkGatewayIPConfiguration, self).__init__(**kwargs) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..7f629cc2a4dc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_ip_configuration_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_10_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_10_01.models.SubResource + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :ivar provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_py3.py new file mode 100644 index 000000000000..b68d673e4c98 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_py3.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param ip_configurations: IP configurations for virtual network gateway. + :type ip_configurations: + list[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible + values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', + 'ExpressRoute' + :type gateway_type: str or + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayType + :param vpn_type: The type of this virtual network gateway. Possible values + are: 'PolicyBased' and 'RouteBased'. Possible values include: + 'PolicyBased', 'RouteBased' + :type vpn_type: str or ~azure.mgmt.network.v2017_10_01.models.VpnType + :param enable_bgp: Whether BGP is enabled for this virtual network gateway + or not. + :type enable_bgp: bool + :param active_active: ActiveActive flag + :type active_active: bool + :param gateway_default_site: The reference of the LocalNetworkGateway + resource which represents local network site having default routes. Assign + Null value in case of removing existing default site setting. + :type gateway_default_site: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param sku: The reference of the VirtualNetworkGatewaySku resource which + represents the SKU selected for Virtual network gateway. + :type sku: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewaySku + :param vpn_client_configuration: The reference of the + VpnClientConfiguration resource which represents the P2S VpnClient + configurations. + :type vpn_client_configuration: + ~azure.mgmt.network.v2017_10_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2017_10_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + VirtualNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGateway resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, + 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, + 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'active_active': {'key': 'properties.activeActive', 'type': 'bool'}, + 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, + 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, + 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp: bool=None, active_active: bool=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.ip_configurations = ip_configurations + self.gateway_type = gateway_type + self.vpn_type = vpn_type + self.enable_bgp = enable_bgp + self.active_active = active_active + self.gateway_default_site = gateway_default_site + self.sku = sku + self.vpn_client_configuration = vpn_client_configuration + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_sku.py index 1453a8b42ea7..a54e7f834db3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_sku.py @@ -35,8 +35,8 @@ class VirtualNetworkGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(VirtualNetworkGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_sku_py3.py new file mode 100644 index 000000000000..015b8dcfaccd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_gateway_sku_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkGatewaySku(Model): + """VirtualNetworkGatewaySku details. + + :param name: Gateway SKU name. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type name: str or + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewaySkuName + :param tier: Gateway SKU tier. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type tier: str or + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewaySkuTier + :param capacity: The capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_peering.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_peering.py index 610944b9edf6..15e8ca74e038 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_peering.py @@ -72,15 +72,15 @@ class VirtualNetworkPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, allow_virtual_network_access=None, allow_forwarded_traffic=None, allow_gateway_transit=None, use_remote_gateways=None, remote_virtual_network=None, remote_address_space=None, peering_state=None, provisioning_state=None, name=None, etag=None): - super(VirtualNetworkPeering, self).__init__(id=id) - self.allow_virtual_network_access = allow_virtual_network_access - self.allow_forwarded_traffic = allow_forwarded_traffic - self.allow_gateway_transit = allow_gateway_transit - self.use_remote_gateways = use_remote_gateways - self.remote_virtual_network = remote_virtual_network - self.remote_address_space = remote_address_space - self.peering_state = peering_state - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetworkPeering, self).__init__(**kwargs) + self.allow_virtual_network_access = kwargs.get('allow_virtual_network_access', None) + self.allow_forwarded_traffic = kwargs.get('allow_forwarded_traffic', None) + self.allow_gateway_transit = kwargs.get('allow_gateway_transit', None) + self.use_remote_gateways = kwargs.get('use_remote_gateways', None) + self.remote_virtual_network = kwargs.get('remote_virtual_network', None) + self.remote_address_space = kwargs.get('remote_address_space', None) + self.peering_state = kwargs.get('peering_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_peering_py3.py new file mode 100644 index 000000000000..a196c98bb1a4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_peering_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkPeering(SubResource): + """Peerings in a virtual network resource. + + :param id: Resource ID. + :type id: str + :param allow_virtual_network_access: Whether the VMs in the linked virtual + network space would be able to access all the VMs in local Virtual network + space. + :type allow_virtual_network_access: bool + :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs + in the remote virtual network will be allowed/disallowed. + :type allow_forwarded_traffic: bool + :param allow_gateway_transit: If gateway links can be used in remote + virtual networking to link to this virtual network. + :type allow_gateway_transit: bool + :param use_remote_gateways: If remote gateways can be used on this virtual + network. If the flag is set to true, and allowGatewayTransit on remote + peering is also true, virtual network will use gateways of remote virtual + network for transit. Only one peering can have this flag set to true. This + flag cannot be set if virtual network already has a gateway. + :type use_remote_gateways: bool + :param remote_virtual_network: The reference of the remote virtual + network. The remote virtual network can be in the same or different region + (preview). See here to register for the preview and learn more + (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + :type remote_virtual_network: + ~azure.mgmt.network.v2017_10_01.models.SubResource + :param remote_address_space: The reference of the remote virtual network + address space. + :type remote_address_space: + ~azure.mgmt.network.v2017_10_01.models.AddressSpace + :param peering_state: The status of the virtual network peering. Possible + values are 'Initiated', 'Connected', and 'Disconnected'. Possible values + include: 'Initiated', 'Connected', 'Disconnected' + :type peering_state: str or + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkPeeringState + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, + 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, + 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, + 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'remote_address_space': {'key': 'properties.remoteAddressSpace', 'type': 'AddressSpace'}, + 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, allow_virtual_network_access: bool=None, allow_forwarded_traffic: bool=None, allow_gateway_transit: bool=None, use_remote_gateways: bool=None, remote_virtual_network=None, remote_address_space=None, peering_state=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkPeering, self).__init__(id=id, **kwargs) + self.allow_virtual_network_access = allow_virtual_network_access + self.allow_forwarded_traffic = allow_forwarded_traffic + self.allow_gateway_transit = allow_gateway_transit + self.use_remote_gateways = use_remote_gateways + self.remote_virtual_network = remote_virtual_network + self.remote_address_space = remote_address_space + self.peering_state = peering_state + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_py3.py new file mode 100644 index 000000000000..27b736f93dc5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetwork(Resource): + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param address_space: The AddressSpace that contains an array of IP + address ranges that can be used by subnets. + :type address_space: ~azure.mgmt.network.v2017_10_01.models.AddressSpace + :param dhcp_options: The dhcpOptions that contains an array of DNS servers + available to VMs deployed in the virtual network. + :type dhcp_options: ~azure.mgmt.network.v2017_10_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2017_10_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkPeering] + :param resource_guid: The resourceGuid property of the Virtual Network + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param enable_ddos_protection: Indicates if DDoS protection is enabled for + all the protected resources in a Virtual Network. + :type enable_ddos_protection: bool + :param enable_vm_protection: Indicates if Vm protection is enabled for all + the subnets in a Virtual Network. + :type enable_vm_protection: bool + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'enable_ddos_protection': {'key': 'properties.enableDdosProtection', 'type': 'bool'}, + 'enable_vm_protection': {'key': 'properties.enableVmProtection', 'type': 'bool'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid: str=None, provisioning_state: str=None, enable_ddos_protection: bool=None, enable_vm_protection: bool=None, etag: str=None, **kwargs) -> None: + super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.address_space = address_space + self.dhcp_options = dhcp_options + self.subnets = subnets + self.virtual_network_peerings = virtual_network_peerings + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.enable_ddos_protection = enable_ddos_protection + self.enable_vm_protection = enable_vm_protection + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage.py index e5c7ddae9772..6b4d5fcfb83d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage.py @@ -47,8 +47,8 @@ class VirtualNetworkUsage(Model): 'unit': {'key': 'unit', 'type': 'str'}, } - def __init__(self): - super(VirtualNetworkUsage, self).__init__() + def __init__(self, **kwargs): + super(VirtualNetworkUsage, self).__init__(**kwargs) self.current_value = None self.id = None self.limit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage_name.py index 01fcbf0875eb..607ccec3b964 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage_name.py @@ -34,7 +34,7 @@ class VirtualNetworkUsageName(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self): - super(VirtualNetworkUsageName, self).__init__() + def __init__(self, **kwargs): + super(VirtualNetworkUsageName, self).__init__(**kwargs) self.localized_value = None self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage_name_py3.py new file mode 100644 index 000000000000..1651ebda7e77 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage_name_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsageName(Model): + """Usage strings container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar localized_value: Localized subnet size and usage string. + :vartype localized_value: str + :ivar value: Subnet size and usage string. + :vartype value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsageName, self).__init__(**kwargs) + self.localized_value = None + self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage_py3.py new file mode 100644 index 000000000000..8260a1f05e59 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/virtual_network_usage_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsage(Model): + """Usage details for subnet. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar current_value: Indicates number of IPs used from the Subnet. + :vartype current_value: float + :ivar id: Subnet identifier. + :vartype id: str + :ivar limit: Indicates the size of the subnet. + :vartype limit: float + :ivar name: The name containing common and localized value for usage. + :vartype name: + ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkUsageName + :ivar unit: Usage units. Returns 'Count' + :vartype unit: str + """ + + _validation = { + 'current_value': {'readonly': True}, + 'id': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'name': {'key': 'name', 'type': 'VirtualNetworkUsageName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsage, self).__init__(**kwargs) + self.current_value = None + self.id = None + self.limit = None + self.name = None + self.unit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_configuration.py index 411b97cdca03..aff3f5643164 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_configuration.py @@ -48,11 +48,11 @@ class VpnClientConfiguration(Model): 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, } - def __init__(self, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, vpn_client_protocols=None, radius_server_address=None, radius_server_secret=None): - super(VpnClientConfiguration, self).__init__() - self.vpn_client_address_pool = vpn_client_address_pool - self.vpn_client_root_certificates = vpn_client_root_certificates - self.vpn_client_revoked_certificates = vpn_client_revoked_certificates - self.vpn_client_protocols = vpn_client_protocols - self.radius_server_address = radius_server_address - self.radius_server_secret = radius_server_secret + def __init__(self, **kwargs): + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = kwargs.get('vpn_client_address_pool', None) + self.vpn_client_root_certificates = kwargs.get('vpn_client_root_certificates', None) + self.vpn_client_revoked_certificates = kwargs.get('vpn_client_revoked_certificates', None) + self.vpn_client_protocols = kwargs.get('vpn_client_protocols', None) + self.radius_server_address = kwargs.get('radius_server_address', None) + self.radius_server_secret = kwargs.get('radius_server_secret', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_configuration_py3.py new file mode 100644 index 000000000000..a8802f029ae0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_configuration_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientConfiguration(Model): + """VpnClientConfiguration for P2S client. + + :param vpn_client_address_pool: The reference of the address space + resource which represents Address space for P2S VpnClient. + :type vpn_client_address_pool: + ~azure.mgmt.network.v2017_10_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual + network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2017_10_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for + Virtual network gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2017_10_01.models.VpnClientRevokedCertificate] + :param vpn_client_protocols: VpnClientProtocols for Virtual network + gateway. + :type vpn_client_protocols: list[str or + ~azure.mgmt.network.v2017_10_01.models.VpnClientProtocol] + :param radius_server_address: The radius server address property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_address: str + :param radius_server_secret: The radius secret property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_secret: str + """ + + _attribute_map = { + 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, + 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, + 'vpn_client_protocols': {'key': 'vpnClientProtocols', 'type': '[str]'}, + 'radius_server_address': {'key': 'radiusServerAddress', 'type': 'str'}, + 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, + } + + def __init__(self, *, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, vpn_client_protocols=None, radius_server_address: str=None, radius_server_secret: str=None, **kwargs) -> None: + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = vpn_client_address_pool + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + self.vpn_client_protocols = vpn_client_protocols + self.radius_server_address = radius_server_address + self.radius_server_secret = radius_server_secret diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_parameters.py index b9dcce414315..124a46b0bfad 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_parameters.py @@ -42,9 +42,9 @@ class VpnClientParameters(Model): 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, } - def __init__(self, processor_architecture=None, authentication_method=None, radius_server_auth_certificate=None, client_root_certificates=None): - super(VpnClientParameters, self).__init__() - self.processor_architecture = processor_architecture - self.authentication_method = authentication_method - self.radius_server_auth_certificate = radius_server_auth_certificate - self.client_root_certificates = client_root_certificates + def __init__(self, **kwargs): + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = kwargs.get('processor_architecture', None) + self.authentication_method = kwargs.get('authentication_method', None) + self.radius_server_auth_certificate = kwargs.get('radius_server_auth_certificate', None) + self.client_root_certificates = kwargs.get('client_root_certificates', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_parameters_py3.py new file mode 100644 index 000000000000..2ad731d187d0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_parameters_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientParameters(Model): + """Vpn Client Parameters for package generation. + + :param processor_architecture: VPN client Processor Architecture. Possible + values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' + :type processor_architecture: str or + ~azure.mgmt.network.v2017_10_01.models.ProcessorArchitecture + :param authentication_method: VPN client Authentication Method. Possible + values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', + 'EAPMSCHAPv2' + :type authentication_method: str or + ~azure.mgmt.network.v2017_10_01.models.AuthenticationMethod + :param radius_server_auth_certificate: The public certificate data for the + radius server authentication certificate as a Base-64 encoded string. + Required only if external radius authentication has been configured with + EAPTLS authentication. + :type radius_server_auth_certificate: str + :param client_root_certificates: A list of client root certificates public + certificate data encoded as Base-64 strings. Optional parameter for + external radius based authentication with EAPTLS. + :type client_root_certificates: list[str] + """ + + _attribute_map = { + 'processor_architecture': {'key': 'processorArchitecture', 'type': 'str'}, + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + 'radius_server_auth_certificate': {'key': 'radiusServerAuthCertificate', 'type': 'str'}, + 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, + } + + def __init__(self, *, processor_architecture=None, authentication_method=None, radius_server_auth_certificate: str=None, client_root_certificates=None, **kwargs) -> None: + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = processor_architecture + self.authentication_method = authentication_method + self.radius_server_auth_certificate = radius_server_auth_certificate + self.client_root_certificates = client_root_certificates diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_revoked_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_revoked_certificate.py index ebd6a4bbba2f..1fa6f6a1ef23 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_revoked_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_revoked_certificate.py @@ -46,9 +46,9 @@ class VpnClientRevokedCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, thumbprint=None, name=None, etag=None): - super(VpnClientRevokedCertificate, self).__init__(id=id) - self.thumbprint = thumbprint + def __init__(self, **kwargs): + super(VpnClientRevokedCertificate, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_revoked_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_revoked_certificate_py3.py new file mode 100644 index 000000000000..7c1e05f283a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_revoked_certificate_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + :ivar provisioning_state: The provisioning state of the VPN client revoked + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, thumbprint: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRevokedCertificate, self).__init__(id=id, **kwargs) + self.thumbprint = thumbprint + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_root_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_root_certificate.py index 6d820d3a8c11..48c7033d42ec 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_root_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_root_certificate.py @@ -18,9 +18,11 @@ class VpnClientRootCertificate(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param public_cert_data: The certificate public data. + :param public_cert_data: Required. The certificate public data. :type public_cert_data: str :ivar provisioning_state: The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and @@ -47,9 +49,9 @@ class VpnClientRootCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, public_cert_data, id=None, name=None, etag=None): - super(VpnClientRootCertificate, self).__init__(id=id) - self.public_cert_data = public_cert_data + def __init__(self, **kwargs): + super(VpnClientRootCertificate, self).__init__(**kwargs) + self.public_cert_data = kwargs.get('public_cert_data', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_root_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_root_certificate_py3.py new file mode 100644 index 000000000000..db8a1e547705 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_client_root_certificate_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param public_cert_data: Required. The certificate public data. + :type public_cert_data: str + :ivar provisioning_state: The provisioning state of the VPN client root + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'public_cert_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, public_cert_data: str, id: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRootCertificate, self).__init__(id=id, **kwargs) + self.public_cert_data = public_cert_data + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_device_script_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_device_script_parameters.py index 89ee8af0645a..e4f8f12701b7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_device_script_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_device_script_parameters.py @@ -29,8 +29,8 @@ class VpnDeviceScriptParameters(Model): 'firmware_version': {'key': 'firmwareVersion', 'type': 'str'}, } - def __init__(self, vendor=None, device_family=None, firmware_version=None): - super(VpnDeviceScriptParameters, self).__init__() - self.vendor = vendor - self.device_family = device_family - self.firmware_version = firmware_version + def __init__(self, **kwargs): + super(VpnDeviceScriptParameters, self).__init__(**kwargs) + self.vendor = kwargs.get('vendor', None) + self.device_family = kwargs.get('device_family', None) + self.firmware_version = kwargs.get('firmware_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_device_script_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_device_script_parameters_py3.py new file mode 100644 index 000000000000..e5520ffb5a18 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/vpn_device_script_parameters_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnDeviceScriptParameters(Model): + """Vpn device configuration script generation parameters. + + :param vendor: The vendor for the vpn device. + :type vendor: str + :param device_family: The device family for the vpn device. + :type device_family: str + :param firmware_version: The firmware version for the vpn device. + :type firmware_version: str + """ + + _attribute_map = { + 'vendor': {'key': 'vendor', 'type': 'str'}, + 'device_family': {'key': 'deviceFamily', 'type': 'str'}, + 'firmware_version': {'key': 'firmwareVersion', 'type': 'str'}, + } + + def __init__(self, *, vendor: str=None, device_family: str=None, firmware_version: str=None, **kwargs) -> None: + super(VpnDeviceScriptParameters, self).__init__(**kwargs) + self.vendor = vendor + self.device_family = device_family + self.firmware_version = firmware_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/network_management_client.py index 9889c016210d..8b37e2000264 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/network_management_client.py @@ -15,7 +15,8 @@ from .version import VERSION from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.application_gateways_operations import ApplicationGatewaysOperations from .operations.application_security_groups_operations import ApplicationSecurityGroupsOperations @@ -292,7 +293,7 @@ def check_dns_name_availability( api_version = "2017-10-01" # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability' + url = self.check_dns_name_availability.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -333,3 +334,4 @@ def check_dns_name_availability( return client_raw_response return deserialized + check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/application_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/application_gateways_operations.py index 4bf21dd3440c..bba5c93fca84 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/application_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/application_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ApplicationGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def get( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def _create_or_update_initial( self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_10_01.models.ApplicationGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ApplicationGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ApplicationGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ApplicationGateway', response) if raw: @@ -312,12 +276,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def _update_tags_initial( @@ -325,7 +291,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -372,7 +338,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, application_gateway_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -382,13 +348,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ApplicationGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ApplicationGateway]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -399,30 +368,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ApplicationGateway', response) if raw: @@ -431,12 +378,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -458,7 +407,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -504,6 +453,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -523,7 +473,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -568,12 +518,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} def _start_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -609,7 +560,7 @@ def _start_initial( return client_raw_response def start( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -617,12 +568,14 @@ def start( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -632,46 +585,26 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} def _stop_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -707,7 +640,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -715,12 +648,14 @@ def stop( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -730,46 +665,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} def _backend_health_initial( self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth' + url = self.backend_health.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -814,7 +729,7 @@ def _backend_health_initial( return deserialized def backend_health( - self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the backend health of the specified application gateway in a resource group. @@ -826,13 +741,17 @@ def backend_health( referenced in backend health. :type expand: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGatewayBackendHealth or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApplicationGatewayBackendHealth or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendHealth] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ApplicationGatewayBackendHealth]] :raises: :class:`CloudError` """ raw_result = self._backend_health_initial( @@ -843,30 +762,8 @@ def backend_health( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ApplicationGatewayBackendHealth', response) if raw: @@ -875,12 +772,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} def list_available_waf_rule_sets( self, custom_headers=None, raw=False, **operation_config): @@ -899,7 +798,7 @@ def list_available_waf_rule_sets( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets' + url = self.list_available_waf_rule_sets.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -938,6 +837,7 @@ def list_available_waf_rule_sets( return client_raw_response return deserialized + list_available_waf_rule_sets.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'} def list_available_ssl_options( self, custom_headers=None, raw=False, **operation_config): @@ -956,7 +856,7 @@ def list_available_ssl_options( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default' + url = self.list_available_ssl_options.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -995,6 +895,7 @@ def list_available_ssl_options( return client_raw_response return deserialized + list_available_ssl_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default'} def list_available_ssl_predefined_policies( self, custom_headers=None, raw=False, **operation_config): @@ -1015,7 +916,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies' + url = self.list_available_ssl_predefined_policies.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -1060,6 +961,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_ssl_predefined_policies.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies'} def get_ssl_predefined_policy( self, predefined_policy_name, custom_headers=None, raw=False, **operation_config): @@ -1080,7 +982,7 @@ def get_ssl_predefined_policy( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}' + url = self.get_ssl_predefined_policy.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'predefinedPolicyName': self._serialize.url("predefined_policy_name", predefined_policy_name, 'str') @@ -1120,3 +1022,4 @@ def get_ssl_predefined_policy( return client_raw_response return deserialized + get_ssl_predefined_policy.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/application_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/application_security_groups_operations.py index 8c91aad676a1..135e670a245b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/application_security_groups_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/application_security_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ApplicationSecurityGroupsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -88,12 +88,14 @@ def delete( security group. :type application_security_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -103,40 +105,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} def get( self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, **operation_config): @@ -159,7 +141,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), @@ -200,12 +182,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} def _create_or_update_initial( self, resource_group_name, application_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), @@ -254,7 +237,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,17 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroup :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApplicationSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ApplicationSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +271,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ApplicationSecurityGroup', response) if raw: @@ -316,12 +281,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -341,7 +308,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -386,6 +353,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +375,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -453,3 +421,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/available_endpoint_services_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/available_endpoint_services_operations.py index 86119b6e5708..60c6c2077e9c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/available_endpoint_services_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/available_endpoint_services_operations.py @@ -22,7 +22,7 @@ class AvailableEndpointServicesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/bgp_service_communities_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/bgp_service_communities_operations.py index d9c5d661b0bf..c715cf4851c2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/bgp_service_communities_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/bgp_service_communities_operations.py @@ -22,7 +22,7 @@ class BgpServiceCommunitiesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/connection_monitors_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/connection_monitors_operations.py index e8eda770e939..9c55f54c7a82 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/connection_monitors_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/connection_monitors_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ConnectionMonitorsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -93,7 +93,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing @@ -108,13 +108,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_10_01.models.ConnectionMonitor :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionMonitorResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectionMonitorResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorResult]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -126,30 +129,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ConnectionMonitorResult', response) if raw: @@ -158,12 +139,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} def get( self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): @@ -187,7 +170,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -229,12 +212,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} def _delete_initial( self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -271,7 +255,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing @@ -282,12 +266,14 @@ def delete( :param connection_monitor_name: The name of the connection monitor. :type connection_monitor_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -298,46 +284,26 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} def _stop_initial( self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -374,7 +340,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing @@ -385,12 +351,14 @@ def stop( :param connection_monitor_name: The name of the connection monitor. :type connection_monitor_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -401,46 +369,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop'} def _start_initial( self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -477,7 +425,7 @@ def _start_initial( return client_raw_response def start( - self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing @@ -488,12 +436,14 @@ def start( :param connection_monitor_name: The name of the connection monitor. :type connection_monitor_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -504,46 +454,26 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start'} def _query_initial( self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query' + url = self.query.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -589,7 +519,7 @@ def _query_initial( return deserialized def query( - self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, polling=True, **operation_config): """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing @@ -601,13 +531,17 @@ def query( monitor. :type connection_monitor_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionMonitorQueryResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConnectionMonitorQueryResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorQueryResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ConnectionMonitorQueryResult]] :raises: :class:`CloudError` """ raw_result = self._query_initial( @@ -618,30 +552,8 @@ def query( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectionMonitorQueryResult', response) if raw: @@ -650,12 +562,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + query.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query'} def list( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -680,7 +594,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -727,3 +641,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/default_security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/default_security_rules_operations.py index 516484df1219..3ab0237b1f24 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/default_security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/default_security_rules_operations.py @@ -22,7 +22,7 @@ class DefaultSecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -60,7 +60,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -107,6 +107,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules'} def get( self, resource_group_name, network_security_group_name, default_security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -131,7 +132,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -173,3 +174,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_circuit_authorizations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_circuit_authorizations_operations.py index 050dae6c822b..1c655829e462 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_circuit_authorizations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_circuit_authorizations_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified authorization from the specified express route circuit. @@ -91,12 +91,14 @@ def delete( :param authorization_name: The name of the authorization. :type authorization_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def get( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): @@ -166,7 +148,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an authorization in the specified express route circuit. @@ -278,13 +261,17 @@ def create_or_update( :type authorization_parameters: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitAuthorization :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitAuthorization or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitAuthorization or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitAuthorization] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitAuthorization]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -296,30 +283,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitAuthorization', response) if raw: @@ -328,12 +293,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +324,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -404,3 +371,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_circuit_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_circuit_peerings_operations.py index b68ae36c5a3e..3a401f12d4e4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_circuit_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_circuit_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param peering_name: The name of the peering. :type peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def get( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -275,13 +258,17 @@ def create_or_update( :type peering_parameters: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitPeering or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitPeering', response) if raw: @@ -325,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -401,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_circuits_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_circuits_operations.py index 9691ef4edea2..d2bdde804516 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_circuits_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_circuits_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param circuit_name: The name of the express route circuit. :type circuit_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def get( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuit :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuit or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuit] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuit]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuit', response) if raw: @@ -312,12 +276,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _update_tags_initial( @@ -325,7 +291,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -372,7 +338,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, circuit_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -382,13 +348,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuit or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuit] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuit]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -399,30 +368,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuit', response) if raw: @@ -431,18 +378,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _list_arp_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}' + url = self.list_arp_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -487,7 +436,7 @@ def _list_arp_table_initial( return deserialized def list_arp_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -500,14 +449,17 @@ def list_arp_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsArpTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsArpTableListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitsArpTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitsArpTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_arp_table_initial( @@ -519,30 +471,8 @@ def list_arp_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', response) if raw: @@ -551,18 +481,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} def _list_routes_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}' + url = self.list_routes_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -607,7 +539,7 @@ def _list_routes_table_initial( return deserialized def list_routes_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -620,14 +552,18 @@ def list_routes_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitsRoutesTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitsRoutesTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_initial( @@ -639,30 +575,8 @@ def list_routes_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', response) if raw: @@ -671,18 +585,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} def _list_routes_table_summary_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}' + url = self.list_routes_table_summary.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -727,7 +643,7 @@ def _list_routes_table_summary_initial( return deserialized def list_routes_table_summary( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -740,14 +656,18 @@ def list_routes_table_summary( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableSummaryListResult or ClientRawResponse - if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableSummaryListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_summary_initial( @@ -759,30 +679,8 @@ def list_routes_table_summary( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', response) if raw: @@ -791,12 +689,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} def get_stats( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -818,7 +718,7 @@ def get_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats' + url = self.get_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -859,6 +759,7 @@ def get_stats( return client_raw_response return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} def get_peering_stats( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -882,7 +783,7 @@ def get_peering_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats' + url = self.get_peering_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -924,6 +825,7 @@ def get_peering_stats( return client_raw_response return deserialized + get_peering_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -945,7 +847,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -991,6 +893,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -1010,7 +913,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -1055,3 +958,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_service_providers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_service_providers_operations.py index f06592bd20a2..2d608c703e9e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_service_providers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/express_route_service_providers_operations.py @@ -22,7 +22,7 @@ class ExpressRouteServiceProvidersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/inbound_nat_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/inbound_nat_rules_operations.py index f4c41b820ffa..62c5f7b29d4d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/inbound_nat_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/inbound_nat_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class InboundNatRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -61,7 +61,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -108,12 +108,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules'} def _delete_initial( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -150,7 +151,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -160,12 +161,14 @@ def delete( :param inbound_nat_rule_name: The name of the inbound nat rule. :type inbound_nat_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -176,40 +179,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} def get( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -234,7 +217,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -278,12 +261,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -333,7 +317,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -347,13 +331,16 @@ def create_or_update( :type inbound_nat_rule_parameters: ~azure.mgmt.network.v2017_10_01.models.InboundNatRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - InboundNatRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns InboundNatRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.InboundNatRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.InboundNatRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -365,30 +352,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('InboundNatRule', response) if raw: @@ -397,9 +362,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_backend_address_pools_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_backend_address_pools_operations.py index 9b202c8b6353..eb987ddd7470 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_backend_address_pools_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_backend_address_pools_operations.py @@ -22,7 +22,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools'} def get( self, resource_group_name, load_balancer_name, backend_address_pool_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -171,3 +172,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_frontend_ip_configurations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_frontend_ip_configurations_operations.py index f08b09b681e1..6a44485ef7a0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_frontend_ip_configurations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_frontend_ip_configurations_operations.py @@ -22,7 +22,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations'} def get( self, resource_group_name, load_balancer_name, frontend_ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -171,3 +172,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_load_balancing_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_load_balancing_rules_operations.py index cb5eb74dc12e..a638e7c637a4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_load_balancing_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_load_balancing_rules_operations.py @@ -22,7 +22,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules'} def get( self, resource_group_name, load_balancer_name, load_balancing_rule_name, custom_headers=None, raw=False, **operation_config): @@ -128,7 +129,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -170,3 +171,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_network_interfaces_operations.py index 58e7f756c78a..084a50accaae 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_network_interfaces_operations.py @@ -22,7 +22,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,3 +106,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_probes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_probes_operations.py index b6816d84e9af..36e13ae8ca71 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_probes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancer_probes_operations.py @@ -22,7 +22,7 @@ class LoadBalancerProbesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes'} def get( self, resource_group_name, load_balancer_name, probe_name, custom_headers=None, raw=False, **operation_config): @@ -128,7 +129,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -170,3 +171,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancers_operations.py index cf94d2a21a40..79ea7341e761 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/load_balancers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param load_balancer_name: The name of the load balancer. :type load_balancer_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def get( self, resource_group_name, load_balancer_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( balancer operation. :type parameters: ~azure.mgmt.network.v2017_10_01.models.LoadBalancer :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns LoadBalancer - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.LoadBalancer] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.LoadBalancer]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LoadBalancer', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def _update_tags_initial( @@ -328,7 +294,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -375,7 +341,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, load_balancer_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -385,13 +351,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns LoadBalancer - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.LoadBalancer] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.LoadBalancer]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -402,30 +371,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('LoadBalancer', response) if raw: @@ -434,12 +381,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -459,7 +408,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -504,6 +453,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -525,7 +475,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -571,3 +521,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/local_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/local_network_gateways_operations.py index d3a32b284091..ad15587af715 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/local_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/local_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LocalNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a local network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_10_01.models.LocalNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - LocalNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.LocalNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.LocalNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LocalNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def get( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def _delete_initial( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type local_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def _update_tags_initial( @@ -329,7 +295,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -376,7 +342,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, local_network_gateway_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -387,13 +353,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - LocalNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.LocalNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.LocalNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -404,30 +373,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('LocalNetworkGateway', response) if raw: @@ -436,12 +383,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -463,7 +412,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -509,3 +458,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_interface_ip_configurations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_interface_ip_configurations_operations.py index cf02c1e6e8a5..b42c30f32d08 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_interface_ip_configurations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_interface_ip_configurations_operations.py @@ -22,7 +22,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations'} def get( self, resource_group_name, network_interface_name, ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -130,7 +131,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -172,3 +173,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_interface_load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_interface_load_balancers_operations.py index bea9b0cbe8c1..2d1051022564 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_interface_load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_interface_load_balancers_operations.py @@ -22,7 +22,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -106,3 +106,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_interfaces_operations.py index db40da83d0bf..283e5eb786f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_interfaces_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ models = models @@ -43,7 +43,7 @@ def _delete_initial( api_version = "2017-10-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def get( self, resource_group_name, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( api_version = "2017-10-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -203,6 +185,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def _create_or_update_initial( @@ -210,7 +193,7 @@ def _create_or_update_initial( api_version = "2017-10-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_10_01.models.NetworkInterface :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkInterface or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.NetworkInterface] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.NetworkInterface]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkInterface', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def _update_tags_initial( @@ -335,7 +301,7 @@ def _update_tags_initial( api_version = "2017-10-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -382,7 +348,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, network_interface_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -392,13 +358,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkInterface or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.NetworkInterface] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.NetworkInterface]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -409,30 +378,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NetworkInterface', response) if raw: @@ -441,12 +388,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -468,7 +417,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -513,6 +462,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -536,7 +486,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -582,6 +532,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} def _get_effective_route_table_initial( @@ -589,7 +540,7 @@ def _get_effective_route_table_initial( api_version = "2017-10-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable' + url = self.get_effective_route_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -632,7 +583,7 @@ def _get_effective_route_table_initial( return deserialized def get_effective_route_table( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -640,13 +591,17 @@ def get_effective_route_table( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveRouteListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.EffectiveRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.EffectiveRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_effective_route_table_initial( @@ -656,30 +611,8 @@ def get_effective_route_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveRouteListResult', response) if raw: @@ -688,12 +621,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_effective_route_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} def _list_effective_network_security_groups_initial( @@ -701,7 +636,7 @@ def _list_effective_network_security_groups_initial( api_version = "2017-10-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups' + url = self.list_effective_network_security_groups.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -744,7 +679,7 @@ def _list_effective_network_security_groups_initial( return deserialized def list_effective_network_security_groups( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -752,14 +687,18 @@ def list_effective_network_security_groups( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveNetworkSecurityGroupListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveNetworkSecurityGroupListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.EffectiveNetworkSecurityGroupListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.EffectiveNetworkSecurityGroupListResult]] :raises: :class:`CloudError` """ raw_result = self._list_effective_network_security_groups_initial( @@ -769,30 +708,8 @@ def list_effective_network_security_groups( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', response) if raw: @@ -801,12 +718,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_effective_network_security_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} def list_virtual_machine_scale_set_vm_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, custom_headers=None, raw=False, **operation_config): @@ -836,7 +755,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces' + url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -884,6 +803,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} def list_virtual_machine_scale_set_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -910,7 +830,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces' + url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -957,6 +877,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} def get_virtual_machine_scale_set_network_interface( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -986,7 +907,7 @@ def get_virtual_machine_scale_set_network_interface( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}' + url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -1031,6 +952,7 @@ def get_virtual_machine_scale_set_network_interface( return client_raw_response return deserialized + get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} def list_virtual_machine_scale_set_ip_configurations( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -1064,7 +986,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations' + url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -1115,6 +1037,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_ip_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations'} def get_virtual_machine_scale_set_ip_configuration( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -1149,7 +1072,7 @@ def get_virtual_machine_scale_set_ip_configuration( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}' + url = self.get_virtual_machine_scale_set_ip_configuration.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -1195,3 +1118,4 @@ def get_virtual_machine_scale_set_ip_configuration( return client_raw_response return deserialized + get_virtual_machine_scale_set_ip_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_security_groups_operations.py index 98759e28063b..1c2a6c6acf66 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_security_groups_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_security_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkSecurityGroupsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -88,12 +88,14 @@ def delete( group. :type network_security_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -103,40 +105,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def get( self, resource_group_name, network_security_group_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -203,12 +185,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -257,7 +240,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network security group in the specified resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroup :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkSecurityGroup', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def _update_tags_initial( @@ -333,7 +299,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -380,7 +346,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, network_security_group_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -391,13 +357,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.NetworkSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -408,30 +377,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NetworkSecurityGroup', response) if raw: @@ -440,12 +387,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -465,7 +414,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -510,6 +459,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -531,7 +481,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -577,3 +527,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_watchers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_watchers_operations.py index 2fbf8cb9924d..2920734756d8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_watchers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/network_watchers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkWatchersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -62,7 +62,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -109,6 +109,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def get( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -170,12 +171,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def _delete_initial( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -211,7 +213,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -219,12 +221,14 @@ def delete( :param network_watcher_name: The name of the network watcher. :type network_watcher_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -234,40 +238,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def update_tags( self, resource_group_name, network_watcher_name, tags=None, custom_headers=None, raw=False, **operation_config): @@ -292,7 +276,7 @@ def update_tags( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -337,6 +321,7 @@ def update_tags( return client_raw_response return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -358,7 +343,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -404,6 +389,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -423,7 +409,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -468,6 +454,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'} def get_topology( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -492,7 +479,7 @@ def get_topology( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology' + url = self.get_topology.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -537,12 +524,13 @@ def get_topology( return client_raw_response return deserialized + get_topology.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'} def _verify_ip_flow_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify' + url = self.verify_ip_flow.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -591,7 +579,7 @@ def _verify_ip_flow_initial( return deserialized def verify_ip_flow( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Verify IP flow from the specified VM to a location given the currently configured NSG rules. @@ -603,13 +591,17 @@ def verify_ip_flow( :type parameters: ~azure.mgmt.network.v2017_10_01.models.VerificationIPFlowParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VerificationIPFlowResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VerificationIPFlowResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.VerificationIPFlowResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.VerificationIPFlowResult]] :raises: :class:`CloudError` """ raw_result = self._verify_ip_flow_initial( @@ -620,30 +612,8 @@ def verify_ip_flow( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VerificationIPFlowResult', response) if raw: @@ -652,18 +622,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + verify_ip_flow.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} def _get_next_hop_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop' + url = self.get_next_hop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -712,7 +684,7 @@ def _get_next_hop_initial( return deserialized def get_next_hop( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -724,13 +696,16 @@ def get_next_hop( :type parameters: ~azure.mgmt.network.v2017_10_01.models.NextHopParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NextHopResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NextHopResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.NextHopResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.NextHopResult]] :raises: :class:`CloudError` """ raw_result = self._get_next_hop_initial( @@ -741,30 +716,8 @@ def get_next_hop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NextHopResult', response) if raw: @@ -773,12 +726,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_next_hop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} def _get_vm_security_rules_initial( @@ -786,7 +741,7 @@ def _get_vm_security_rules_initial( parameters = models.SecurityGroupViewParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView' + url = self.get_vm_security_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -835,7 +790,7 @@ def _get_vm_security_rules_initial( return deserialized def get_vm_security_rules( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the configured and effective security group rules on the specified VM. @@ -846,13 +801,16 @@ def get_vm_security_rules( :param target_resource_id: ID of the target VM. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - SecurityGroupViewResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityGroupViewResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.SecurityGroupViewResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.SecurityGroupViewResult]] :raises: :class:`CloudError` """ raw_result = self._get_vm_security_rules_initial( @@ -863,30 +821,8 @@ def get_vm_security_rules( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('SecurityGroupViewResult', response) if raw: @@ -895,18 +831,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vm_security_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} def _get_troubleshooting_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot' + url = self.get_troubleshooting.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -955,7 +893,7 @@ def _get_troubleshooting_initial( return deserialized def get_troubleshooting( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -967,13 +905,16 @@ def get_troubleshooting( :type parameters: ~azure.mgmt.network.v2017_10_01.models.TroubleshootingParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_initial( @@ -984,30 +925,8 @@ def get_troubleshooting( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -1016,12 +935,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} def _get_troubleshooting_result_initial( @@ -1029,7 +950,7 @@ def _get_troubleshooting_result_initial( parameters = models.QueryTroubleshootingParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult' + url = self.get_troubleshooting_result.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1078,7 +999,7 @@ def _get_troubleshooting_result_initial( return deserialized def get_troubleshooting_result( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1089,13 +1010,16 @@ def get_troubleshooting_result( troubleshooting result. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_result_initial( @@ -1106,30 +1030,8 @@ def get_troubleshooting_result( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -1138,18 +1040,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} def _set_flow_log_configuration_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog' + url = self.set_flow_log_configuration.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1198,7 +1102,7 @@ def _set_flow_log_configuration_initial( return deserialized def set_flow_log_configuration( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1211,13 +1115,16 @@ def set_flow_log_configuration( :type parameters: ~azure.mgmt.network.v2017_10_01.models.FlowLogInformation :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._set_flow_log_configuration_initial( @@ -1228,30 +1135,8 @@ def set_flow_log_configuration( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1260,12 +1145,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_flow_log_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} def _get_flow_log_status_initial( @@ -1273,7 +1160,7 @@ def _get_flow_log_status_initial( parameters = models.FlowLogStatusParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus' + url = self.get_flow_log_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1322,7 +1209,7 @@ def _get_flow_log_status_initial( return deserialized def get_flow_log_status( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1334,13 +1221,16 @@ def get_flow_log_status( logging status. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._get_flow_log_status_initial( @@ -1351,30 +1241,8 @@ def get_flow_log_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1383,12 +1251,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_flow_log_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} def _check_connectivity_initial( @@ -1396,7 +1266,7 @@ def _check_connectivity_initial( parameters = models.ConnectivityParameters(source=source, destination=destination) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck' + url = self.check_connectivity.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1445,7 +1315,7 @@ def _check_connectivity_initial( return deserialized def check_connectivity( - self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, polling=True, **operation_config): """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1462,13 +1332,16 @@ def check_connectivity( :type destination: ~azure.mgmt.network.v2017_10_01.models.ConnectivityDestination :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectivityInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectivityInformation + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ConnectivityInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ConnectivityInformation]] :raises: :class:`CloudError` """ raw_result = self._check_connectivity_initial( @@ -1480,30 +1353,8 @@ def check_connectivity( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectivityInformation', response) if raw: @@ -1512,18 +1363,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + check_connectivity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} def _get_azure_reachability_report_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport' + url = self.get_azure_reachability_report.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1572,7 +1425,7 @@ def _get_azure_reachability_report_initial( return deserialized def get_azure_reachability_report( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1586,13 +1439,16 @@ def get_azure_reachability_report( :type parameters: ~azure.mgmt.network.v2017_10_01.models.AzureReachabilityReportParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - AzureReachabilityReport or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AzureReachabilityReport + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.AzureReachabilityReport] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.AzureReachabilityReport]] :raises: :class:`CloudError` """ raw_result = self._get_azure_reachability_report_initial( @@ -1603,30 +1459,8 @@ def get_azure_reachability_report( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AzureReachabilityReport', response) if raw: @@ -1635,18 +1469,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_azure_reachability_report.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport'} def _list_available_providers_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList' + url = self.list_available_providers.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1695,7 +1531,7 @@ def _list_available_providers_initial( return deserialized def list_available_providers( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Lists all available internet service providers for a specified Azure region. @@ -1709,13 +1545,16 @@ def list_available_providers( :type parameters: ~azure.mgmt.network.v2017_10_01.models.AvailableProvidersListParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - AvailableProvidersList or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AvailableProvidersList + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.AvailableProvidersList] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.AvailableProvidersList]] :raises: :class:`CloudError` """ raw_result = self._list_available_providers_initial( @@ -1726,30 +1565,8 @@ def list_available_providers( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AvailableProvidersList', response) if raw: @@ -1758,9 +1575,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_available_providers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/operations.py index eaeef283a100..ce90aa930fb6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Network/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -96,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Network/operations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/packet_captures_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/packet_captures_operations.py index a5fa84cd7428..912aa43efa19 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/packet_captures_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/packet_captures_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PacketCapturesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -91,7 +91,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -104,13 +104,16 @@ def create( operation. :type parameters: ~azure.mgmt.network.v2017_10_01.models.PacketCapture :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PacketCaptureResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.PacketCaptureResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.PacketCaptureResult]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -122,30 +125,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureResult', response) if raw: @@ -154,12 +135,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def get( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -224,12 +207,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _delete_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -266,7 +250,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -276,12 +260,14 @@ def delete( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -292,46 +278,26 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _stop_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -368,7 +334,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -378,12 +344,14 @@ def stop( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -394,46 +362,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} def _get_status_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus' + url = self.get_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -479,7 +427,7 @@ def _get_status_initial( return deserialized def get_status( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -490,13 +438,17 @@ def get_status( session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureQueryStatusResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PacketCaptureQueryStatusResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.PacketCaptureQueryStatusResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.PacketCaptureQueryStatusResult]] :raises: :class:`CloudError` """ raw_result = self._get_status_initial( @@ -507,30 +459,8 @@ def get_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureQueryStatusResult', response) if raw: @@ -539,12 +469,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} def list( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -568,7 +500,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -615,3 +547,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/public_ip_addresses_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/public_ip_addresses_operations.py index 83a0e81df1c9..76f275c96b2e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/public_ip_addresses_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/public_ip_addresses_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PublicIPAddressesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ models = models @@ -43,7 +43,7 @@ def _delete_initial( api_version = "2017-10-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param public_ip_address_name: The name of the subnet. :type public_ip_address_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def get( self, resource_group_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( api_version = "2017-10-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -203,6 +185,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def _create_or_update_initial( @@ -210,7 +193,7 @@ def _create_or_update_initial( api_version = "2017-10-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_10_01.models.PublicIPAddress :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PublicIPAddress or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.PublicIPAddress] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.PublicIPAddress]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('PublicIPAddress', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def _update_tags_initial( @@ -335,7 +301,7 @@ def _update_tags_initial( api_version = "2017-10-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -382,7 +348,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, public_ip_address_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -392,13 +358,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PublicIPAddress or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.PublicIPAddress] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.PublicIPAddress]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -409,30 +378,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PublicIPAddress', response) if raw: @@ -441,12 +388,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -468,7 +417,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -513,6 +462,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -536,7 +486,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -582,6 +532,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} def list_virtual_machine_scale_set_public_ip_addresses( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -609,7 +560,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses' + url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -656,6 +607,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses'} def list_virtual_machine_scale_set_vm_public_ip_addresses( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -689,7 +641,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses' + url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -739,6 +691,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses'} def get_virtual_machine_scale_set_public_ip_address( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -772,7 +725,7 @@ def get_virtual_machine_scale_set_public_ip_address( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}' + url = self.get_virtual_machine_scale_set_public_ip_address.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -819,3 +772,4 @@ def get_virtual_machine_scale_set_public_ip_address( return client_raw_response return deserialized + get_virtual_machine_scale_set_public_ip_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/route_filter_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/route_filter_rules_operations.py index 47a20db8043d..09fd271ac7c7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/route_filter_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/route_filter_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFilterRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param rule_name: The name of the rule. :type rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def get( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -273,13 +256,16 @@ def create_or_update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_10_01.models.RouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -291,30 +277,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilterRule', response) if raw: @@ -323,18 +287,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -382,7 +348,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -396,13 +362,16 @@ def update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_10_01.models.PatchRouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -414,30 +383,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilterRule', response) if raw: @@ -446,12 +393,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def list_by_route_filter( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): @@ -475,7 +424,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules' + url = self.list_by_route_filter.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -522,3 +471,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_route_filter.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/route_filters_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/route_filters_operations.py index 647855811294..4bf0a47b67d0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/route_filters_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/route_filters_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFiltersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_filter_name: The name of the route filter. :type route_filter_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def get( self, resource_group_name, route_filter_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type route_filter_parameters: ~azure.mgmt.network.v2017_10_01.models.RouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilter', response) if raw: @@ -316,18 +280,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -374,7 +340,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -386,13 +352,16 @@ def update( :type route_filter_parameters: ~azure.mgmt.network.v2017_10_01.models.PatchRouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -403,30 +372,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilter', response) if raw: @@ -435,12 +382,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -462,7 +411,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -508,6 +457,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -527,7 +477,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -572,3 +522,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/route_tables_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/route_tables_operations.py index 25ca97443f5a..c29a504cf78d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/route_tables_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/route_tables_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteTablesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_table_name: The name of the route table. :type route_table_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def get( self, resource_group_name, route_table_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( table operation. :type parameters: ~azure.mgmt.network.v2017_10_01.models.RouteTable :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteTable - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.RouteTable] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.RouteTable]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteTable', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def _update_tags_initial( @@ -328,7 +294,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -375,7 +341,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, route_table_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -385,13 +351,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteTable - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.RouteTable] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.RouteTable]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -402,30 +371,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteTable', response) if raw: @@ -434,12 +381,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -461,7 +410,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -507,6 +456,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -526,7 +476,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -571,3 +521,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/routes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/routes_operations.py index 8f27654ecf55..72a03a378ca5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/routes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/routes_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RoutesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param route_name: The name of the route. :type route_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def get( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -272,13 +255,16 @@ def create_or_update( route operation. :type route_parameters: ~azure.mgmt.network.v2017_10_01.models.Route :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Route or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Route or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.Route] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.Route]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -290,30 +276,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Route', response) if raw: @@ -322,12 +286,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def list( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): @@ -351,7 +317,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -398,3 +364,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/security_rules_operations.py index 81f8e6d5421a..fcf843c4ad5c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/security_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( :param security_rule_name: The name of the security rule. :type security_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def get( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a security rule in the specified network security group. @@ -277,13 +260,16 @@ def create_or_update( :type security_rule_parameters: ~azure.mgmt.network.v2017_10_01.models.SecurityRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns SecurityRule - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.SecurityRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.SecurityRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -295,30 +281,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('SecurityRule', response) if raw: @@ -327,12 +291,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def list( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +323,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -404,3 +370,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/subnets_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/subnets_operations.py index 9afc58f18cbd..8819345bc3ed 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/subnets_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/subnets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SubnetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param subnet_name: The name of the subnet. :type subnet_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def get( self, resource_group_name, virtual_network_name, subnet_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -276,13 +259,16 @@ def create_or_update( subnet operation. :type subnet_parameters: ~azure.mgmt.network.v2017_10_01.models.Subnet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Subnet or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Subnet or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.Subnet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.Subnet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -294,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Subnet', response) if raw: @@ -326,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -355,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -402,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/usages_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/usages_operations.py index 446d3ff6056f..3d808e39c46e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/usages_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/usages_operations.py @@ -22,7 +22,7 @@ class UsagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_gateway_connections_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_gateway_connections_operations.py index 166445248a85..f532169a4853 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_gateway_connections_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_gateway_connections_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway connection in the specified resource group. @@ -106,13 +106,17 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnection :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGatewayConnection or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnection or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnection] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnection]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +127,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGatewayConnection', response) if raw: @@ -155,12 +137,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def get( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -185,7 +169,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -226,12 +210,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -267,7 +252,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -276,12 +261,14 @@ def delete( virtual network gateway connection. :type virtual_network_gateway_connection_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -291,40 +278,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _update_tags_initial( @@ -332,7 +299,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -379,7 +346,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, virtual_network_gateway_connection_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -390,14 +357,18 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGatewayConnectionListEntity or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnectionListEntity or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnectionListEntity] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGatewayConnectionListEntity]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -408,30 +379,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGatewayConnectionListEntity', response) if raw: @@ -440,12 +389,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _set_shared_key_initial( @@ -453,7 +404,7 @@ def _set_shared_key_initial( parameters = models.ConnectionSharedKey(value=value) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.set_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -502,7 +453,7 @@ def _set_shared_key_initial( return deserialized def set_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, polling=True, **operation_config): """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -516,13 +467,16 @@ def set_shared_key( :param value: The virtual network connection shared key value. :type value: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectionSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ConnectionSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ConnectionSharedKey]] :raises: :class:`CloudError` """ raw_result = self._set_shared_key_initial( @@ -533,30 +487,8 @@ def set_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ConnectionSharedKey', response) if raw: @@ -565,12 +497,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def get_shared_key( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -594,7 +528,7 @@ def get_shared_key( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.get_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -635,6 +569,7 @@ def get_shared_key( return client_raw_response return deserialized + get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -657,7 +592,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -703,6 +638,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} def _reset_shared_key_initial( @@ -710,7 +646,7 @@ def _reset_shared_key_initial( parameters = models.ConnectionResetSharedKey(key_length=key_length) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset' + url = self.reset_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -757,7 +693,7 @@ def _reset_shared_key_initial( return deserialized def reset_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, polling=True, **operation_config): """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -772,13 +708,17 @@ def reset_shared_key( length, should between 1 and 128. :type key_length: int :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionResetSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConnectionResetSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.ConnectionResetSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.ConnectionResetSharedKey]] :raises: :class:`CloudError` """ raw_result = self._reset_shared_key_initial( @@ -789,30 +729,8 @@ def reset_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectionResetSharedKey', response) if raw: @@ -821,9 +739,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_gateways_operations.py index bfa17057ab27..9a28e6326a66 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def get( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def _update_tags_initial( @@ -329,7 +295,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -376,7 +342,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, virtual_network_gateway_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -387,13 +353,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -404,30 +373,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -436,12 +383,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -463,7 +412,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -509,6 +458,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} def list_connections( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -534,7 +484,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections' + url = self.list_connections.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -581,12 +531,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections'} def _reset_initial( self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset' + url = self.reset.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -631,7 +582,7 @@ def _reset_initial( return deserialized def reset( - self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, polling=True, **operation_config): """Resets the primary of the virtual network gateway in the specified resource group. @@ -644,13 +595,16 @@ def reset( the begin reset of the active-active feature enabled gateway. :type gateway_vip: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._reset_initial( @@ -661,30 +615,8 @@ def reset( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -693,18 +625,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} def _generatevpnclientpackage_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage' + url = self.generatevpnclientpackage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -751,7 +685,7 @@ def _generatevpnclientpackage_initial( return deserialized def generatevpnclientpackage( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -765,12 +699,14 @@ def generatevpnclientpackage( :type parameters: ~azure.mgmt.network.v2017_10_01.models.VpnClientParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._generatevpnclientpackage_initial( @@ -781,30 +717,8 @@ def generatevpnclientpackage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -813,18 +727,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} def _generate_vpn_profile_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile' + url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -871,7 +787,7 @@ def _generate_vpn_profile_initial( return deserialized def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. @@ -886,12 +802,14 @@ def generate_vpn_profile( :type parameters: ~azure.mgmt.network.v2017_10_01.models.VpnClientParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._generate_vpn_profile_initial( @@ -902,30 +820,8 @@ def generate_vpn_profile( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -934,18 +830,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} def _get_vpn_profile_package_url_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl' + url = self.get_vpn_profile_package_url.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -988,7 +886,7 @@ def _get_vpn_profile_package_url_initial( return deserialized def get_vpn_profile_package_url( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. @@ -999,12 +897,14 @@ def get_vpn_profile_package_url( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._get_vpn_profile_package_url_initial( @@ -1014,30 +914,8 @@ def get_vpn_profile_package_url( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -1046,18 +924,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vpn_profile_package_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'} def _get_bgp_peer_status_initial( self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus' + url = self.get_bgp_peer_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1102,7 +982,7 @@ def _get_bgp_peer_status_initial( return deserialized def get_bgp_peer_status( - self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, polling=True, **operation_config): """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1113,13 +993,16 @@ def get_bgp_peer_status( :param peer: The IP address of the peer to retrieve the status of. :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - BgpPeerStatusListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BgpPeerStatusListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.BgpPeerStatusListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.BgpPeerStatusListResult]] :raises: :class:`CloudError` """ raw_result = self._get_bgp_peer_status_initial( @@ -1130,30 +1013,8 @@ def get_bgp_peer_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('BgpPeerStatusListResult', response) if raw: @@ -1162,12 +1023,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_bgp_peer_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} def supported_vpn_devices( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -1188,7 +1051,7 @@ def supported_vpn_devices( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices' + url = self.supported_vpn_devices.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1229,12 +1092,13 @@ def supported_vpn_devices( return client_raw_response return deserialized + supported_vpn_devices.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices'} def _get_learned_routes_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes' + url = self.get_learned_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1277,7 +1141,7 @@ def _get_learned_routes_initial( return deserialized def get_learned_routes( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1287,13 +1151,16 @@ def get_learned_routes( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_learned_routes_initial( @@ -1303,30 +1170,8 @@ def get_learned_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -1335,18 +1180,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} def _get_advertised_routes_initial( self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes' + url = self.get_advertised_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1390,7 +1237,7 @@ def _get_advertised_routes_initial( return deserialized def get_advertised_routes( - self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1402,13 +1249,16 @@ def get_advertised_routes( :param peer: The IP address of the peer :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_advertised_routes_initial( @@ -1419,30 +1269,8 @@ def get_advertised_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -1451,12 +1279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} def vpn_device_configuration_script( self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -1482,7 +1312,7 @@ def vpn_device_configuration_script( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript' + url = self.vpn_device_configuration_script.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -1527,3 +1357,4 @@ def vpn_device_configuration_script( return client_raw_response return deserialized + vpn_device_configuration_script.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_peerings_operations.py index ebe209a4dd2c..104833a54a44 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_network_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( peering. :type virtual_network_peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def get( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -275,13 +258,16 @@ def create_or_update( :type virtual_network_peering_parameters: ~azure.mgmt.network.v2017_10_01.models.VirtualNetworkPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkPeering + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.VirtualNetworkPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +279,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkPeering', response) if raw: @@ -325,12 +289,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +320,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -401,3 +367,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_networks_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_networks_operations.py index a32a364c7a1f..8f064e045b66 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_networks_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_10_01/operations/virtual_networks_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworksOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-10-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param virtual_network_name: The name of the virtual network. :type virtual_network_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def get( self, resource_group_name, virtual_network_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_10_01.models.VirtualNetwork :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetwork or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetwork] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.VirtualNetwork]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetwork', response) if raw: @@ -316,12 +280,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def _update_tags_initial( @@ -329,7 +295,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -376,7 +342,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, virtual_network_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -386,13 +352,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetwork or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_10_01.models.VirtualNetwork] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_10_01.models.VirtualNetwork]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -403,30 +372,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetwork', response) if raw: @@ -435,12 +382,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -460,7 +409,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -505,6 +454,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -526,7 +476,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -572,6 +522,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks'} def check_ip_address_availability( self, resource_group_name, virtual_network_name, ip_address=None, custom_headers=None, raw=False, **operation_config): @@ -595,7 +546,7 @@ def check_ip_address_availability( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability' + url = self.check_ip_address_availability.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -638,6 +589,7 @@ def check_ip_address_availability( return client_raw_response return deserialized + check_ip_address_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'} def list_usage( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -661,7 +613,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages' + url = self.list_usage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -708,3 +660,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/__init__.py index 0fd132a0bd8f..04614d28da01 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/__init__.py @@ -9,187 +9,370 @@ # regenerated. # -------------------------------------------------------------------------- -from .sub_resource import SubResource -from .backend_address_pool import BackendAddressPool -from .inbound_nat_rule import InboundNatRule -from .application_security_group import ApplicationSecurityGroup -from .security_rule import SecurityRule -from .network_interface_dns_settings import NetworkInterfaceDnsSettings -from .network_interface import NetworkInterface -from .network_security_group import NetworkSecurityGroup -from .route import Route -from .route_table import RouteTable -from .service_endpoint_properties_format import ServiceEndpointPropertiesFormat -from .public_ip_address_sku import PublicIPAddressSku -from .public_ip_address_dns_settings import PublicIPAddressDnsSettings -from .ip_tag import IpTag -from .public_ip_address import PublicIPAddress -from .ip_configuration import IPConfiguration -from .resource_navigation_link import ResourceNavigationLink -from .subnet import Subnet -from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration -from .application_gateway_backend_address import ApplicationGatewayBackendAddress -from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool -from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining -from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings -from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer -from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings -from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool -from .application_gateway_backend_health import ApplicationGatewayBackendHealth -from .application_gateway_sku import ApplicationGatewaySku -from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy -from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration -from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate -from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate -from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration -from .application_gateway_frontend_port import ApplicationGatewayFrontendPort -from .application_gateway_http_listener import ApplicationGatewayHttpListener -from .application_gateway_path_rule import ApplicationGatewayPathRule -from .application_gateway_probe_health_response_match import ApplicationGatewayProbeHealthResponseMatch -from .application_gateway_probe import ApplicationGatewayProbe -from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule -from .application_gateway_redirect_configuration import ApplicationGatewayRedirectConfiguration -from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap -from .application_gateway_firewall_disabled_rule_group import ApplicationGatewayFirewallDisabledRuleGroup -from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration -from .application_gateway import ApplicationGateway -from .application_gateway_firewall_rule import ApplicationGatewayFirewallRule -from .application_gateway_firewall_rule_group import ApplicationGatewayFirewallRuleGroup -from .application_gateway_firewall_rule_set import ApplicationGatewayFirewallRuleSet -from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult -from .application_gateway_available_ssl_options import ApplicationGatewayAvailableSslOptions -from .application_gateway_ssl_predefined_policy import ApplicationGatewaySslPredefinedPolicy -from .resource import Resource -from .tags_object import TagsObject -from .dns_name_availability_result import DnsNameAvailabilityResult -from .endpoint_service_result import EndpointServiceResult -from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization -from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig -from .route_filter_rule import RouteFilterRule -from .express_route_circuit_stats import ExpressRouteCircuitStats -from .express_route_circuit_peering import ExpressRouteCircuitPeering -from .route_filter import RouteFilter -from .ipv6_express_route_circuit_peering_config import Ipv6ExpressRouteCircuitPeeringConfig -from .express_route_circuit_sku import ExpressRouteCircuitSku -from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties -from .express_route_circuit import ExpressRouteCircuit -from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable -from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult -from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable -from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult -from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary -from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult -from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered -from .express_route_service_provider import ExpressRouteServiceProvider -from .load_balancer_sku import LoadBalancerSku -from .frontend_ip_configuration import FrontendIPConfiguration -from .load_balancing_rule import LoadBalancingRule -from .probe import Probe -from .inbound_nat_pool import InboundNatPool -from .outbound_nat_rule import OutboundNatRule -from .load_balancer import LoadBalancer -from .error_details import ErrorDetails -from .error import Error -from .azure_async_operation_result import AzureAsyncOperationResult -from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation -from .effective_network_security_rule import EffectiveNetworkSecurityRule -from .effective_network_security_group import EffectiveNetworkSecurityGroup -from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult -from .effective_route import EffectiveRoute -from .effective_route_list_result import EffectiveRouteListResult -from .network_watcher import NetworkWatcher -from .topology_parameters import TopologyParameters -from .topology_association import TopologyAssociation -from .topology_resource import TopologyResource -from .topology import Topology -from .verification_ip_flow_parameters import VerificationIPFlowParameters -from .verification_ip_flow_result import VerificationIPFlowResult -from .next_hop_parameters import NextHopParameters -from .next_hop_result import NextHopResult -from .security_group_view_parameters import SecurityGroupViewParameters -from .network_interface_association import NetworkInterfaceAssociation -from .subnet_association import SubnetAssociation -from .security_rule_associations import SecurityRuleAssociations -from .security_group_network_interface import SecurityGroupNetworkInterface -from .security_group_view_result import SecurityGroupViewResult -from .packet_capture_storage_location import PacketCaptureStorageLocation -from .packet_capture_filter import PacketCaptureFilter -from .packet_capture_parameters import PacketCaptureParameters -from .packet_capture import PacketCapture -from .packet_capture_result import PacketCaptureResult -from .packet_capture_query_status_result import PacketCaptureQueryStatusResult -from .troubleshooting_parameters import TroubleshootingParameters -from .query_troubleshooting_parameters import QueryTroubleshootingParameters -from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions -from .troubleshooting_details import TroubleshootingDetails -from .troubleshooting_result import TroubleshootingResult -from .retention_policy_parameters import RetentionPolicyParameters -from .flow_log_status_parameters import FlowLogStatusParameters -from .flow_log_information import FlowLogInformation -from .connectivity_source import ConnectivitySource -from .connectivity_destination import ConnectivityDestination -from .connectivity_parameters import ConnectivityParameters -from .connectivity_issue import ConnectivityIssue -from .connectivity_hop import ConnectivityHop -from .connectivity_information import ConnectivityInformation -from .azure_reachability_report_location import AzureReachabilityReportLocation -from .azure_reachability_report_parameters import AzureReachabilityReportParameters -from .azure_reachability_report_latency_info import AzureReachabilityReportLatencyInfo -from .azure_reachability_report_item import AzureReachabilityReportItem -from .azure_reachability_report import AzureReachabilityReport -from .available_providers_list_parameters import AvailableProvidersListParameters -from .available_providers_list_city import AvailableProvidersListCity -from .available_providers_list_state import AvailableProvidersListState -from .available_providers_list_country import AvailableProvidersListCountry -from .available_providers_list import AvailableProvidersList -from .connection_monitor_source import ConnectionMonitorSource -from .connection_monitor_destination import ConnectionMonitorDestination -from .connection_monitor_parameters import ConnectionMonitorParameters -from .connection_monitor import ConnectionMonitor -from .connection_monitor_result import ConnectionMonitorResult -from .connection_state_snapshot import ConnectionStateSnapshot -from .connection_monitor_query_result import ConnectionMonitorQueryResult -from .operation_display import OperationDisplay -from .availability import Availability -from .dimension import Dimension -from .metric_specification import MetricSpecification -from .log_specification import LogSpecification -from .operation_properties_format_service_specification import OperationPropertiesFormatServiceSpecification -from .operation import Operation -from .patch_route_filter_rule import PatchRouteFilterRule -from .patch_route_filter import PatchRouteFilter -from .bgp_community import BGPCommunity -from .bgp_service_community import BgpServiceCommunity -from .usage_name import UsageName -from .usage import Usage -from .address_space import AddressSpace -from .virtual_network_peering import VirtualNetworkPeering -from .dhcp_options import DhcpOptions -from .virtual_network import VirtualNetwork -from .ip_address_availability_result import IPAddressAvailabilityResult -from .virtual_network_usage_name import VirtualNetworkUsageName -from .virtual_network_usage import VirtualNetworkUsage -from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration -from .virtual_network_gateway_sku import VirtualNetworkGatewaySku -from .vpn_client_root_certificate import VpnClientRootCertificate -from .vpn_client_revoked_certificate import VpnClientRevokedCertificate -from .vpn_client_configuration import VpnClientConfiguration -from .bgp_settings import BgpSettings -from .bgp_peer_status import BgpPeerStatus -from .gateway_route import GatewayRoute -from .virtual_network_gateway import VirtualNetworkGateway -from .vpn_client_parameters import VpnClientParameters -from .bgp_peer_status_list_result import BgpPeerStatusListResult -from .gateway_route_list_result import GatewayRouteListResult -from .tunnel_connection_health import TunnelConnectionHealth -from .local_network_gateway import LocalNetworkGateway -from .ipsec_policy import IpsecPolicy -from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection -from .connection_reset_shared_key import ConnectionResetSharedKey -from .connection_shared_key import ConnectionSharedKey -from .virtual_network_connection_gateway_reference import VirtualNetworkConnectionGatewayReference -from .virtual_network_gateway_connection_list_entity import VirtualNetworkGatewayConnectionListEntity -from .vpn_device_script_parameters import VpnDeviceScriptParameters +try: + from .sub_resource_py3 import SubResource + from .backend_address_pool_py3 import BackendAddressPool + from .inbound_nat_rule_py3 import InboundNatRule + from .application_security_group_py3 import ApplicationSecurityGroup + from .security_rule_py3 import SecurityRule + from .network_interface_dns_settings_py3 import NetworkInterfaceDnsSettings + from .network_interface_py3 import NetworkInterface + from .network_security_group_py3 import NetworkSecurityGroup + from .route_py3 import Route + from .route_table_py3 import RouteTable + from .service_endpoint_properties_format_py3 import ServiceEndpointPropertiesFormat + from .public_ip_address_sku_py3 import PublicIPAddressSku + from .public_ip_address_dns_settings_py3 import PublicIPAddressDnsSettings + from .ip_tag_py3 import IpTag + from .public_ip_address_py3 import PublicIPAddress + from .ip_configuration_py3 import IPConfiguration + from .resource_navigation_link_py3 import ResourceNavigationLink + from .subnet_py3 import Subnet + from .network_interface_ip_configuration_py3 import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address_py3 import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool_py3 import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining_py3 import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings_py3 import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server_py3 import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings_py3 import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool_py3 import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health_py3 import ApplicationGatewayBackendHealth + from .application_gateway_sku_py3 import ApplicationGatewaySku + from .application_gateway_ssl_policy_py3 import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration_py3 import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate_py3 import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate_py3 import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration_py3 import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port_py3 import ApplicationGatewayFrontendPort + from .application_gateway_http_listener_py3 import ApplicationGatewayHttpListener + from .application_gateway_path_rule_py3 import ApplicationGatewayPathRule + from .application_gateway_probe_health_response_match_py3 import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_probe_py3 import ApplicationGatewayProbe + from .application_gateway_request_routing_rule_py3 import ApplicationGatewayRequestRoutingRule + from .application_gateway_redirect_configuration_py3 import ApplicationGatewayRedirectConfiguration + from .application_gateway_url_path_map_py3 import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group_py3 import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration_py3 import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway_py3 import ApplicationGateway + from .application_gateway_firewall_rule_py3 import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group_py3 import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set_py3 import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result_py3 import ApplicationGatewayAvailableWafRuleSetsResult + from .application_gateway_available_ssl_options_py3 import ApplicationGatewayAvailableSslOptions + from .application_gateway_ssl_predefined_policy_py3 import ApplicationGatewaySslPredefinedPolicy + from .resource_py3 import Resource + from .tags_object_py3 import TagsObject + from .dns_name_availability_result_py3 import DnsNameAvailabilityResult + from .endpoint_service_result_py3 import EndpointServiceResult + from .express_route_circuit_authorization_py3 import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config_py3 import ExpressRouteCircuitPeeringConfig + from .route_filter_rule_py3 import RouteFilterRule + from .express_route_circuit_stats_py3 import ExpressRouteCircuitStats + from .express_route_circuit_peering_py3 import ExpressRouteCircuitPeering + from .route_filter_py3 import RouteFilter + from .ipv6_express_route_circuit_peering_config_py3 import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku_py3 import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties_py3 import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit_py3 import ExpressRouteCircuit + from .express_route_circuit_arp_table_py3 import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result_py3 import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table_py3 import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result_py3 import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary_py3 import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result_py3 import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered_py3 import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider_py3 import ExpressRouteServiceProvider + from .load_balancer_sku_py3 import LoadBalancerSku + from .frontend_ip_configuration_py3 import FrontendIPConfiguration + from .load_balancing_rule_py3 import LoadBalancingRule + from .probe_py3 import Probe + from .inbound_nat_pool_py3 import InboundNatPool + from .outbound_nat_rule_py3 import OutboundNatRule + from .load_balancer_py3 import LoadBalancer + from .error_details_py3 import ErrorDetails + from .error_py3 import Error + from .azure_async_operation_result_py3 import AzureAsyncOperationResult + from .effective_network_security_group_association_py3 import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule_py3 import EffectiveNetworkSecurityRule + from .effective_network_security_group_py3 import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result_py3 import EffectiveNetworkSecurityGroupListResult + from .effective_route_py3 import EffectiveRoute + from .effective_route_list_result_py3 import EffectiveRouteListResult + from .network_watcher_py3 import NetworkWatcher + from .topology_parameters_py3 import TopologyParameters + from .topology_association_py3 import TopologyAssociation + from .topology_resource_py3 import TopologyResource + from .topology_py3 import Topology + from .verification_ip_flow_parameters_py3 import VerificationIPFlowParameters + from .verification_ip_flow_result_py3 import VerificationIPFlowResult + from .next_hop_parameters_py3 import NextHopParameters + from .next_hop_result_py3 import NextHopResult + from .security_group_view_parameters_py3 import SecurityGroupViewParameters + from .network_interface_association_py3 import NetworkInterfaceAssociation + from .subnet_association_py3 import SubnetAssociation + from .security_rule_associations_py3 import SecurityRuleAssociations + from .security_group_network_interface_py3 import SecurityGroupNetworkInterface + from .security_group_view_result_py3 import SecurityGroupViewResult + from .packet_capture_storage_location_py3 import PacketCaptureStorageLocation + from .packet_capture_filter_py3 import PacketCaptureFilter + from .packet_capture_parameters_py3 import PacketCaptureParameters + from .packet_capture_py3 import PacketCapture + from .packet_capture_result_py3 import PacketCaptureResult + from .packet_capture_query_status_result_py3 import PacketCaptureQueryStatusResult + from .troubleshooting_parameters_py3 import TroubleshootingParameters + from .query_troubleshooting_parameters_py3 import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions_py3 import TroubleshootingRecommendedActions + from .troubleshooting_details_py3 import TroubleshootingDetails + from .troubleshooting_result_py3 import TroubleshootingResult + from .retention_policy_parameters_py3 import RetentionPolicyParameters + from .flow_log_status_parameters_py3 import FlowLogStatusParameters + from .flow_log_information_py3 import FlowLogInformation + from .connectivity_source_py3 import ConnectivitySource + from .connectivity_destination_py3 import ConnectivityDestination + from .connectivity_parameters_py3 import ConnectivityParameters + from .connectivity_issue_py3 import ConnectivityIssue + from .connectivity_hop_py3 import ConnectivityHop + from .connectivity_information_py3 import ConnectivityInformation + from .azure_reachability_report_location_py3 import AzureReachabilityReportLocation + from .azure_reachability_report_parameters_py3 import AzureReachabilityReportParameters + from .azure_reachability_report_latency_info_py3 import AzureReachabilityReportLatencyInfo + from .azure_reachability_report_item_py3 import AzureReachabilityReportItem + from .azure_reachability_report_py3 import AzureReachabilityReport + from .available_providers_list_parameters_py3 import AvailableProvidersListParameters + from .available_providers_list_city_py3 import AvailableProvidersListCity + from .available_providers_list_state_py3 import AvailableProvidersListState + from .available_providers_list_country_py3 import AvailableProvidersListCountry + from .available_providers_list_py3 import AvailableProvidersList + from .connection_monitor_source_py3 import ConnectionMonitorSource + from .connection_monitor_destination_py3 import ConnectionMonitorDestination + from .connection_monitor_parameters_py3 import ConnectionMonitorParameters + from .connection_monitor_py3 import ConnectionMonitor + from .connection_monitor_result_py3 import ConnectionMonitorResult + from .connection_state_snapshot_py3 import ConnectionStateSnapshot + from .connection_monitor_query_result_py3 import ConnectionMonitorQueryResult + from .operation_display_py3 import OperationDisplay + from .availability_py3 import Availability + from .dimension_py3 import Dimension + from .metric_specification_py3 import MetricSpecification + from .log_specification_py3 import LogSpecification + from .operation_properties_format_service_specification_py3 import OperationPropertiesFormatServiceSpecification + from .operation_py3 import Operation + from .patch_route_filter_rule_py3 import PatchRouteFilterRule + from .patch_route_filter_py3 import PatchRouteFilter + from .bgp_community_py3 import BGPCommunity + from .bgp_service_community_py3 import BgpServiceCommunity + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .address_space_py3 import AddressSpace + from .virtual_network_peering_py3 import VirtualNetworkPeering + from .dhcp_options_py3 import DhcpOptions + from .virtual_network_py3 import VirtualNetwork + from .ip_address_availability_result_py3 import IPAddressAvailabilityResult + from .virtual_network_usage_name_py3 import VirtualNetworkUsageName + from .virtual_network_usage_py3 import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration_py3 import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku_py3 import VirtualNetworkGatewaySku + from .vpn_client_root_certificate_py3 import VpnClientRootCertificate + from .vpn_client_revoked_certificate_py3 import VpnClientRevokedCertificate + from .vpn_client_configuration_py3 import VpnClientConfiguration + from .bgp_settings_py3 import BgpSettings + from .bgp_peer_status_py3 import BgpPeerStatus + from .gateway_route_py3 import GatewayRoute + from .virtual_network_gateway_py3 import VirtualNetworkGateway + from .vpn_client_parameters_py3 import VpnClientParameters + from .bgp_peer_status_list_result_py3 import BgpPeerStatusListResult + from .gateway_route_list_result_py3 import GatewayRouteListResult + from .tunnel_connection_health_py3 import TunnelConnectionHealth + from .local_network_gateway_py3 import LocalNetworkGateway + from .ipsec_policy_py3 import IpsecPolicy + from .virtual_network_gateway_connection_py3 import VirtualNetworkGatewayConnection + from .connection_reset_shared_key_py3 import ConnectionResetSharedKey + from .connection_shared_key_py3 import ConnectionSharedKey + from .virtual_network_connection_gateway_reference_py3 import VirtualNetworkConnectionGatewayReference + from .virtual_network_gateway_connection_list_entity_py3 import VirtualNetworkGatewayConnectionListEntity + from .vpn_device_script_parameters_py3 import VpnDeviceScriptParameters +except (SyntaxError, ImportError): + from .sub_resource import SubResource + from .backend_address_pool import BackendAddressPool + from .inbound_nat_rule import InboundNatRule + from .application_security_group import ApplicationSecurityGroup + from .security_rule import SecurityRule + from .network_interface_dns_settings import NetworkInterfaceDnsSettings + from .network_interface import NetworkInterface + from .network_security_group import NetworkSecurityGroup + from .route import Route + from .route_table import RouteTable + from .service_endpoint_properties_format import ServiceEndpointPropertiesFormat + from .public_ip_address_sku import PublicIPAddressSku + from .public_ip_address_dns_settings import PublicIPAddressDnsSettings + from .ip_tag import IpTag + from .public_ip_address import PublicIPAddress + from .ip_configuration import IPConfiguration + from .resource_navigation_link import ResourceNavigationLink + from .subnet import Subnet + from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health import ApplicationGatewayBackendHealth + from .application_gateway_sku import ApplicationGatewaySku + from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port import ApplicationGatewayFrontendPort + from .application_gateway_http_listener import ApplicationGatewayHttpListener + from .application_gateway_path_rule import ApplicationGatewayPathRule + from .application_gateway_probe_health_response_match import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_probe import ApplicationGatewayProbe + from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule + from .application_gateway_redirect_configuration import ApplicationGatewayRedirectConfiguration + from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway import ApplicationGateway + from .application_gateway_firewall_rule import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult + from .application_gateway_available_ssl_options import ApplicationGatewayAvailableSslOptions + from .application_gateway_ssl_predefined_policy import ApplicationGatewaySslPredefinedPolicy + from .resource import Resource + from .tags_object import TagsObject + from .dns_name_availability_result import DnsNameAvailabilityResult + from .endpoint_service_result import EndpointServiceResult + from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig + from .route_filter_rule import RouteFilterRule + from .express_route_circuit_stats import ExpressRouteCircuitStats + from .express_route_circuit_peering import ExpressRouteCircuitPeering + from .route_filter import RouteFilter + from .ipv6_express_route_circuit_peering_config import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit import ExpressRouteCircuit + from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider import ExpressRouteServiceProvider + from .load_balancer_sku import LoadBalancerSku + from .frontend_ip_configuration import FrontendIPConfiguration + from .load_balancing_rule import LoadBalancingRule + from .probe import Probe + from .inbound_nat_pool import InboundNatPool + from .outbound_nat_rule import OutboundNatRule + from .load_balancer import LoadBalancer + from .error_details import ErrorDetails + from .error import Error + from .azure_async_operation_result import AzureAsyncOperationResult + from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule import EffectiveNetworkSecurityRule + from .effective_network_security_group import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult + from .effective_route import EffectiveRoute + from .effective_route_list_result import EffectiveRouteListResult + from .network_watcher import NetworkWatcher + from .topology_parameters import TopologyParameters + from .topology_association import TopologyAssociation + from .topology_resource import TopologyResource + from .topology import Topology + from .verification_ip_flow_parameters import VerificationIPFlowParameters + from .verification_ip_flow_result import VerificationIPFlowResult + from .next_hop_parameters import NextHopParameters + from .next_hop_result import NextHopResult + from .security_group_view_parameters import SecurityGroupViewParameters + from .network_interface_association import NetworkInterfaceAssociation + from .subnet_association import SubnetAssociation + from .security_rule_associations import SecurityRuleAssociations + from .security_group_network_interface import SecurityGroupNetworkInterface + from .security_group_view_result import SecurityGroupViewResult + from .packet_capture_storage_location import PacketCaptureStorageLocation + from .packet_capture_filter import PacketCaptureFilter + from .packet_capture_parameters import PacketCaptureParameters + from .packet_capture import PacketCapture + from .packet_capture_result import PacketCaptureResult + from .packet_capture_query_status_result import PacketCaptureQueryStatusResult + from .troubleshooting_parameters import TroubleshootingParameters + from .query_troubleshooting_parameters import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions + from .troubleshooting_details import TroubleshootingDetails + from .troubleshooting_result import TroubleshootingResult + from .retention_policy_parameters import RetentionPolicyParameters + from .flow_log_status_parameters import FlowLogStatusParameters + from .flow_log_information import FlowLogInformation + from .connectivity_source import ConnectivitySource + from .connectivity_destination import ConnectivityDestination + from .connectivity_parameters import ConnectivityParameters + from .connectivity_issue import ConnectivityIssue + from .connectivity_hop import ConnectivityHop + from .connectivity_information import ConnectivityInformation + from .azure_reachability_report_location import AzureReachabilityReportLocation + from .azure_reachability_report_parameters import AzureReachabilityReportParameters + from .azure_reachability_report_latency_info import AzureReachabilityReportLatencyInfo + from .azure_reachability_report_item import AzureReachabilityReportItem + from .azure_reachability_report import AzureReachabilityReport + from .available_providers_list_parameters import AvailableProvidersListParameters + from .available_providers_list_city import AvailableProvidersListCity + from .available_providers_list_state import AvailableProvidersListState + from .available_providers_list_country import AvailableProvidersListCountry + from .available_providers_list import AvailableProvidersList + from .connection_monitor_source import ConnectionMonitorSource + from .connection_monitor_destination import ConnectionMonitorDestination + from .connection_monitor_parameters import ConnectionMonitorParameters + from .connection_monitor import ConnectionMonitor + from .connection_monitor_result import ConnectionMonitorResult + from .connection_state_snapshot import ConnectionStateSnapshot + from .connection_monitor_query_result import ConnectionMonitorQueryResult + from .operation_display import OperationDisplay + from .availability import Availability + from .dimension import Dimension + from .metric_specification import MetricSpecification + from .log_specification import LogSpecification + from .operation_properties_format_service_specification import OperationPropertiesFormatServiceSpecification + from .operation import Operation + from .patch_route_filter_rule import PatchRouteFilterRule + from .patch_route_filter import PatchRouteFilter + from .bgp_community import BGPCommunity + from .bgp_service_community import BgpServiceCommunity + from .usage_name import UsageName + from .usage import Usage + from .address_space import AddressSpace + from .virtual_network_peering import VirtualNetworkPeering + from .dhcp_options import DhcpOptions + from .virtual_network import VirtualNetwork + from .ip_address_availability_result import IPAddressAvailabilityResult + from .virtual_network_usage_name import VirtualNetworkUsageName + from .virtual_network_usage import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku import VirtualNetworkGatewaySku + from .vpn_client_root_certificate import VpnClientRootCertificate + from .vpn_client_revoked_certificate import VpnClientRevokedCertificate + from .vpn_client_configuration import VpnClientConfiguration + from .bgp_settings import BgpSettings + from .bgp_peer_status import BgpPeerStatus + from .gateway_route import GatewayRoute + from .virtual_network_gateway import VirtualNetworkGateway + from .vpn_client_parameters import VpnClientParameters + from .bgp_peer_status_list_result import BgpPeerStatusListResult + from .gateway_route_list_result import GatewayRouteListResult + from .tunnel_connection_health import TunnelConnectionHealth + from .local_network_gateway import LocalNetworkGateway + from .ipsec_policy import IpsecPolicy + from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection + from .connection_reset_shared_key import ConnectionResetSharedKey + from .connection_shared_key import ConnectionSharedKey + from .virtual_network_connection_gateway_reference import VirtualNetworkConnectionGatewayReference + from .virtual_network_gateway_connection_list_entity import VirtualNetworkGatewayConnectionListEntity + from .vpn_device_script_parameters import VpnDeviceScriptParameters from .application_gateway_paged import ApplicationGatewayPaged from .application_gateway_ssl_predefined_policy_paged import ApplicationGatewaySslPredefinedPolicyPaged from .application_security_group_paged import ApplicationSecurityGroupPaged diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/address_space.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/address_space.py index d7050c78a457..fbf42c9e0ade 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/address_space.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/address_space.py @@ -25,6 +25,6 @@ class AddressSpace(Model): 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, } - def __init__(self, address_prefixes=None): - super(AddressSpace, self).__init__() - self.address_prefixes = address_prefixes + def __init__(self, **kwargs): + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = kwargs.get('address_prefixes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/address_space_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/address_space_py3.py new file mode 100644 index 000000000000..9794cc805efa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/address_space_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AddressSpace(Model): + """AddressSpace contains an array of IP address ranges that can be used by + subnets of the virtual network. + + :param address_prefixes: A list of address blocks reserved for this + virtual network in CIDR notation. + :type address_prefixes: list[str] + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__(self, *, address_prefixes=None, **kwargs) -> None: + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = address_prefixes diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway.py index a0b04e69ab17..7e14ee806425 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway.py @@ -134,25 +134,25 @@ class ApplicationGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, redirect_configurations=None, web_application_firewall_configuration=None, enable_http2=None, resource_guid=None, provisioning_state=None, etag=None): - super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.ssl_policy = ssl_policy + def __init__(self, **kwargs): + super(ApplicationGateway, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.ssl_policy = kwargs.get('ssl_policy', None) self.operational_state = None - self.gateway_ip_configurations = gateway_ip_configurations - self.authentication_certificates = authentication_certificates - self.ssl_certificates = ssl_certificates - self.frontend_ip_configurations = frontend_ip_configurations - self.frontend_ports = frontend_ports - self.probes = probes - self.backend_address_pools = backend_address_pools - self.backend_http_settings_collection = backend_http_settings_collection - self.http_listeners = http_listeners - self.url_path_maps = url_path_maps - self.request_routing_rules = request_routing_rules - self.redirect_configurations = redirect_configurations - self.web_application_firewall_configuration = web_application_firewall_configuration - self.enable_http2 = enable_http2 - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.gateway_ip_configurations = kwargs.get('gateway_ip_configurations', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.ssl_certificates = kwargs.get('ssl_certificates', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.frontend_ports = kwargs.get('frontend_ports', None) + self.probes = kwargs.get('probes', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) + self.http_listeners = kwargs.get('http_listeners', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.redirect_configurations = kwargs.get('redirect_configurations', None) + self.web_application_firewall_configuration = kwargs.get('web_application_firewall_configuration', None) + self.enable_http2 = kwargs.get('enable_http2', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_authentication_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_authentication_certificate.py index 18f36b7401a7..dff594340e59 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_authentication_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_authentication_certificate.py @@ -42,10 +42,10 @@ class ApplicationGatewayAuthenticationCertificate(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, data=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id) - self.data = data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayAuthenticationCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_authentication_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_authentication_certificate_py3.py new file mode 100644 index 000000000000..f31145eb222c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_authentication_certificate_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayAuthenticationCertificate(SubResource): + """Authentication certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Certificate public data. + :type data: str + :param provisioning_state: Provisioning state of the authentication + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_ssl_options.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_ssl_options.py index 51a0b900dc25..0ac77d0cca07 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_ssl_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_ssl_options.py @@ -62,9 +62,9 @@ class ApplicationGatewayAvailableSslOptions(Resource): 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, } - def __init__(self, id=None, location=None, tags=None, predefined_policies=None, default_policy=None, available_cipher_suites=None, available_protocols=None): - super(ApplicationGatewayAvailableSslOptions, self).__init__(id=id, location=location, tags=tags) - self.predefined_policies = predefined_policies - self.default_policy = default_policy - self.available_cipher_suites = available_cipher_suites - self.available_protocols = available_protocols + def __init__(self, **kwargs): + super(ApplicationGatewayAvailableSslOptions, self).__init__(**kwargs) + self.predefined_policies = kwargs.get('predefined_policies', None) + self.default_policy = kwargs.get('default_policy', None) + self.available_cipher_suites = kwargs.get('available_cipher_suites', None) + self.available_protocols = kwargs.get('available_protocols', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_ssl_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_ssl_options_py3.py new file mode 100644 index 000000000000..3c2140ec7a9a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_ssl_options_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayAvailableSslOptions(Resource): + """Response for ApplicationGatewayAvailableSslOptions API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param predefined_policies: List of available Ssl predefined policy. + :type predefined_policies: + list[~azure.mgmt.network.v2017_11_01.models.SubResource] + :param default_policy: Name of the Ssl predefined policy applied by + default to application gateway. Possible values include: + 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type default_policy: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslPolicyName + :param available_cipher_suites: List of available Ssl cipher suites. + :type available_cipher_suites: list[str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslCipherSuite] + :param available_protocols: List of available Ssl protocols. + :type available_protocols: list[str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslProtocol] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'predefined_policies': {'key': 'properties.predefinedPolicies', 'type': '[SubResource]'}, + 'default_policy': {'key': 'properties.defaultPolicy', 'type': 'str'}, + 'available_cipher_suites': {'key': 'properties.availableCipherSuites', 'type': '[str]'}, + 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, predefined_policies=None, default_policy=None, available_cipher_suites=None, available_protocols=None, **kwargs) -> None: + super(ApplicationGatewayAvailableSslOptions, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.predefined_policies = predefined_policies + self.default_policy = default_policy + self.available_cipher_suites = available_cipher_suites + self.available_protocols = available_protocols diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_waf_rule_sets_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_waf_rule_sets_result.py index 40b77f0b7eab..fb67367ef3f0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_waf_rule_sets_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_waf_rule_sets_result.py @@ -24,6 +24,6 @@ class ApplicationGatewayAvailableWafRuleSetsResult(Model): 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, } - def __init__(self, value=None): - super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_waf_rule_sets_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_waf_rule_sets_result_py3.py new file mode 100644 index 000000000000..88a53ee4c99e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_available_waf_rule_sets_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayAvailableWafRuleSetsResult(Model): + """Response for ApplicationGatewayAvailableWafRuleSets API service call. + + :param value: The list of application gateway rule sets. + :type value: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayFirewallRuleSet] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address.py index 6005027d0845..e7a61fe1705c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address.py @@ -26,7 +26,7 @@ class ApplicationGatewayBackendAddress(Model): 'ip_address': {'key': 'ipAddress', 'type': 'str'}, } - def __init__(self, fqdn=None, ip_address=None): - super(ApplicationGatewayBackendAddress, self).__init__() - self.fqdn = fqdn - self.ip_address = ip_address + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = kwargs.get('fqdn', None) + self.ip_address = kwargs.get('ip_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address_pool.py index 1192cf279476..badea2273fc1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address_pool.py @@ -47,11 +47,11 @@ class ApplicationGatewayBackendAddressPool(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayBackendAddressPool, self).__init__(id=id) - self.backend_ip_configurations = backend_ip_configurations - self.backend_addresses = backend_addresses - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddressPool, self).__init__(**kwargs) + self.backend_ip_configurations = kwargs.get('backend_ip_configurations', None) + self.backend_addresses = kwargs.get('backend_addresses', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address_pool_py3.py new file mode 100644 index 000000000000..0090763bfcb9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address_pool_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + :param id: Resource ID. + :type id: str + :param backend_ip_configurations: Collection of references to IPs defined + in network interfaces. + :type backend_ip_configurations: + list[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses + :type backend_addresses: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendAddress] + :param provisioning_state: Provisioning state of the backend address pool + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Resource that is unique within a resource group. This name + can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = backend_ip_configurations + self.backend_addresses = backend_addresses + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address_py3.py new file mode 100644 index 000000000000..d18e476244d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_address_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendAddress(Model): + """Backend address of an application gateway. + + :param fqdn: Fully qualified domain name (FQDN). + :type fqdn: str + :param ip_address: IP address + :type ip_address: str + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__(self, *, fqdn: str=None, ip_address: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = fqdn + self.ip_address = ip_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health.py index c3734bd87662..ef491d6e0db1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health.py @@ -24,6 +24,6 @@ class ApplicationGatewayBackendHealth(Model): 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, } - def __init__(self, backend_address_pools=None): - super(ApplicationGatewayBackendHealth, self).__init__() - self.backend_address_pools = backend_address_pools + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = kwargs.get('backend_address_pools', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_http_settings.py index aa2fcb0ca955..9a5eb4b0d19d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_http_settings.py @@ -29,7 +29,7 @@ class ApplicationGatewayBackendHealthHttpSettings(Model): 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, } - def __init__(self, backend_http_settings=None, servers=None): - super(ApplicationGatewayBackendHealthHttpSettings, self).__init__() - self.backend_http_settings = backend_http_settings - self.servers = servers + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.servers = kwargs.get('servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_http_settings_py3.py new file mode 100644 index 000000000000..f2813ae08174 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_http_settings_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthHttpSettings(Model): + """Application gateway BackendHealthHttp settings. + + :param backend_http_settings: Reference of an + ApplicationGatewayBackendHttpSettings resource. + :type backend_http_settings: + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendHealthServer] + """ + + _attribute_map = { + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, + 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, + } + + def __init__(self, *, backend_http_settings=None, servers=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = backend_http_settings + self.servers = servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_pool.py index 015553ddcbea..b2fb4b10bb6b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_pool.py @@ -30,7 +30,7 @@ class ApplicationGatewayBackendHealthPool(Model): 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, } - def __init__(self, backend_address_pool=None, backend_http_settings_collection=None): - super(ApplicationGatewayBackendHealthPool, self).__init__() - self.backend_address_pool = backend_address_pool - self.backend_http_settings_collection = backend_http_settings_collection + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_pool_py3.py new file mode 100644 index 000000000000..392683248cb1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_pool_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthPool(Model): + """Application gateway BackendHealth pool. + + :param backend_address_pool: Reference of an + ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of + ApplicationGatewayBackendHealthHttpSettings resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, + } + + def __init__(self, *, backend_address_pool=None, backend_http_settings_collection=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_http_settings_collection = backend_http_settings_collection diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_py3.py new file mode 100644 index 000000000000..0507f23ea624 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealth(Model): + """List of ApplicationGatewayBackendHealthPool resources. + + :param backend_address_pools: + :type backend_address_pools: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendHealthPool] + """ + + _attribute_map = { + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, + } + + def __init__(self, *, backend_address_pools=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = backend_address_pools diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_server.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_server.py index e5dffc00df8c..0de2cdfa4a8d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_server.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_server.py @@ -32,8 +32,8 @@ class ApplicationGatewayBackendHealthServer(Model): 'health': {'key': 'health', 'type': 'str'}, } - def __init__(self, address=None, ip_configuration=None, health=None): - super(ApplicationGatewayBackendHealthServer, self).__init__() - self.address = address - self.ip_configuration = ip_configuration - self.health = health + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + self.ip_configuration = kwargs.get('ip_configuration', None) + self.health = kwargs.get('health', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_server_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_server_py3.py new file mode 100644 index 000000000000..c0b5c872eb70 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_health_server_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthServer(Model): + """Application gateway backendhealth http settings. + + :param address: IP address or FQDN of backend server. + :type address: str + :param ip_configuration: Reference of IP configuration of backend server. + :type ip_configuration: + ~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceIPConfiguration + :param health: Health of backend server. Possible values include: + 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + :type health: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendHealthServerHealth + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'health': {'key': 'health', 'type': 'str'}, + } + + def __init__(self, *, address: str=None, ip_configuration=None, health=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = address + self.ip_configuration = ip_configuration + self.health = health diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_http_settings.py index 7a68c1310e6b..aeb85b8ab348 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_http_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_http_settings.py @@ -87,21 +87,21 @@ class ApplicationGatewayBackendHttpSettings(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, port=None, protocol=None, cookie_based_affinity=None, request_timeout=None, probe=None, authentication_certificates=None, connection_draining=None, host_name=None, pick_host_name_from_backend_address=None, affinity_cookie_name=None, probe_enabled=None, path=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id) - self.port = port - self.protocol = protocol - self.cookie_based_affinity = cookie_based_affinity - self.request_timeout = request_timeout - self.probe = probe - self.authentication_certificates = authentication_certificates - self.connection_draining = connection_draining - self.host_name = host_name - self.pick_host_name_from_backend_address = pick_host_name_from_backend_address - self.affinity_cookie_name = affinity_cookie_name - self.probe_enabled = probe_enabled - self.path = path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHttpSettings, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.protocol = kwargs.get('protocol', None) + self.cookie_based_affinity = kwargs.get('cookie_based_affinity', None) + self.request_timeout = kwargs.get('request_timeout', None) + self.probe = kwargs.get('probe', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.connection_draining = kwargs.get('connection_draining', None) + self.host_name = kwargs.get('host_name', None) + self.pick_host_name_from_backend_address = kwargs.get('pick_host_name_from_backend_address', None) + self.affinity_cookie_name = kwargs.get('affinity_cookie_name', None) + self.probe_enabled = kwargs.get('probe_enabled', None) + self.path = kwargs.get('path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_http_settings_py3.py new file mode 100644 index 000000000000..64f294b0d976 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_backend_http_settings_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendHttpSettings(SubResource): + """Backend address pool settings of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Port + :type port: int + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayProtocol + :param cookie_based_affinity: Cookie based affinity. Possible values + include: 'Enabled', 'Disabled' + :type cookie_based_affinity: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayCookieBasedAffinity + :param request_timeout: Request timeout in seconds. Application Gateway + will fail the request if response is not received within RequestTimeout. + Acceptable values are from 1 second to 86400 seconds. + :type request_timeout: int + :param probe: Probe resource of an application gateway. + :type probe: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param authentication_certificates: Array of references to application + gateway authentication certificates. + :type authentication_certificates: + list[~azure.mgmt.network.v2017_11_01.models.SubResource] + :param connection_draining: Connection draining of the backend http + settings resource. + :type connection_draining: + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayConnectionDraining + :param host_name: Host header to be sent to the backend servers. + :type host_name: str + :param pick_host_name_from_backend_address: Whether to pick host header + should be picked from the host name of the backend server. Default value + is false. + :type pick_host_name_from_backend_address: bool + :param affinity_cookie_name: Cookie name to use for the affinity cookie. + :type affinity_cookie_name: str + :param probe_enabled: Whether the probe is enabled. Default value is + false. + :type probe_enabled: bool + :param path: Path which should be used as a prefix for all HTTP requests. + Null means no path will be prefixed. Default value is null. + :type path: str + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, + 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, + 'connection_draining': {'key': 'properties.connectionDraining', 'type': 'ApplicationGatewayConnectionDraining'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'pick_host_name_from_backend_address': {'key': 'properties.pickHostNameFromBackendAddress', 'type': 'bool'}, + 'affinity_cookie_name': {'key': 'properties.affinityCookieName', 'type': 'str'}, + 'probe_enabled': {'key': 'properties.probeEnabled', 'type': 'bool'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, protocol=None, cookie_based_affinity=None, request_timeout: int=None, probe=None, authentication_certificates=None, connection_draining=None, host_name: str=None, pick_host_name_from_backend_address: bool=None, affinity_cookie_name: str=None, probe_enabled: bool=None, path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id, **kwargs) + self.port = port + self.protocol = protocol + self.cookie_based_affinity = cookie_based_affinity + self.request_timeout = request_timeout + self.probe = probe + self.authentication_certificates = authentication_certificates + self.connection_draining = connection_draining + self.host_name = host_name + self.pick_host_name_from_backend_address = pick_host_name_from_backend_address + self.affinity_cookie_name = affinity_cookie_name + self.probe_enabled = probe_enabled + self.path = path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_connection_draining.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_connection_draining.py index 8f9b88b571e2..531b3cb05dd3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_connection_draining.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_connection_draining.py @@ -17,10 +17,12 @@ class ApplicationGatewayConnectionDraining(Model): active for a specified time after the backend server got removed from the configuration. - :param enabled: Whether connection draining is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. :type enabled: bool - :param drain_timeout_in_sec: The number of seconds connection draining is - active. Acceptable values are from 1 second to 3600 seconds. + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. :type drain_timeout_in_sec: int """ @@ -34,7 +36,7 @@ class ApplicationGatewayConnectionDraining(Model): 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, } - def __init__(self, enabled, drain_timeout_in_sec): - super(ApplicationGatewayConnectionDraining, self).__init__() - self.enabled = enabled - self.drain_timeout_in_sec = drain_timeout_in_sec + def __init__(self, **kwargs): + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.drain_timeout_in_sec = kwargs.get('drain_timeout_in_sec', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_connection_draining_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_connection_draining_py3.py new file mode 100644 index 000000000000..c46fb01cae72 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_connection_draining_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayConnectionDraining(Model): + """Connection draining allows open connections to a backend server to be + active for a specified time after the backend server got removed from the + configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. + :type enabled: bool + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. + :type drain_timeout_in_sec: int + """ + + _validation = { + 'enabled': {'required': True}, + 'drain_timeout_in_sec': {'required': True, 'maximum': 3600, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool, drain_timeout_in_sec: int, **kwargs) -> None: + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = enabled + self.drain_timeout_in_sec = drain_timeout_in_sec diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_disabled_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_disabled_rule_group.py index 02c88980e857..085ae3d78c5c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_disabled_rule_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_disabled_rule_group.py @@ -15,7 +15,10 @@ class ApplicationGatewayFirewallDisabledRuleGroup(Model): """Allows to disable rules within a rule group or an entire rule group. - :param rule_group_name: The name of the rule group that will be disabled. + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. :type rule_group_name: str :param rules: The list of rules that will be disabled. If null, all rules of the rule group will be disabled. @@ -31,7 +34,7 @@ class ApplicationGatewayFirewallDisabledRuleGroup(Model): 'rules': {'key': 'rules', 'type': '[int]'}, } - def __init__(self, rule_group_name, rules=None): - super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__() - self.rule_group_name = rule_group_name - self.rules = rules + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_disabled_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_disabled_rule_group_py3.py new file mode 100644 index 000000000000..44ac696b801c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_disabled_rule_group_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallDisabledRuleGroup(Model): + """Allows to disable rules within a rule group or an entire rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. + :type rule_group_name: str + :param rules: The list of rules that will be disabled. If null, all rules + of the rule group will be disabled. + :type rules: list[int] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[int]'}, + } + + def __init__(self, *, rule_group_name: str, rules=None, **kwargs) -> None: + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule.py index f3f7da7cc11b..661b0d146e16 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule.py @@ -15,7 +15,10 @@ class ApplicationGatewayFirewallRule(Model): """A web application firewall rule. - :param rule_id: The identifier of the web application firewall rule. + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. :type rule_id: int :param description: The description of the web application firewall rule. :type description: str @@ -30,7 +33,7 @@ class ApplicationGatewayFirewallRule(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, rule_id, description=None): - super(ApplicationGatewayFirewallRule, self).__init__() - self.rule_id = rule_id - self.description = description + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_group.py index 3cb999e520cd..7030301ac573 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_group.py @@ -15,13 +15,16 @@ class ApplicationGatewayFirewallRuleGroup(Model): """A web application firewall rule group. - :param rule_group_name: The name of the web application firewall rule - group. + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. :type rule_group_name: str :param description: The description of the web application firewall rule group. :type description: str - :param rules: The rules of the web application firewall rule group. + :param rules: Required. The rules of the web application firewall rule + group. :type rules: list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayFirewallRule] """ @@ -37,8 +40,8 @@ class ApplicationGatewayFirewallRuleGroup(Model): 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, } - def __init__(self, rule_group_name, rules, description=None): - super(ApplicationGatewayFirewallRuleGroup, self).__init__() - self.rule_group_name = rule_group_name - self.description = description - self.rules = rules + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.description = kwargs.get('description', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_group_py3.py new file mode 100644 index 000000000000..e6a468dbbdc2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_group_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRuleGroup(Model): + """A web application firewall rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. + :type rule_group_name: str + :param description: The description of the web application firewall rule + group. + :type description: str + :param rules: Required. The rules of the web application firewall rule + group. + :type rules: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayFirewallRule] + """ + + _validation = { + 'rule_group_name': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, + } + + def __init__(self, *, rule_group_name: str, rules, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.description = description + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_py3.py new file mode 100644 index 000000000000..e332fbd16853 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRule(Model): + """A web application firewall rule. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. + :type rule_id: int + :param description: The description of the web application firewall rule. + :type description: str + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, rule_id: int, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = rule_id + self.description = description diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_set.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_set.py index 61914a48a140..a1c73060db00 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_set.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_set.py @@ -18,6 +18,8 @@ class ApplicationGatewayFirewallRuleSet(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -31,13 +33,14 @@ class ApplicationGatewayFirewallRuleSet(Resource): :param provisioning_state: The provisioning state of the web application firewall rule set. :type provisioning_state: str - :param rule_set_type: The type of the web application firewall rule set. + :param rule_set_type: Required. The type of the web application firewall + rule set. :type rule_set_type: str - :param rule_set_version: The version of the web application firewall rule - set type. + :param rule_set_version: Required. The version of the web application + firewall rule set type. :type rule_set_version: str - :param rule_groups: The rule groups of the web application firewall rule - set. + :param rule_groups: Required. The rule groups of the web application + firewall rule set. :type rule_groups: list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayFirewallRuleGroup] """ @@ -62,9 +65,9 @@ class ApplicationGatewayFirewallRuleSet(Resource): 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, } - def __init__(self, rule_set_type, rule_set_version, rule_groups, id=None, location=None, tags=None, provisioning_state=None): - super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags) - self.provisioning_state = provisioning_state - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.rule_groups = rule_groups + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleSet, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.rule_groups = kwargs.get('rule_groups', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_set_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_set_py3.py new file mode 100644 index 000000000000..c79e8b6deeb0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_firewall_rule_set_py3.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayFirewallRuleSet(Resource): + """A web application firewall rule set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param provisioning_state: The provisioning state of the web application + firewall rule set. + :type provisioning_state: str + :param rule_set_type: Required. The type of the web application firewall + rule set. + :type rule_set_type: str + :param rule_set_version: Required. The version of the web application + firewall rule set type. + :type rule_set_version: str + :param rule_groups: Required. The rule groups of the web application + firewall rule set. + :type rule_groups: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayFirewallRuleGroup] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'rule_groups': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, + } + + def __init__(self, *, rule_set_type: str, rule_set_version: str, rule_groups, id: str=None, location: str=None, tags=None, provisioning_state: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.rule_groups = rule_groups diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_ip_configuration.py index 2a386bb624f9..a04ccaed9e79 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_ip_configuration.py @@ -54,13 +54,13 @@ class ApplicationGatewayFrontendIPConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..952dfab69528 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_ip_configuration_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): + """Frontend IP configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param private_ip_address: PrivateIPAddress of the network interface IP + Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: PrivateIP allocation method. Possible + values include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_11_01.models.IPAllocationMethod + :param subnet: Reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param provisioning_state: Provisioning state of the public IP resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_port.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_port.py index 2b1b32d1b79e..318c0554db0a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_port.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_port.py @@ -41,10 +41,10 @@ class ApplicationGatewayFrontendPort(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, port=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayFrontendPort, self).__init__(id=id) - self.port = port - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendPort, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_port_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_port_py3.py new file mode 100644 index 000000000000..03c6c0a31e9c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_frontend_port_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Frontend port + :type port: int + :param provisioning_state: Provisioning state of the frontend port + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendPort, self).__init__(id=id, **kwargs) + self.port = port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_http_listener.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_http_listener.py index 09b0b623d8c4..e1269e0142f5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_http_listener.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_http_listener.py @@ -61,15 +61,15 @@ class ApplicationGatewayHttpListener(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name=None, ssl_certificate=None, require_server_name_indication=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayHttpListener, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.frontend_port = frontend_port - self.protocol = protocol - self.host_name = host_name - self.ssl_certificate = ssl_certificate - self.require_server_name_indication = require_server_name_indication - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayHttpListener, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.protocol = kwargs.get('protocol', None) + self.host_name = kwargs.get('host_name', None) + self.ssl_certificate = kwargs.get('ssl_certificate', None) + self.require_server_name_indication = kwargs.get('require_server_name_indication', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_http_listener_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_http_listener_py3.py new file mode 100644 index 000000000000..df95beb71c63 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_http_listener_py3.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayHttpListener(SubResource): + """Http listener of an application gateway. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: Frontend IP configuration resource of an + application gateway. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayProtocol + :param host_name: Host name of HTTP listener. + :type host_name: str + :param ssl_certificate: SSL certificate resource of an application + gateway. + :type ssl_certificate: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param require_server_name_indication: Applicable only if protocol is + https. Enables SNI for multi-hosting. + :type require_server_name_indication: bool + :param provisioning_state: Provisioning state of the HTTP listener + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, + 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name: str=None, ssl_certificate=None, require_server_name_indication: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayHttpListener, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.frontend_port = frontend_port + self.protocol = protocol + self.host_name = host_name + self.ssl_certificate = ssl_certificate + self.require_server_name_indication = require_server_name_indication + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ip_configuration.py index ae61074745ef..67099e8c9571 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ip_configuration.py @@ -44,10 +44,10 @@ class ApplicationGatewayIPConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, subnet=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayIPConfiguration, self).__init__(id=id) - self.subnet = subnet - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayIPConfiguration, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..01da1d62d277 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ip_configuration_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 + private IP configuration is allowed. + + :param id: Resource ID. + :type id: str + :param subnet: Reference of the subnet resource. A subnet from where + application gateway gets its private address. + :type subnet: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param provisioning_state: Provisioning state of the application gateway + subnet resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, subnet=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.subnet = subnet + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_path_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_path_rule.py index 5b124156902e..250c16157303 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_path_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_path_rule.py @@ -56,13 +56,13 @@ class ApplicationGatewayPathRule(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, paths=None, backend_address_pool=None, backend_http_settings=None, redirect_configuration=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayPathRule, self).__init__(id=id) - self.paths = paths - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.redirect_configuration = redirect_configuration - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayPathRule, self).__init__(**kwargs) + self.paths = kwargs.get('paths', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_path_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_path_rule_py3.py new file mode 100644 index 000000000000..3e9b279d023e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_path_rule_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayPathRule(SubResource): + """Path rule of URL path map of an application gateway. + + :param id: Resource ID. + :type id: str + :param paths: Path rules of URL path map. + :type paths: list[str] + :param backend_address_pool: Backend address pool resource of URL path map + path rule. + :type backend_address_pool: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param backend_http_settings: Backend http settings resource of URL path + map path rule. + :type backend_http_settings: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of URL path + map path rule. + :type redirect_configuration: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param provisioning_state: Path rule of URL path map resource. Possible + values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'paths': {'key': 'properties.paths', 'type': '[str]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, paths=None, backend_address_pool=None, backend_http_settings=None, redirect_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayPathRule, self).__init__(id=id, **kwargs) + self.paths = paths + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.redirect_configuration = redirect_configuration + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe.py index 2df1d44aad13..4fecada080c5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe.py @@ -76,18 +76,18 @@ class ApplicationGatewayProbe(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, protocol=None, host=None, path=None, interval=None, timeout=None, unhealthy_threshold=None, pick_host_name_from_backend_http_settings=None, min_servers=None, match=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayProbe, self).__init__(id=id) - self.protocol = protocol - self.host = host - self.path = path - self.interval = interval - self.timeout = timeout - self.unhealthy_threshold = unhealthy_threshold - self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings - self.min_servers = min_servers - self.match = match - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayProbe, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.host = kwargs.get('host', None) + self.path = kwargs.get('path', None) + self.interval = kwargs.get('interval', None) + self.timeout = kwargs.get('timeout', None) + self.unhealthy_threshold = kwargs.get('unhealthy_threshold', None) + self.pick_host_name_from_backend_http_settings = kwargs.get('pick_host_name_from_backend_http_settings', None) + self.min_servers = kwargs.get('min_servers', None) + self.match = kwargs.get('match', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe_health_response_match.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe_health_response_match.py index beaef556eb99..b439b9677f8b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe_health_response_match.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe_health_response_match.py @@ -28,7 +28,7 @@ class ApplicationGatewayProbeHealthResponseMatch(Model): 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, } - def __init__(self, body=None, status_codes=None): - super(ApplicationGatewayProbeHealthResponseMatch, self).__init__() - self.body = body - self.status_codes = status_codes + def __init__(self, **kwargs): + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = kwargs.get('body', None) + self.status_codes = kwargs.get('status_codes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe_health_response_match_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe_health_response_match_py3.py new file mode 100644 index 000000000000..6ed2ee8c04ed --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe_health_response_match_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayProbeHealthResponseMatch(Model): + """Application gateway probe health response match. + + :param body: Body that must be contained in the health response. Default + value is empty. + :type body: str + :param status_codes: Allowed ranges of healthy status codes. Default range + of healthy status codes is 200-399. + :type status_codes: list[str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'str'}, + 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, + } + + def __init__(self, *, body: str=None, status_codes=None, **kwargs) -> None: + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = body + self.status_codes = status_codes diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe_py3.py new file mode 100644 index 000000000000..f5cbc9699829 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayProbe(SubResource): + """Probe of the application gateway. + + :param id: Resource ID. + :type id: str + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is + sent to ://: + :type path: str + :param interval: The probing interval in seconds. This is the time + interval between two consecutive probes. Acceptable values are from 1 + second to 86400 seconds. + :type interval: int + :param timeout: the probe timeout in seconds. Probe marked as failed if + valid response is not received with this timeout period. Acceptable values + are from 1 second to 86400 seconds. + :type timeout: int + :param unhealthy_threshold: The probe retry count. Backend server is + marked down after consecutive probe failure count reaches + UnhealthyThreshold. Acceptable values are from 1 second to 20. + :type unhealthy_threshold: int + :param pick_host_name_from_backend_http_settings: Whether the host header + should be picked from the backend http settings. Default value is false. + :type pick_host_name_from_backend_http_settings: bool + :param min_servers: Minimum number of servers that are always marked + healthy. Default value is 0. + :type min_servers: int + :param match: Criterion for classifying a healthy probe response. + :type match: + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayProbeHealthResponseMatch + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host': {'key': 'properties.host', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, + 'pick_host_name_from_backend_http_settings': {'key': 'properties.pickHostNameFromBackendHttpSettings', 'type': 'bool'}, + 'min_servers': {'key': 'properties.minServers', 'type': 'int'}, + 'match': {'key': 'properties.match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, protocol=None, host: str=None, path: str=None, interval: int=None, timeout: int=None, unhealthy_threshold: int=None, pick_host_name_from_backend_http_settings: bool=None, min_servers: int=None, match=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayProbe, self).__init__(id=id, **kwargs) + self.protocol = protocol + self.host = host + self.path = path + self.interval = interval + self.timeout = timeout + self.unhealthy_threshold = unhealthy_threshold + self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings + self.min_servers = min_servers + self.match = match + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_py3.py new file mode 100644 index 000000000000..9f01177da095 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_py3.py @@ -0,0 +1,158 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGateway(Resource): + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslPolicy + :ivar operational_state: Operational state of the application gateway + resource. Possible values include: 'Stopped', 'Starting', 'Running', + 'Stopping' + :vartype operational_state: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayOperationalState + :param gateway_ip_configurations: Subnets of application the gateway + resource. + :type gateway_ip_configurations: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayIPConfiguration] + :param authentication_certificates: Authentication certificates of the + application gateway resource. + :type authentication_certificates: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayAuthenticationCertificate] + :param ssl_certificates: SSL certificates of the application gateway + resource. + :type ssl_certificates: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslCertificate] + :param frontend_ip_configurations: Frontend IP addresses of the + application gateway resource. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayFrontendIPConfiguration] + :param frontend_ports: Frontend ports of the application gateway resource. + :type frontend_ports: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayProbe] + :param backend_address_pools: Backend address pool of the application + gateway resource. + :type backend_address_pools: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendAddressPool] + :param backend_http_settings_collection: Backend http settings of the + application gateway resource. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendHttpSettings] + :param http_listeners: Http listeners of the application gateway resource. + :type http_listeners: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayHttpListener] + :param url_path_maps: URL path map of the application gateway resource. + :type url_path_maps: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application + gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayRequestRoutingRule] + :param redirect_configurations: Redirect configurations of the application + gateway resource. + :type redirect_configurations: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayRedirectConfiguration] + :param web_application_firewall_configuration: Web application firewall + configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param enable_http2: Whether HTTP2 is enabled on the application gateway + resource. + :type enable_http2: bool + :param resource_guid: Resource GUID property of the application gateway + resource. + :type resource_guid: str + :param provisioning_state: Provisioning state of the application gateway + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operational_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, + 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, + 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, + 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, + 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, + 'redirect_configurations': {'key': 'properties.redirectConfigurations', 'type': '[ApplicationGatewayRedirectConfiguration]'}, + 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, + 'enable_http2': {'key': 'properties.enableHttp2', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, redirect_configurations=None, web_application_firewall_configuration=None, enable_http2: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.ssl_policy = ssl_policy + self.operational_state = None + self.gateway_ip_configurations = gateway_ip_configurations + self.authentication_certificates = authentication_certificates + self.ssl_certificates = ssl_certificates + self.frontend_ip_configurations = frontend_ip_configurations + self.frontend_ports = frontend_ports + self.probes = probes + self.backend_address_pools = backend_address_pools + self.backend_http_settings_collection = backend_http_settings_collection + self.http_listeners = http_listeners + self.url_path_maps = url_path_maps + self.request_routing_rules = request_routing_rules + self.redirect_configurations = redirect_configurations + self.web_application_firewall_configuration = web_application_firewall_configuration + self.enable_http2 = enable_http2 + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_redirect_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_redirect_configuration.py index 42ac21c6e15d..46005273d75d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_redirect_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_redirect_configuration.py @@ -66,16 +66,16 @@ class ApplicationGatewayRedirectConfiguration(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, redirect_type=None, target_listener=None, target_url=None, include_path=None, include_query_string=None, request_routing_rules=None, url_path_maps=None, path_rules=None, name=None, etag=None, type=None): - super(ApplicationGatewayRedirectConfiguration, self).__init__(id=id) - self.redirect_type = redirect_type - self.target_listener = target_listener - self.target_url = target_url - self.include_path = include_path - self.include_query_string = include_query_string - self.request_routing_rules = request_routing_rules - self.url_path_maps = url_path_maps - self.path_rules = path_rules - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayRedirectConfiguration, self).__init__(**kwargs) + self.redirect_type = kwargs.get('redirect_type', None) + self.target_listener = kwargs.get('target_listener', None) + self.target_url = kwargs.get('target_url', None) + self.include_path = kwargs.get('include_path', None) + self.include_query_string = kwargs.get('include_query_string', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.path_rules = kwargs.get('path_rules', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_redirect_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_redirect_configuration_py3.py new file mode 100644 index 000000000000..fad804f5fa6b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_redirect_configuration_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRedirectConfiguration(SubResource): + """Redirect configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param redirect_type: Supported http redirection types - Permanent, + Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', + 'SeeOther', 'Temporary' + :type redirect_type: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayRedirectType + :param target_listener: Reference to a listener to redirect the request + to. + :type target_listener: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param target_url: Url to redirect the request to. + :type target_url: str + :param include_path: Include path in the redirected url. + :type include_path: bool + :param include_query_string: Include query string in the redirected url. + :type include_query_string: bool + :param request_routing_rules: Request routing specifying redirect + configuration. + :type request_routing_rules: + list[~azure.mgmt.network.v2017_11_01.models.SubResource] + :param url_path_maps: Url path maps specifying default redirect + configuration. + :type url_path_maps: + list[~azure.mgmt.network.v2017_11_01.models.SubResource] + :param path_rules: Path rules specifying redirect configuration. + :type path_rules: list[~azure.mgmt.network.v2017_11_01.models.SubResource] + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'redirect_type': {'key': 'properties.redirectType', 'type': 'str'}, + 'target_listener': {'key': 'properties.targetListener', 'type': 'SubResource'}, + 'target_url': {'key': 'properties.targetUrl', 'type': 'str'}, + 'include_path': {'key': 'properties.includePath', 'type': 'bool'}, + 'include_query_string': {'key': 'properties.includeQueryString', 'type': 'bool'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[SubResource]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[SubResource]'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[SubResource]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, redirect_type=None, target_listener=None, target_url: str=None, include_path: bool=None, include_query_string: bool=None, request_routing_rules=None, url_path_maps=None, path_rules=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayRedirectConfiguration, self).__init__(id=id, **kwargs) + self.redirect_type = redirect_type + self.target_listener = target_listener + self.target_url = target_url + self.include_path = include_path + self.include_query_string = include_query_string + self.request_routing_rules = request_routing_rules + self.url_path_maps = url_path_maps + self.path_rules = path_rules + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_request_routing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_request_routing_rule.py index 7eb7297b0c32..7e504d5ed361 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_request_routing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_request_routing_rule.py @@ -64,15 +64,15 @@ class ApplicationGatewayRequestRoutingRule(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, redirect_configuration=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id) - self.rule_type = rule_type - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.http_listener = http_listener - self.url_path_map = url_path_map - self.redirect_configuration = redirect_configuration - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayRequestRoutingRule, self).__init__(**kwargs) + self.rule_type = kwargs.get('rule_type', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.http_listener = kwargs.get('http_listener', None) + self.url_path_map = kwargs.get('url_path_map', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_request_routing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_request_routing_rule_py3.py new file mode 100644 index 000000000000..d6d95e7833a2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_request_routing_rule_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRequestRoutingRule(SubResource): + """Request routing rule of an application gateway. + + :param id: Resource ID. + :type id: str + :param rule_type: Rule type. Possible values include: 'Basic', + 'PathBasedRouting' + :type rule_type: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayRequestRoutingRuleType + :param backend_address_pool: Backend address pool resource of the + application gateway. + :type backend_address_pool: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param backend_http_settings: Frontend port resource of the application + gateway. + :type backend_http_settings: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of the + application gateway. + :type redirect_configuration: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param provisioning_state: Provisioning state of the request routing rule + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, + 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, redirect_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id, **kwargs) + self.rule_type = rule_type + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.http_listener = http_listener + self.url_path_map = url_path_map + self.redirect_configuration = redirect_configuration + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_sku.py index 3e453428dae2..5798ca9aedbf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_sku.py @@ -34,8 +34,8 @@ class ApplicationGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(ApplicationGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_sku_py3.py new file mode 100644 index 000000000000..295b3ffd1173 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_sku_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySku(Model): + """SKU of an application gateway. + + :param name: Name of an application gateway SKU. Possible values include: + 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', + 'WAF_Large' + :type name: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySkuName + :param tier: Tier of an application gateway. Possible values include: + 'Standard', 'WAF' + :type tier: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayTier + :param capacity: Capacity (instance count) of an application gateway. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_certificate.py index 104629e84a5c..1dfedd4908df 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_certificate.py @@ -50,12 +50,12 @@ class ApplicationGatewaySslCertificate(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, data=None, password=None, public_cert_data=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewaySslCertificate, self).__init__(id=id) - self.data = data - self.password = password - self.public_cert_data = public_cert_data - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewaySslCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.password = kwargs.get('password', None) + self.public_cert_data = kwargs.get('public_cert_data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_certificate_py3.py new file mode 100644 index 000000000000..ddb6745c9005 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_certificate_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Base-64 encoded pfx certificate. Only applicable in PUT + Request. + :type data: str + :param password: Password for the pfx file specified in data. Only + applicable in PUT request. + :type password: str + :param public_cert_data: Base-64 encoded Public cert data corresponding to + pfx specified in data. Only applicable in GET request. + :type public_cert_data: str + :param provisioning_state: Provisioning state of the SSL certificate + resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, password: str=None, public_cert_data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewaySslCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.password = password + self.public_cert_data = public_cert_data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_policy.py index 2470221ce969..7abd81edbe1f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_policy.py @@ -47,10 +47,10 @@ class ApplicationGatewaySslPolicy(Model): 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, } - def __init__(self, disabled_ssl_protocols=None, policy_type=None, policy_name=None, cipher_suites=None, min_protocol_version=None): - super(ApplicationGatewaySslPolicy, self).__init__() - self.disabled_ssl_protocols = disabled_ssl_protocols - self.policy_type = policy_type - self.policy_name = policy_name - self.cipher_suites = cipher_suites - self.min_protocol_version = min_protocol_version + def __init__(self, **kwargs): + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = kwargs.get('disabled_ssl_protocols', None) + self.policy_type = kwargs.get('policy_type', None) + self.policy_name = kwargs.get('policy_name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_policy_py3.py new file mode 100644 index 000000000000..e06fcf38f6e0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_policy_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySslPolicy(Model): + """Application Gateway Ssl policy. + + :param disabled_ssl_protocols: Ssl protocols to be disabled on application + gateway. + :type disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslProtocol] + :param policy_type: Type of Ssl Policy. Possible values include: + 'Predefined', 'Custom' + :type policy_type: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslPolicyType + :param policy_name: Name of Ssl predefined policy. Possible values + include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type policy_name: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslPolicyName + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order to application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, + 'policy_type': {'key': 'policyType', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'cipher_suites': {'key': 'cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, *, disabled_ssl_protocols=None, policy_type=None, policy_name=None, cipher_suites=None, min_protocol_version=None, **kwargs) -> None: + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = disabled_ssl_protocols + self.policy_type = policy_type + self.policy_name = policy_name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_predefined_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_predefined_policy.py index 42817da66c00..c880863e0fbd 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_predefined_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_predefined_policy.py @@ -37,8 +37,8 @@ class ApplicationGatewaySslPredefinedPolicy(SubResource): 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, } - def __init__(self, id=None, name=None, cipher_suites=None, min_protocol_version=None): - super(ApplicationGatewaySslPredefinedPolicy, self).__init__(id=id) - self.name = name - self.cipher_suites = cipher_suites - self.min_protocol_version = min_protocol_version + def __init__(self, **kwargs): + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_predefined_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_predefined_policy_py3.py new file mode 100644 index 000000000000..a13fd8182b97 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_predefined_policy_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslPredefinedPolicy(SubResource): + """An Ssl predefined policy. + + :param id: Resource ID. + :type id: str + :param name: Name of Ssl predefined policy. + :type name: str + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order for application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, cipher_suites=None, min_protocol_version=None, **kwargs) -> None: + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(id=id, **kwargs) + self.name = name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_url_path_map.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_url_path_map.py index 7075977a5523..b5450f09f556 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_url_path_map.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_url_path_map.py @@ -58,13 +58,13 @@ class ApplicationGatewayUrlPathMap(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None, default_backend_address_pool=None, default_backend_http_settings=None, default_redirect_configuration=None, path_rules=None, provisioning_state=None, name=None, etag=None, type=None): - super(ApplicationGatewayUrlPathMap, self).__init__(id=id) - self.default_backend_address_pool = default_backend_address_pool - self.default_backend_http_settings = default_backend_http_settings - self.default_redirect_configuration = default_redirect_configuration - self.path_rules = path_rules - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.type = type + def __init__(self, **kwargs): + super(ApplicationGatewayUrlPathMap, self).__init__(**kwargs) + self.default_backend_address_pool = kwargs.get('default_backend_address_pool', None) + self.default_backend_http_settings = kwargs.get('default_backend_http_settings', None) + self.default_redirect_configuration = kwargs.get('default_redirect_configuration', None) + self.path_rules = kwargs.get('path_rules', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_url_path_map_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_url_path_map_py3.py new file mode 100644 index 000000000000..032605ba3689 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_url_path_map_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayUrlPathMap(SubResource): + """UrlPathMaps give a url path to the backend mapping information for + PathBasedRouting. + + :param id: Resource ID. + :type id: str + :param default_backend_address_pool: Default backend address pool resource + of URL path map. + :type default_backend_address_pool: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param default_backend_http_settings: Default backend http settings + resource of URL path map. + :type default_backend_http_settings: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param default_redirect_configuration: Default redirect configuration + resource of URL path map. + :type default_redirect_configuration: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayPathRule] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, + 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, + 'default_redirect_configuration': {'key': 'properties.defaultRedirectConfiguration', 'type': 'SubResource'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, default_backend_address_pool=None, default_backend_http_settings=None, default_redirect_configuration=None, path_rules=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayUrlPathMap, self).__init__(id=id, **kwargs) + self.default_backend_address_pool = default_backend_address_pool + self.default_backend_http_settings = default_backend_http_settings + self.default_redirect_configuration = default_redirect_configuration + self.path_rules = path_rules + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_web_application_firewall_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_web_application_firewall_configuration.py index 52fca3f5c334..7289501a805d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_web_application_firewall_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_web_application_firewall_configuration.py @@ -15,16 +15,19 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): """Application gateway web application firewall configuration. - :param enabled: Whether the web application firewall is enabled or not. + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. :type enabled: bool - :param firewall_mode: Web application firewall mode. Possible values - include: 'Detection', 'Prevention' + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' :type firewall_mode: str or ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayFirewallMode - :param rule_set_type: The type of the web application firewall rule set. - Possible values are: 'OWASP'. + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. :type rule_set_type: str - :param rule_set_version: The version of the rule set type. + :param rule_set_version: Required. The version of the rule set type. :type rule_set_version: str :param disabled_rule_groups: The disabled rule groups. :type disabled_rule_groups: @@ -46,10 +49,10 @@ class ApplicationGatewayWebApplicationFirewallConfiguration(Model): 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, } - def __init__(self, enabled, firewall_mode, rule_set_type, rule_set_version, disabled_rule_groups=None): - super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__() - self.enabled = enabled - self.firewall_mode = firewall_mode - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.disabled_rule_groups = disabled_rule_groups + def __init__(self, **kwargs): + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.firewall_mode = kwargs.get('firewall_mode', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.disabled_rule_groups = kwargs.get('disabled_rule_groups', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_web_application_firewall_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_web_application_firewall_configuration_py3.py new file mode 100644 index 000000000000..a9feb16c651e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_web_application_firewall_configuration_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayWebApplicationFirewallConfiguration(Model): + """Application gateway web application firewall configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. + :type enabled: bool + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' + :type firewall_mode: str or + ~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayFirewallMode + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. + :type rule_set_type: str + :param rule_set_version: Required. The version of the rule set type. + :type rule_set_version: str + :param disabled_rule_groups: The disabled rule groups. + :type disabled_rule_groups: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayFirewallDisabledRuleGroup] + """ + + _validation = { + 'enabled': {'required': True}, + 'firewall_mode': {'required': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, + } + + def __init__(self, *, enabled: bool, firewall_mode, rule_set_type: str, rule_set_version: str, disabled_rule_groups=None, **kwargs) -> None: + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = enabled + self.firewall_mode = firewall_mode + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.disabled_rule_groups = disabled_rule_groups diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_security_group.py index 302abc528319..1372f778ae62 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_security_group.py @@ -61,8 +61,8 @@ class ApplicationSecurityGroup(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None): - super(ApplicationSecurityGroup, self).__init__(id=id, location=location, tags=tags) + def __init__(self, **kwargs): + super(ApplicationSecurityGroup, self).__init__(**kwargs) self.resource_guid = None self.provisioning_state = None self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_security_group_py3.py new file mode 100644 index 000000000000..f14f84e29b86 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_security_group_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationSecurityGroup(Resource): + """An application security group in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar resource_guid: The resource GUID property of the application + security group resource. It uniquely identifies a resource, even if the + user changes its name or migrate the resource across subscriptions or + resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the application + security group resource. Possible values are: 'Succeeded', 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(ApplicationSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.resource_guid = None + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/availability.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/availability.py index c45356ed4847..16b7cfa04955 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/availability.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/availability.py @@ -29,8 +29,8 @@ class Availability(Model): 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, } - def __init__(self, time_grain=None, retention=None, blob_duration=None): - super(Availability, self).__init__() - self.time_grain = time_grain - self.retention = retention - self.blob_duration = blob_duration + def __init__(self, **kwargs): + super(Availability, self).__init__(**kwargs) + self.time_grain = kwargs.get('time_grain', None) + self.retention = kwargs.get('retention', None) + self.blob_duration = kwargs.get('blob_duration', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/availability_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/availability_py3.py new file mode 100644 index 000000000000..874d8878184f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/availability_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Availability(Model): + """Availability of the metric. + + :param time_grain: The time grain of the availability. + :type time_grain: str + :param retention: The retention of the availability. + :type retention: str + :param blob_duration: Duration of the availability blob. + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, time_grain: str=None, retention: str=None, blob_duration: str=None, **kwargs) -> None: + super(Availability, self).__init__(**kwargs) + self.time_grain = time_grain + self.retention = retention + self.blob_duration = blob_duration diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list.py index 9799ee53d3f5..24511355c7fc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list.py @@ -15,7 +15,9 @@ class AvailableProvidersList(Model): """List of available countries with details. - :param countries: List of available countries. + All required parameters must be populated in order to send to Azure. + + :param countries: Required. List of available countries. :type countries: list[~azure.mgmt.network.v2017_11_01.models.AvailableProvidersListCountry] """ @@ -28,6 +30,6 @@ class AvailableProvidersList(Model): 'countries': {'key': 'countries', 'type': '[AvailableProvidersListCountry]'}, } - def __init__(self, countries): - super(AvailableProvidersList, self).__init__() - self.countries = countries + def __init__(self, **kwargs): + super(AvailableProvidersList, self).__init__(**kwargs) + self.countries = kwargs.get('countries', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_city.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_city.py index cfd9fa55e297..5f9aa271b981 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_city.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_city.py @@ -26,7 +26,7 @@ class AvailableProvidersListCity(Model): 'providers': {'key': 'providers', 'type': '[str]'}, } - def __init__(self, city_name=None, providers=None): - super(AvailableProvidersListCity, self).__init__() - self.city_name = city_name - self.providers = providers + def __init__(self, **kwargs): + super(AvailableProvidersListCity, self).__init__(**kwargs) + self.city_name = kwargs.get('city_name', None) + self.providers = kwargs.get('providers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_city_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_city_py3.py new file mode 100644 index 000000000000..888aa46a7cfc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_city_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListCity(Model): + """City or town details. + + :param city_name: The city or town name. + :type city_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + """ + + _attribute_map = { + 'city_name': {'key': 'cityName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + } + + def __init__(self, *, city_name: str=None, providers=None, **kwargs) -> None: + super(AvailableProvidersListCity, self).__init__(**kwargs) + self.city_name = city_name + self.providers = providers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_country.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_country.py index 4d9ca0dbdfb8..8e04720269b8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_country.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_country.py @@ -30,8 +30,8 @@ class AvailableProvidersListCountry(Model): 'states': {'key': 'states', 'type': '[AvailableProvidersListState]'}, } - def __init__(self, country_name=None, providers=None, states=None): - super(AvailableProvidersListCountry, self).__init__() - self.country_name = country_name - self.providers = providers - self.states = states + def __init__(self, **kwargs): + super(AvailableProvidersListCountry, self).__init__(**kwargs) + self.country_name = kwargs.get('country_name', None) + self.providers = kwargs.get('providers', None) + self.states = kwargs.get('states', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_country_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_country_py3.py new file mode 100644 index 000000000000..a3e139abce99 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_country_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListCountry(Model): + """Country details. + + :param country_name: The country name. + :type country_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param states: List of available states in the country. + :type states: + list[~azure.mgmt.network.v2017_11_01.models.AvailableProvidersListState] + """ + + _attribute_map = { + 'country_name': {'key': 'countryName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'states': {'key': 'states', 'type': '[AvailableProvidersListState]'}, + } + + def __init__(self, *, country_name: str=None, providers=None, states=None, **kwargs) -> None: + super(AvailableProvidersListCountry, self).__init__(**kwargs) + self.country_name = country_name + self.providers = providers + self.states = states diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_parameters.py index 4eb335e056b6..152b3b787c2b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_parameters.py @@ -33,9 +33,9 @@ class AvailableProvidersListParameters(Model): 'city': {'key': 'city', 'type': 'str'}, } - def __init__(self, azure_locations=None, country=None, state=None, city=None): - super(AvailableProvidersListParameters, self).__init__() - self.azure_locations = azure_locations - self.country = country - self.state = state - self.city = city + def __init__(self, **kwargs): + super(AvailableProvidersListParameters, self).__init__(**kwargs) + self.azure_locations = kwargs.get('azure_locations', None) + self.country = kwargs.get('country', None) + self.state = kwargs.get('state', None) + self.city = kwargs.get('city', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_parameters_py3.py new file mode 100644 index 000000000000..d5c541a7fcb6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_parameters_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListParameters(Model): + """Constraints that determine the list of available Internet service + providers. + + :param azure_locations: A list of Azure regions. + :type azure_locations: list[str] + :param country: The country for available providers list. + :type country: str + :param state: The state for available providers list. + :type state: str + :param city: The city or town for available providers list. + :type city: str + """ + + _attribute_map = { + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__(self, *, azure_locations=None, country: str=None, state: str=None, city: str=None, **kwargs) -> None: + super(AvailableProvidersListParameters, self).__init__(**kwargs) + self.azure_locations = azure_locations + self.country = country + self.state = state + self.city = city diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_py3.py new file mode 100644 index 000000000000..08b675231c61 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersList(Model): + """List of available countries with details. + + All required parameters must be populated in order to send to Azure. + + :param countries: Required. List of available countries. + :type countries: + list[~azure.mgmt.network.v2017_11_01.models.AvailableProvidersListCountry] + """ + + _validation = { + 'countries': {'required': True}, + } + + _attribute_map = { + 'countries': {'key': 'countries', 'type': '[AvailableProvidersListCountry]'}, + } + + def __init__(self, *, countries, **kwargs) -> None: + super(AvailableProvidersList, self).__init__(**kwargs) + self.countries = countries diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_state.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_state.py index 70824a363fc2..8924344f5b2b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_state.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_state.py @@ -30,8 +30,8 @@ class AvailableProvidersListState(Model): 'cities': {'key': 'cities', 'type': '[AvailableProvidersListCity]'}, } - def __init__(self, state_name=None, providers=None, cities=None): - super(AvailableProvidersListState, self).__init__() - self.state_name = state_name - self.providers = providers - self.cities = cities + def __init__(self, **kwargs): + super(AvailableProvidersListState, self).__init__(**kwargs) + self.state_name = kwargs.get('state_name', None) + self.providers = kwargs.get('providers', None) + self.cities = kwargs.get('cities', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_state_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_state_py3.py new file mode 100644 index 000000000000..51d9e7b085cd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/available_providers_list_state_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListState(Model): + """State details. + + :param state_name: The state name. + :type state_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param cities: List of available cities or towns in the state. + :type cities: + list[~azure.mgmt.network.v2017_11_01.models.AvailableProvidersListCity] + """ + + _attribute_map = { + 'state_name': {'key': 'stateName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'cities': {'key': 'cities', 'type': '[AvailableProvidersListCity]'}, + } + + def __init__(self, *, state_name: str=None, providers=None, cities=None, **kwargs) -> None: + super(AvailableProvidersListState, self).__init__(**kwargs) + self.state_name = state_name + self.providers = providers + self.cities = cities diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_async_operation_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_async_operation_result.py index 4f83281bbdbc..061803ce5fe0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_async_operation_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_async_operation_result.py @@ -36,7 +36,7 @@ class AzureAsyncOperationResult(Model): 'error': {'key': 'error', 'type': 'Error'}, } - def __init__(self, status=None, error=None): - super(AzureAsyncOperationResult, self).__init__() - self.status = status - self.error = error + def __init__(self, **kwargs): + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_async_operation_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_async_operation_result_py3.py new file mode 100644 index 000000000000..d7e9690926e7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_async_operation_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureAsyncOperationResult(Model): + """The response body contains the status of the specified asynchronous + operation, indicating whether it has succeeded, is in progress, or has + failed. Note that this status is distinct from the HTTP status code + returned for the Get Operation Status operation itself. If the asynchronous + operation succeeded, the response body includes the HTTP status code for + the successful request. If the asynchronous operation failed, the response + body includes the HTTP status code for the failed request and error + information regarding the failure. + + :param status: Status of the Azure async operation. Possible values are: + 'InProgress', 'Succeeded', and 'Failed'. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or + ~azure.mgmt.network.v2017_11_01.models.NetworkOperationStatus + :param error: + :type error: ~azure.mgmt.network.v2017_11_01.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, status=None, error=None, **kwargs) -> None: + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report.py index ae2341144cdf..361f65d8b2f0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report.py @@ -15,13 +15,16 @@ class AzureReachabilityReport(Model): """Azure reachability report details. - :param aggregation_level: The aggregation level of Azure reachability - report. Can be Country, State or City. + All required parameters must be populated in order to send to Azure. + + :param aggregation_level: Required. The aggregation level of Azure + reachability report. Can be Country, State or City. :type aggregation_level: str - :param provider_location: + :param provider_location: Required. :type provider_location: ~azure.mgmt.network.v2017_11_01.models.AzureReachabilityReportLocation - :param reachability_report: List of Azure reachability report items. + :param reachability_report: Required. List of Azure reachability report + items. :type reachability_report: list[~azure.mgmt.network.v2017_11_01.models.AzureReachabilityReportItem] """ @@ -38,8 +41,8 @@ class AzureReachabilityReport(Model): 'reachability_report': {'key': 'reachabilityReport', 'type': '[AzureReachabilityReportItem]'}, } - def __init__(self, aggregation_level, provider_location, reachability_report): - super(AzureReachabilityReport, self).__init__() - self.aggregation_level = aggregation_level - self.provider_location = provider_location - self.reachability_report = reachability_report + def __init__(self, **kwargs): + super(AzureReachabilityReport, self).__init__(**kwargs) + self.aggregation_level = kwargs.get('aggregation_level', None) + self.provider_location = kwargs.get('provider_location', None) + self.reachability_report = kwargs.get('reachability_report', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_item.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_item.py index 51df8658041a..b77687cd482d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_item.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_item.py @@ -30,8 +30,8 @@ class AzureReachabilityReportItem(Model): 'latencies': {'key': 'latencies', 'type': '[AzureReachabilityReportLatencyInfo]'}, } - def __init__(self, provider=None, azure_location=None, latencies=None): - super(AzureReachabilityReportItem, self).__init__() - self.provider = provider - self.azure_location = azure_location - self.latencies = latencies + def __init__(self, **kwargs): + super(AzureReachabilityReportItem, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.azure_location = kwargs.get('azure_location', None) + self.latencies = kwargs.get('latencies', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_item_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_item_py3.py new file mode 100644 index 000000000000..f4d6cb29b59a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_item_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportItem(Model): + """Azure reachability report details for a given provider location. + + :param provider: The Internet service provider. + :type provider: str + :param azure_location: The Azure region. + :type azure_location: str + :param latencies: List of latency details for each of the time series. + :type latencies: + list[~azure.mgmt.network.v2017_11_01.models.AzureReachabilityReportLatencyInfo] + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'azure_location': {'key': 'azureLocation', 'type': 'str'}, + 'latencies': {'key': 'latencies', 'type': '[AzureReachabilityReportLatencyInfo]'}, + } + + def __init__(self, *, provider: str=None, azure_location: str=None, latencies=None, **kwargs) -> None: + super(AzureReachabilityReportItem, self).__init__(**kwargs) + self.provider = provider + self.azure_location = azure_location + self.latencies = latencies diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_latency_info.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_latency_info.py index c4920ffb64be..e5f77641a138 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_latency_info.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_latency_info.py @@ -31,7 +31,7 @@ class AzureReachabilityReportLatencyInfo(Model): 'score': {'key': 'score', 'type': 'int'}, } - def __init__(self, time_stamp=None, score=None): - super(AzureReachabilityReportLatencyInfo, self).__init__() - self.time_stamp = time_stamp - self.score = score + def __init__(self, **kwargs): + super(AzureReachabilityReportLatencyInfo, self).__init__(**kwargs) + self.time_stamp = kwargs.get('time_stamp', None) + self.score = kwargs.get('score', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_latency_info_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_latency_info_py3.py new file mode 100644 index 000000000000..dd9d8fda369c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_latency_info_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportLatencyInfo(Model): + """Details on latency for a time series. + + :param time_stamp: The time stamp. + :type time_stamp: datetime + :param score: The relative latency score between 1 and 100, higher values + indicating a faster connection. + :type score: int + """ + + _validation = { + 'score': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, + 'score': {'key': 'score', 'type': 'int'}, + } + + def __init__(self, *, time_stamp=None, score: int=None, **kwargs) -> None: + super(AzureReachabilityReportLatencyInfo, self).__init__(**kwargs) + self.time_stamp = time_stamp + self.score = score diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_location.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_location.py index 0da63a04e016..76c132e89575 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_location.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_location.py @@ -15,7 +15,9 @@ class AzureReachabilityReportLocation(Model): """Parameters that define a geographic location. - :param country: The name of the country. + All required parameters must be populated in order to send to Azure. + + :param country: Required. The name of the country. :type country: str :param state: The name of the state. :type state: str @@ -33,8 +35,8 @@ class AzureReachabilityReportLocation(Model): 'city': {'key': 'city', 'type': 'str'}, } - def __init__(self, country, state=None, city=None): - super(AzureReachabilityReportLocation, self).__init__() - self.country = country - self.state = state - self.city = city + def __init__(self, **kwargs): + super(AzureReachabilityReportLocation, self).__init__(**kwargs) + self.country = kwargs.get('country', None) + self.state = kwargs.get('state', None) + self.city = kwargs.get('city', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_location_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_location_py3.py new file mode 100644 index 000000000000..1db868eab46f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_location_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportLocation(Model): + """Parameters that define a geographic location. + + All required parameters must be populated in order to send to Azure. + + :param country: Required. The name of the country. + :type country: str + :param state: The name of the state. + :type state: str + :param city: The name of the city or town. + :type city: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__(self, *, country: str, state: str=None, city: str=None, **kwargs) -> None: + super(AzureReachabilityReportLocation, self).__init__(**kwargs) + self.country = country + self.state = state + self.city = city diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_parameters.py index 644c43988f26..3254fed6c705 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_parameters.py @@ -15,16 +15,19 @@ class AzureReachabilityReportParameters(Model): """Geographic and time constraints for Azure reachability report. - :param provider_location: + All required parameters must be populated in order to send to Azure. + + :param provider_location: Required. :type provider_location: ~azure.mgmt.network.v2017_11_01.models.AzureReachabilityReportLocation :param providers: List of Internet service providers. :type providers: list[str] :param azure_locations: Optional Azure regions to scope the query to. :type azure_locations: list[str] - :param start_time: The start time for the Azure reachability report. + :param start_time: Required. The start time for the Azure reachability + report. :type start_time: datetime - :param end_time: The end time for the Azure reachability report. + :param end_time: Required. The end time for the Azure reachability report. :type end_time: datetime """ @@ -42,10 +45,10 @@ class AzureReachabilityReportParameters(Model): 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, } - def __init__(self, provider_location, start_time, end_time, providers=None, azure_locations=None): - super(AzureReachabilityReportParameters, self).__init__() - self.provider_location = provider_location - self.providers = providers - self.azure_locations = azure_locations - self.start_time = start_time - self.end_time = end_time + def __init__(self, **kwargs): + super(AzureReachabilityReportParameters, self).__init__(**kwargs) + self.provider_location = kwargs.get('provider_location', None) + self.providers = kwargs.get('providers', None) + self.azure_locations = kwargs.get('azure_locations', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_parameters_py3.py new file mode 100644 index 000000000000..010dcd50cf70 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_parameters_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportParameters(Model): + """Geographic and time constraints for Azure reachability report. + + All required parameters must be populated in order to send to Azure. + + :param provider_location: Required. + :type provider_location: + ~azure.mgmt.network.v2017_11_01.models.AzureReachabilityReportLocation + :param providers: List of Internet service providers. + :type providers: list[str] + :param azure_locations: Optional Azure regions to scope the query to. + :type azure_locations: list[str] + :param start_time: Required. The start time for the Azure reachability + report. + :type start_time: datetime + :param end_time: Required. The end time for the Azure reachability report. + :type end_time: datetime + """ + + _validation = { + 'provider_location': {'required': True}, + 'start_time': {'required': True}, + 'end_time': {'required': True}, + } + + _attribute_map = { + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, provider_location, start_time, end_time, providers=None, azure_locations=None, **kwargs) -> None: + super(AzureReachabilityReportParameters, self).__init__(**kwargs) + self.provider_location = provider_location + self.providers = providers + self.azure_locations = azure_locations + self.start_time = start_time + self.end_time = end_time diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_py3.py new file mode 100644 index 000000000000..f43dd8bc8677 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReport(Model): + """Azure reachability report details. + + All required parameters must be populated in order to send to Azure. + + :param aggregation_level: Required. The aggregation level of Azure + reachability report. Can be Country, State or City. + :type aggregation_level: str + :param provider_location: Required. + :type provider_location: + ~azure.mgmt.network.v2017_11_01.models.AzureReachabilityReportLocation + :param reachability_report: Required. List of Azure reachability report + items. + :type reachability_report: + list[~azure.mgmt.network.v2017_11_01.models.AzureReachabilityReportItem] + """ + + _validation = { + 'aggregation_level': {'required': True}, + 'provider_location': {'required': True}, + 'reachability_report': {'required': True}, + } + + _attribute_map = { + 'aggregation_level': {'key': 'aggregationLevel', 'type': 'str'}, + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'reachability_report': {'key': 'reachabilityReport', 'type': '[AzureReachabilityReportItem]'}, + } + + def __init__(self, *, aggregation_level: str, provider_location, reachability_report, **kwargs) -> None: + super(AzureReachabilityReport, self).__init__(**kwargs) + self.aggregation_level = aggregation_level + self.provider_location = provider_location + self.reachability_report = reachability_report diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/backend_address_pool.py index b67c6fc2a4d3..425bb49eba04 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/backend_address_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/backend_address_pool.py @@ -59,11 +59,11 @@ class BackendAddressPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, provisioning_state=None, name=None, etag=None): - super(BackendAddressPool, self).__init__(id=id) + def __init__(self, **kwargs): + super(BackendAddressPool, self).__init__(**kwargs) self.backend_ip_configurations = None self.load_balancing_rules = None self.outbound_nat_rule = None - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/backend_address_pool_py3.py new file mode 100644 index 000000000000..675a368f9489 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/backend_address_pool_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class BackendAddressPool(SubResource): + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar backend_ip_configurations: Gets collection of references to IP + addresses defined in network interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: Gets load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_11_01.models.SubResource] + :ivar outbound_nat_rule: Gets outbound rules that use this backend address + pool. + :vartype outbound_nat_rule: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param provisioning_state: Get provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configurations': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'outbound_nat_rule': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'outbound_nat_rule': {'key': 'properties.outboundNatRule', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(BackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = None + self.load_balancing_rules = None + self.outbound_nat_rule = None + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_community.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_community.py index 8275a0e4048c..472a170e9ceb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_community.py @@ -42,11 +42,11 @@ class BGPCommunity(Model): 'service_group': {'key': 'serviceGroup', 'type': 'str'}, } - def __init__(self, service_supported_region=None, community_name=None, community_value=None, community_prefixes=None, is_authorized_to_use=None, service_group=None): - super(BGPCommunity, self).__init__() - self.service_supported_region = service_supported_region - self.community_name = community_name - self.community_value = community_value - self.community_prefixes = community_prefixes - self.is_authorized_to_use = is_authorized_to_use - self.service_group = service_group + def __init__(self, **kwargs): + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = kwargs.get('service_supported_region', None) + self.community_name = kwargs.get('community_name', None) + self.community_value = kwargs.get('community_value', None) + self.community_prefixes = kwargs.get('community_prefixes', None) + self.is_authorized_to_use = kwargs.get('is_authorized_to_use', None) + self.service_group = kwargs.get('service_group', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_community_py3.py new file mode 100644 index 000000000000..86b740c84404 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_community_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BGPCommunity(Model): + """Contains bgp community information offered in Service Community resources. + + :param service_supported_region: The region which the service support. + e.g. For O365, region is Global. + :type service_supported_region: str + :param community_name: The name of the bgp community. e.g. Skype. + :type community_name: str + :param community_value: The value of the bgp community. For more + information: + https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + :type community_value: str + :param community_prefixes: The prefixes that the bgp community contains. + :type community_prefixes: list[str] + :param is_authorized_to_use: Customer is authorized to use bgp community + or not. + :type is_authorized_to_use: bool + :param service_group: The service group of the bgp community contains. + :type service_group: str + """ + + _attribute_map = { + 'service_supported_region': {'key': 'serviceSupportedRegion', 'type': 'str'}, + 'community_name': {'key': 'communityName', 'type': 'str'}, + 'community_value': {'key': 'communityValue', 'type': 'str'}, + 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, + 'is_authorized_to_use': {'key': 'isAuthorizedToUse', 'type': 'bool'}, + 'service_group': {'key': 'serviceGroup', 'type': 'str'}, + } + + def __init__(self, *, service_supported_region: str=None, community_name: str=None, community_value: str=None, community_prefixes=None, is_authorized_to_use: bool=None, service_group: str=None, **kwargs) -> None: + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = service_supported_region + self.community_name = community_name + self.community_value = community_value + self.community_prefixes = community_prefixes + self.is_authorized_to_use = is_authorized_to_use + self.service_group = service_group diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status.py index cc13341d564f..215a08f344b0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status.py @@ -59,8 +59,8 @@ class BgpPeerStatus(Model): 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, } - def __init__(self): - super(BgpPeerStatus, self).__init__() + def __init__(self, **kwargs): + super(BgpPeerStatus, self).__init__(**kwargs) self.local_address = None self.neighbor = None self.asn = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status_list_result.py index 2a93da8ce000..15e90172f6fa 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status_list_result.py @@ -23,6 +23,6 @@ class BgpPeerStatusListResult(Model): 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, } - def __init__(self, value=None): - super(BgpPeerStatusListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status_list_result_py3.py new file mode 100644 index 000000000000..e27b65d0c19b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatusListResult(Model): + """Response for list BGP peer status API service call. + + :param value: List of BGP peers + :type value: list[~azure.mgmt.network.v2017_11_01.models.BgpPeerStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status_py3.py new file mode 100644 index 000000000000..d9d2e711ba3d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_peer_status_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatus(Model): + """BGP peer status details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The virtual network gateway's local address + :vartype local_address: str + :ivar neighbor: The remote BGP peer + :vartype neighbor: str + :ivar asn: The autonomous system number of the remote BGP peer + :vartype asn: int + :ivar state: The BGP peer state. Possible values include: 'Unknown', + 'Stopped', 'Idle', 'Connecting', 'Connected' + :vartype state: str or ~azure.mgmt.network.v2017_11_01.models.BgpPeerState + :ivar connected_duration: For how long the peering has been up + :vartype connected_duration: str + :ivar routes_received: The number of routes learned from this peer + :vartype routes_received: long + :ivar messages_sent: The number of BGP messages sent + :vartype messages_sent: long + :ivar messages_received: The number of BGP messages received + :vartype messages_received: long + """ + + _validation = { + 'local_address': {'readonly': True}, + 'neighbor': {'readonly': True}, + 'asn': {'readonly': True}, + 'state': {'readonly': True}, + 'connected_duration': {'readonly': True}, + 'routes_received': {'readonly': True}, + 'messages_sent': {'readonly': True}, + 'messages_received': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'str'}, + 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, + 'routes_received': {'key': 'routesReceived', 'type': 'long'}, + 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, + 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(BgpPeerStatus, self).__init__(**kwargs) + self.local_address = None + self.neighbor = None + self.asn = None + self.state = None + self.connected_duration = None + self.routes_received = None + self.messages_sent = None + self.messages_received = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_service_community.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_service_community.py index 5a5e54f6cfb5..fff5c9cb346a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_service_community.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_service_community.py @@ -50,7 +50,7 @@ class BgpServiceCommunity(Resource): 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, } - def __init__(self, id=None, location=None, tags=None, service_name=None, bgp_communities=None): - super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags) - self.service_name = service_name - self.bgp_communities = bgp_communities + def __init__(self, **kwargs): + super(BgpServiceCommunity, self).__init__(**kwargs) + self.service_name = kwargs.get('service_name', None) + self.bgp_communities = kwargs.get('bgp_communities', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_service_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_service_community_py3.py new file mode 100644 index 000000000000..918ea5ecb924 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_service_community_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BgpServiceCommunity(Resource): + """Service Community Properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param service_name: The name of the bgp community. e.g. Skype. + :type service_name: str + :param bgp_communities: Get a list of bgp communities. + :type bgp_communities: + list[~azure.mgmt.network.v2017_11_01.models.BGPCommunity] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, + 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, service_name: str=None, bgp_communities=None, **kwargs) -> None: + super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.service_name = service_name + self.bgp_communities = bgp_communities diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_settings.py index c5730da2e43e..e6e8d1b90aa6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_settings.py @@ -31,8 +31,8 @@ class BgpSettings(Model): 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, } - def __init__(self, asn=None, bgp_peering_address=None, peer_weight=None): - super(BgpSettings, self).__init__() - self.asn = asn - self.bgp_peering_address = bgp_peering_address - self.peer_weight = peer_weight + def __init__(self, **kwargs): + super(BgpSettings, self).__init__(**kwargs) + self.asn = kwargs.get('asn', None) + self.bgp_peering_address = kwargs.get('bgp_peering_address', None) + self.peer_weight = kwargs.get('peer_weight', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_settings_py3.py new file mode 100644 index 000000000000..cb3b3e6795f7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/bgp_settings_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpSettings(Model): + """BGP settings details. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of + this BGP speaker. + :type bgp_peering_address: str + :param peer_weight: The weight added to routes learned from this BGP + speaker. + :type peer_weight: int + """ + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, + } + + def __init__(self, *, asn: int=None, bgp_peering_address: str=None, peer_weight: int=None, **kwargs) -> None: + super(BgpSettings, self).__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + self.peer_weight = peer_weight diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor.py index 88f0b25b0c94..4e0aad97fd83 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor.py @@ -15,14 +15,16 @@ class ConnectionMonitor(Model): """Parameters that define the operation to create a connection monitor. + All required parameters must be populated in order to send to Azure. + :param location: Connection monitor location. :type location: str :param tags: Connection monitor tags. :type tags: dict[str, str] - :param source: + :param source: Required. :type source: ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorSource - :param destination: + :param destination: Required. :type destination: ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorDestination :param auto_start: Determines if the connection monitor will start @@ -47,11 +49,11 @@ class ConnectionMonitor(Model): 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, } - def __init__(self, source, destination, location=None, tags=None, auto_start=True, monitoring_interval_in_seconds=60): - super(ConnectionMonitor, self).__init__() - self.location = location - self.tags = tags - self.source = source - self.destination = destination - self.auto_start = auto_start - self.monitoring_interval_in_seconds = monitoring_interval_in_seconds + def __init__(self, **kwargs): + super(ConnectionMonitor, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.auto_start = kwargs.get('auto_start', True) + self.monitoring_interval_in_seconds = kwargs.get('monitoring_interval_in_seconds', 60) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_destination.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_destination.py index acaab3299666..9d1e3885cb38 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_destination.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_destination.py @@ -31,8 +31,8 @@ class ConnectionMonitorDestination(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id=None, address=None, port=None): - super(ConnectionMonitorDestination, self).__init__() - self.resource_id = resource_id - self.address = address - self.port = port + def __init__(self, **kwargs): + super(ConnectionMonitorDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_destination_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_destination_py3.py new file mode 100644 index 000000000000..59e7465804ce --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_destination_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorDestination(Model): + """Describes the destination of connection monitor. + + :param resource_id: The ID of the resource used as the destination by + connection monitor. + :type resource_id: str + :param address: Address of the connection monitor destination (IP or + domain name). + :type address: str + :param port: The destination port used by connection monitor. + :type port: int + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str=None, address: str=None, port: int=None, **kwargs) -> None: + super(ConnectionMonitorDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_parameters.py index fb1ca082a1d0..878f08f4a577 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_parameters.py @@ -15,10 +15,12 @@ class ConnectionMonitorParameters(Model): """Parameters that define the operation to create a connection monitor. - :param source: + All required parameters must be populated in order to send to Azure. + + :param source: Required. :type source: ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorSource - :param destination: + :param destination: Required. :type destination: ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorDestination :param auto_start: Determines if the connection monitor will start @@ -41,9 +43,9 @@ class ConnectionMonitorParameters(Model): 'monitoring_interval_in_seconds': {'key': 'monitoringIntervalInSeconds', 'type': 'int'}, } - def __init__(self, source, destination, auto_start=True, monitoring_interval_in_seconds=60): - super(ConnectionMonitorParameters, self).__init__() - self.source = source - self.destination = destination - self.auto_start = auto_start - self.monitoring_interval_in_seconds = monitoring_interval_in_seconds + def __init__(self, **kwargs): + super(ConnectionMonitorParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.auto_start = kwargs.get('auto_start', True) + self.monitoring_interval_in_seconds = kwargs.get('monitoring_interval_in_seconds', 60) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_parameters_py3.py new file mode 100644 index 000000000000..893f914e2a58 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_parameters_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorParameters(Model): + """Parameters that define the operation to create a connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. + :type source: + ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorSource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start + automatically once created. Default value: True . + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + Default value: 60 . + :type monitoring_interval_in_seconds: int + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'monitoringIntervalInSeconds', 'type': 'int'}, + } + + def __init__(self, *, source, destination, auto_start: bool=True, monitoring_interval_in_seconds: int=60, **kwargs) -> None: + super(ConnectionMonitorParameters, self).__init__(**kwargs) + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_py3.py new file mode 100644 index 000000000000..020cda65926f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitor(Model): + """Parameters that define the operation to create a connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param location: Connection monitor location. + :type location: str + :param tags: Connection monitor tags. + :type tags: dict[str, str] + :param source: Required. + :type source: + ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorSource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start + automatically once created. Default value: True . + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + Default value: 60 . + :type monitoring_interval_in_seconds: int + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'properties.destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'properties.autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, + } + + def __init__(self, *, source, destination, location: str=None, tags=None, auto_start: bool=True, monitoring_interval_in_seconds: int=60, **kwargs) -> None: + super(ConnectionMonitor, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_query_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_query_result.py index 54032094376c..d21b05efc014 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_query_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_query_result.py @@ -24,6 +24,6 @@ class ConnectionMonitorQueryResult(Model): 'states': {'key': 'states', 'type': '[ConnectionStateSnapshot]'}, } - def __init__(self, states=None): - super(ConnectionMonitorQueryResult, self).__init__() - self.states = states + def __init__(self, **kwargs): + super(ConnectionMonitorQueryResult, self).__init__(**kwargs) + self.states = kwargs.get('states', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_query_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_query_result_py3.py new file mode 100644 index 000000000000..1c64ec5943b2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_query_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorQueryResult(Model): + """List of connection states snaphots. + + :param states: Information about connection states. + :type states: + list[~azure.mgmt.network.v2017_11_01.models.ConnectionStateSnapshot] + """ + + _attribute_map = { + 'states': {'key': 'states', 'type': '[ConnectionStateSnapshot]'}, + } + + def __init__(self, *, states=None, **kwargs) -> None: + super(ConnectionMonitorQueryResult, self).__init__(**kwargs) + self.states = states diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_result.py index 0d8b7ee50368..1a31245a4a0c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_result.py @@ -18,6 +18,8 @@ class ConnectionMonitorResult(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar name: Name of the connection monitor. :vartype name: str :ivar id: ID of the connection monitor. @@ -31,10 +33,10 @@ class ConnectionMonitorResult(Model): :type location: str :param tags: Connection monitor tags. :type tags: dict[str, str] - :param source: + :param source: Required. :type source: ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorSource - :param destination: + :param destination: Required. :type destination: ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorDestination :param auto_start: Determines if the connection monitor will start @@ -79,18 +81,18 @@ class ConnectionMonitorResult(Model): 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, } - def __init__(self, source, destination, etag="A unique read-only string that changes whenever the resource is updated.", location=None, tags=None, auto_start=True, monitoring_interval_in_seconds=60, provisioning_state=None, start_time=None, monitoring_status=None): - super(ConnectionMonitorResult, self).__init__() + def __init__(self, **kwargs): + super(ConnectionMonitorResult, self).__init__(**kwargs) self.name = None self.id = None - self.etag = etag + self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") self.type = None - self.location = location - self.tags = tags - self.source = source - self.destination = destination - self.auto_start = auto_start - self.monitoring_interval_in_seconds = monitoring_interval_in_seconds - self.provisioning_state = provisioning_state - self.start_time = start_time - self.monitoring_status = monitoring_status + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.auto_start = kwargs.get('auto_start', True) + self.monitoring_interval_in_seconds = kwargs.get('monitoring_interval_in_seconds', 60) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.start_time = kwargs.get('start_time', None) + self.monitoring_status = kwargs.get('monitoring_status', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_result_py3.py new file mode 100644 index 000000000000..3ea4c2a0095f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_result_py3.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorResult(Model): + """Information about the connection monitor. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the connection monitor. + :vartype name: str + :ivar id: ID of the connection monitor. + :vartype id: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :ivar type: Connection monitor type. + :vartype type: str + :param location: Connection monitor location. + :type location: str + :param tags: Connection monitor tags. + :type tags: dict[str, str] + :param source: Required. + :type source: + ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorSource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start + automatically once created. Default value: True . + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + Default value: 60 . + :type monitoring_interval_in_seconds: int + :param provisioning_state: The provisioning state of the connection + monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2017_11_01.models.ProvisioningState + :param start_time: The date and time when the connection monitor was + started. + :type start_time: datetime + :param monitoring_status: The monitoring status of the connection monitor. + :type monitoring_status: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'properties.destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'properties.autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + } + + def __init__(self, *, source, destination, etag: str="A unique read-only string that changes whenever the resource is updated.", location: str=None, tags=None, auto_start: bool=True, monitoring_interval_in_seconds: int=60, provisioning_state=None, start_time=None, monitoring_status: str=None, **kwargs) -> None: + super(ConnectionMonitorResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = etag + self.type = None + self.location = location + self.tags = tags + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds + self.provisioning_state = provisioning_state + self.start_time = start_time + self.monitoring_status = monitoring_status diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_source.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_source.py index c80aa3a2676d..1425fa613ce5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_source.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_source.py @@ -15,7 +15,9 @@ class ConnectionMonitorSource(Model): """Describes the source of connection monitor. - :param resource_id: The ID of the resource used as the source by + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource used as the source by connection monitor. :type resource_id: str :param port: The source port used by connection monitor. @@ -31,7 +33,7 @@ class ConnectionMonitorSource(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id, port=None): - super(ConnectionMonitorSource, self).__init__() - self.resource_id = resource_id - self.port = port + def __init__(self, **kwargs): + super(ConnectionMonitorSource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_source_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_source_py3.py new file mode 100644 index 000000000000..4d44fcaf8bf0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_monitor_source_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorSource(Model): + """Describes the source of connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource used as the source by + connection monitor. + :type resource_id: str + :param port: The source port used by connection monitor. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str, port: int=None, **kwargs) -> None: + super(ConnectionMonitorSource, self).__init__(**kwargs) + self.resource_id = resource_id + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_reset_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_reset_shared_key.py index 3338112a7fe7..1ade077795ed 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_reset_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_reset_shared_key.py @@ -15,8 +15,10 @@ class ConnectionResetSharedKey(Model): """The virtual network connection reset shared key. - :param key_length: The virtual network connection reset shared key length, - should between 1 and 128. + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. :type key_length: int """ @@ -28,6 +30,6 @@ class ConnectionResetSharedKey(Model): 'key_length': {'key': 'keyLength', 'type': 'int'}, } - def __init__(self, key_length): - super(ConnectionResetSharedKey, self).__init__() - self.key_length = key_length + def __init__(self, **kwargs): + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = kwargs.get('key_length', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_reset_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_reset_shared_key_py3.py new file mode 100644 index 000000000000..47326d4c2082 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_reset_shared_key_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionResetSharedKey(Model): + """The virtual network connection reset shared key. + + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. + :type key_length: int + """ + + _validation = { + 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, + } + + _attribute_map = { + 'key_length': {'key': 'keyLength', 'type': 'int'}, + } + + def __init__(self, *, key_length: int, **kwargs) -> None: + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = key_length diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_shared_key.py index 2c1b0ed9a914..742f1cb15126 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_shared_key.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_shared_key.py @@ -15,7 +15,9 @@ class ConnectionSharedKey(Model): """Response for GetConnectionSharedKey API service call. - :param value: The virtual network connection shared key value. + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. :type value: str """ @@ -27,6 +29,6 @@ class ConnectionSharedKey(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self, value): - super(ConnectionSharedKey, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_shared_key_py3.py new file mode 100644 index 000000000000..11b88da35e17 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_shared_key_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionSharedKey(Model): + """Response for GetConnectionSharedKey API service call. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, **kwargs) -> None: + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_state_snapshot.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_state_snapshot.py index 1598f04949e9..bf0717fb8e3d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_state_snapshot.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_state_snapshot.py @@ -47,10 +47,10 @@ class ConnectionStateSnapshot(Model): 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, } - def __init__(self, connection_state=None, start_time=None, end_time=None, evaluation_state=None): - super(ConnectionStateSnapshot, self).__init__() - self.connection_state = connection_state - self.start_time = start_time - self.end_time = end_time - self.evaluation_state = evaluation_state + def __init__(self, **kwargs): + super(ConnectionStateSnapshot, self).__init__(**kwargs) + self.connection_state = kwargs.get('connection_state', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.evaluation_state = kwargs.get('evaluation_state', None) self.hops = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_state_snapshot_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_state_snapshot_py3.py new file mode 100644 index 000000000000..91af9464325d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connection_state_snapshot_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionStateSnapshot(Model): + """Connection state snapshot. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param connection_state: The connection state. Possible values include: + 'Reachable', 'Unreachable', 'Unknown' + :type connection_state: str or + ~azure.mgmt.network.v2017_11_01.models.ConnectionState + :param start_time: The start time of the connection snapshot. + :type start_time: datetime + :param end_time: The end time of the connection snapshot. + :type end_time: datetime + :param evaluation_state: Connectivity analysis evaluation state. Possible + values include: 'NotStarted', 'InProgress', 'Completed' + :type evaluation_state: str or + ~azure.mgmt.network.v2017_11_01.models.EvaluationState + :ivar hops: List of hops between the source and the destination. + :vartype hops: + list[~azure.mgmt.network.v2017_11_01.models.ConnectivityHop] + """ + + _validation = { + 'hops': {'readonly': True}, + } + + _attribute_map = { + 'connection_state': {'key': 'connectionState', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'evaluation_state': {'key': 'evaluationState', 'type': 'str'}, + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + } + + def __init__(self, *, connection_state=None, start_time=None, end_time=None, evaluation_state=None, **kwargs) -> None: + super(ConnectionStateSnapshot, self).__init__(**kwargs) + self.connection_state = connection_state + self.start_time = start_time + self.end_time = end_time + self.evaluation_state = evaluation_state + self.hops = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_destination.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_destination.py index cd0e8818b591..964c425a29d3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_destination.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_destination.py @@ -31,8 +31,8 @@ class ConnectivityDestination(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id=None, address=None, port=None): - super(ConnectivityDestination, self).__init__() - self.resource_id = resource_id - self.address = address - self.port = port + def __init__(self, **kwargs): + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_destination_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_destination_py3.py new file mode 100644 index 000000000000..c51619081ed6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_destination_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityDestination(Model): + """Parameters that define destination of connection. + + :param resource_id: The ID of the resource to which a connection attempt + will be made. + :type resource_id: str + :param address: The IP address or URI the resource to which a connection + attempt will be made. + :type address: str + :param port: Port on which check connectivity will be performed. + :type port: int + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str=None, address: str=None, port: int=None, **kwargs) -> None: + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_hop.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_hop.py index 239a2ca8a663..990e973488c5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_hop.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_hop.py @@ -51,8 +51,8 @@ class ConnectivityHop(Model): 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, } - def __init__(self): - super(ConnectivityHop, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityHop, self).__init__(**kwargs) self.type = None self.id = None self.address = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_hop_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_hop_py3.py new file mode 100644 index 000000000000..c403689c426c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_hop_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityHop(Model): + """Information about a hop between the source and the destination. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the hop. + :vartype type: str + :ivar id: The ID of the hop. + :vartype id: str + :ivar address: The IP address of the hop. + :vartype address: str + :ivar resource_id: The ID of the resource corresponding to this hop. + :vartype resource_id: str + :ivar next_hop_ids: List of next hop identifiers. + :vartype next_hop_ids: list[str] + :ivar issues: List of issues. + :vartype issues: + list[~azure.mgmt.network.v2017_11_01.models.ConnectivityIssue] + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'address': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'next_hop_ids': {'readonly': True}, + 'issues': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'next_hop_ids': {'key': 'nextHopIds', 'type': '[str]'}, + 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityHop, self).__init__(**kwargs) + self.type = None + self.id = None + self.address = None + self.resource_id = None + self.next_hop_ids = None + self.issues = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_information.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_information.py index b7625d366a1f..73f64abad6ff 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_information.py @@ -57,8 +57,8 @@ class ConnectivityInformation(Model): 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, } - def __init__(self): - super(ConnectivityInformation, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityInformation, self).__init__(**kwargs) self.hops = None self.connection_status = None self.avg_latency_in_ms = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_information_py3.py new file mode 100644 index 000000000000..b678b71f005e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_information_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityInformation(Model): + """Information on the connectivity status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar hops: List of hops between the source and the destination. + :vartype hops: + list[~azure.mgmt.network.v2017_11_01.models.ConnectivityHop] + :ivar connection_status: The connection status. Possible values include: + 'Unknown', 'Connected', 'Disconnected', 'Degraded' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_11_01.models.ConnectionStatus + :ivar avg_latency_in_ms: Average latency in milliseconds. + :vartype avg_latency_in_ms: int + :ivar min_latency_in_ms: Minimum latency in milliseconds. + :vartype min_latency_in_ms: int + :ivar max_latency_in_ms: Maximum latency in milliseconds. + :vartype max_latency_in_ms: int + :ivar probes_sent: Total number of probes sent. + :vartype probes_sent: int + :ivar probes_failed: Number of failed probes. + :vartype probes_failed: int + """ + + _validation = { + 'hops': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'avg_latency_in_ms': {'readonly': True}, + 'min_latency_in_ms': {'readonly': True}, + 'max_latency_in_ms': {'readonly': True}, + 'probes_sent': {'readonly': True}, + 'probes_failed': {'readonly': True}, + } + + _attribute_map = { + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, + 'probes_sent': {'key': 'probesSent', 'type': 'int'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityInformation, self).__init__(**kwargs) + self.hops = None + self.connection_status = None + self.avg_latency_in_ms = None + self.min_latency_in_ms = None + self.max_latency_in_ms = None + self.probes_sent = None + self.probes_failed = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_issue.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_issue.py index 61086290d971..53c16bc937c2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_issue.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_issue.py @@ -47,8 +47,8 @@ class ConnectivityIssue(Model): 'context': {'key': 'context', 'type': '[{str}]'}, } - def __init__(self): - super(ConnectivityIssue, self).__init__() + def __init__(self, **kwargs): + super(ConnectivityIssue, self).__init__(**kwargs) self.origin = None self.severity = None self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_issue_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_issue_py3.py new file mode 100644 index 000000000000..3e9c54c0ca55 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_issue_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityIssue(Model): + """Information about an issue encountered in the process of checking for + connectivity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar origin: The origin of the issue. Possible values include: 'Local', + 'Inbound', 'Outbound' + :vartype origin: str or ~azure.mgmt.network.v2017_11_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: + 'Error', 'Warning' + :vartype severity: str or ~azure.mgmt.network.v2017_11_01.models.Severity + :ivar type: The type of issue. Possible values include: 'Unknown', + 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', + 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform' + :vartype type: str or ~azure.mgmt.network.v2017_11_01.models.IssueType + :ivar context: Provides additional context on the issue. + :vartype context: list[dict[str, str]] + """ + + _validation = { + 'origin': {'readonly': True}, + 'severity': {'readonly': True}, + 'type': {'readonly': True}, + 'context': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'context': {'key': 'context', 'type': '[{str}]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityIssue, self).__init__(**kwargs) + self.origin = None + self.severity = None + self.type = None + self.context = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_parameters.py index 857cda080116..148b21c36b17 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_parameters.py @@ -15,9 +15,11 @@ class ConnectivityParameters(Model): """Parameters that determine how the connectivity check will be performed. - :param source: + All required parameters must be populated in order to send to Azure. + + :param source: Required. :type source: ~azure.mgmt.network.v2017_11_01.models.ConnectivitySource - :param destination: + :param destination: Required. :type destination: ~azure.mgmt.network.v2017_11_01.models.ConnectivityDestination """ @@ -32,7 +34,7 @@ class ConnectivityParameters(Model): 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, } - def __init__(self, source, destination): - super(ConnectivityParameters, self).__init__() - self.source = source - self.destination = destination + def __init__(self, **kwargs): + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_parameters_py3.py new file mode 100644 index 000000000000..9cbb06a0c2f6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_parameters_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityParameters(Model): + """Parameters that determine how the connectivity check will be performed. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. + :type source: ~azure.mgmt.network.v2017_11_01.models.ConnectivitySource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2017_11_01.models.ConnectivityDestination + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectivitySource'}, + 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, + } + + def __init__(self, *, source, destination, **kwargs) -> None: + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = source + self.destination = destination diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_source.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_source.py index c42bfc0aa09d..3fd82793f8d7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_source.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_source.py @@ -15,8 +15,10 @@ class ConnectivitySource(Model): """Parameters that define the source of the connection. - :param resource_id: The ID of the resource from which a connectivity check - will be initiated. + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. :type resource_id: str :param port: The source port from which a connectivity check will be performed. @@ -32,7 +34,7 @@ class ConnectivitySource(Model): 'port': {'key': 'port', 'type': 'int'}, } - def __init__(self, resource_id, port=None): - super(ConnectivitySource, self).__init__() - self.resource_id = resource_id - self.port = port + def __init__(self, **kwargs): + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_source_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_source_py3.py new file mode 100644 index 000000000000..f7833d1bef76 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_source_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivitySource(Model): + """Parameters that define the source of the connection. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. + :type resource_id: str + :param port: The source port from which a connectivity check will be + performed. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str, port: int=None, **kwargs) -> None: + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = resource_id + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dhcp_options.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dhcp_options.py index 8744ba6fc9b1..93b68a7f037c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dhcp_options.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dhcp_options.py @@ -25,6 +25,6 @@ class DhcpOptions(Model): 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, } - def __init__(self, dns_servers=None): - super(DhcpOptions, self).__init__() - self.dns_servers = dns_servers + def __init__(self, **kwargs): + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dhcp_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dhcp_options_py3.py new file mode 100644 index 000000000000..7dc4651973a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dhcp_options_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DhcpOptions(Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in + the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + options. + + :param dns_servers: The list of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = dns_servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dimension.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dimension.py index f18204215221..e9c8cd977a54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dimension.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dimension.py @@ -29,8 +29,8 @@ class Dimension(Model): 'internal_name': {'key': 'internalName', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, internal_name=None): - super(Dimension, self).__init__() - self.name = name - self.display_name = display_name - self.internal_name = internal_name + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.internal_name = kwargs.get('internal_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dimension_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dimension_py3.py new file mode 100644 index 000000000000..20743b6424c1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dimension_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dimension(Model): + """Dimension of the metric. + + :param name: The name of the dimension. + :type name: str + :param display_name: The display name of the dimension. + :type display_name: str + :param internal_name: The internal name of the dimension. + :type internal_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, internal_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dns_name_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dns_name_availability_result.py index 15a0238e49a7..86ba19eb407b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dns_name_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dns_name_availability_result.py @@ -23,6 +23,6 @@ class DnsNameAvailabilityResult(Model): 'available': {'key': 'available', 'type': 'bool'}, } - def __init__(self, available=None): - super(DnsNameAvailabilityResult, self).__init__() - self.available = available + def __init__(self, **kwargs): + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dns_name_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dns_name_availability_result_py3.py new file mode 100644 index 000000000000..de0117c27715 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/dns_name_availability_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DnsNameAvailabilityResult(Model): + """Response for the CheckDnsNameAvailability API service call. + + :param available: Domain availability (True/False). + :type available: bool + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + } + + def __init__(self, *, available: bool=None, **kwargs) -> None: + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = available diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group.py index bf3019c34d2a..8f6c5f925080 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group.py @@ -37,9 +37,9 @@ class EffectiveNetworkSecurityGroup(Model): 'tag_map': {'key': 'tagMap', 'type': '{[str]}'}, } - def __init__(self, network_security_group=None, association=None, effective_security_rules=None, tag_map=None): - super(EffectiveNetworkSecurityGroup, self).__init__() - self.network_security_group = network_security_group - self.association = association - self.effective_security_rules = effective_security_rules - self.tag_map = tag_map + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = kwargs.get('network_security_group', None) + self.association = kwargs.get('association', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) + self.tag_map = kwargs.get('tag_map', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_association.py index 91279a34f6d5..9d3081b47f2e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_association.py @@ -27,7 +27,7 @@ class EffectiveNetworkSecurityGroupAssociation(Model): 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, } - def __init__(self, subnet=None, network_interface=None): - super(EffectiveNetworkSecurityGroupAssociation, self).__init__() - self.subnet = subnet - self.network_interface = network_interface + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.network_interface = kwargs.get('network_interface', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_association_py3.py new file mode 100644 index 000000000000..d1d34cf65dff --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_association_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupAssociation(Model): + """The effective network security group association. + + :param subnet: The ID of the subnet if assigned. + :type subnet: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: + ~azure.mgmt.network.v2017_11_01.models.SubResource + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, + } + + def __init__(self, *, subnet=None, network_interface=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = subnet + self.network_interface = network_interface diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_list_result.py index a064d3d6e229..6c253c626a28 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_list_result.py @@ -34,7 +34,7 @@ class EffectiveNetworkSecurityGroupListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None): - super(EffectiveNetworkSecurityGroupListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_list_result_py3.py new file mode 100644 index 000000000000..eab21021a220 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_list_result_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupListResult(Model): + """Response for list effective network security groups API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective network security groups. + :type value: + list[~azure.mgmt.network.v2017_11_01.models.EffectiveNetworkSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_py3.py new file mode 100644 index 000000000000..e1f923f952b0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_group_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroup(Model): + """Effective network security group. + + :param network_security_group: The ID of network security group that is + applied. + :type network_security_group: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param association: Associated resources. + :type association: + ~azure.mgmt.network.v2017_11_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2017_11_01.models.EffectiveNetworkSecurityRule] + :param tag_map: Mapping of tags to list of IP Addresses included within + the tag. + :type tag_map: dict[str, list[str]] + """ + + _attribute_map = { + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, + 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + 'tag_map': {'key': 'tagMap', 'type': '{[str]}'}, + } + + def __init__(self, *, network_security_group=None, association=None, effective_security_rules=None, tag_map=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = network_security_group + self.association = association + self.effective_security_rules = effective_security_rules + self.tag_map = tag_map diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_rule.py index 992631a87a92..74ee526f2acc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_rule.py @@ -82,20 +82,20 @@ class EffectiveNetworkSecurityRule(Model): 'direction': {'key': 'direction', 'type': 'str'}, } - def __init__(self, name=None, protocol=None, source_port_range=None, destination_port_range=None, source_port_ranges=None, destination_port_ranges=None, source_address_prefix=None, destination_address_prefix=None, source_address_prefixes=None, destination_address_prefixes=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority=None, direction=None): - super(EffectiveNetworkSecurityRule, self).__init__() - self.name = name - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_port_ranges = source_port_ranges - self.destination_port_ranges = destination_port_ranges - self.source_address_prefix = source_address_prefix - self.destination_address_prefix = destination_address_prefix - self.source_address_prefixes = source_address_prefixes - self.destination_address_prefixes = destination_address_prefixes - self.expanded_source_address_prefix = expanded_source_address_prefix - self.expanded_destination_address_prefix = expanded_destination_address_prefix - self.access = access - self.priority = priority - self.direction = direction + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.expanded_source_address_prefix = kwargs.get('expanded_source_address_prefix', None) + self.expanded_destination_address_prefix = kwargs.get('expanded_destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_rule_py3.py new file mode 100644 index 000000000000..359313db0cf4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_network_security_rule_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityRule(Model): + """Effective network security rules. + + :param name: The name of the security rule specified by the user (if + created by the user). + :type name: str + :param protocol: The network protocol this rule applies to. Possible + values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', + 'Udp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_11_01.models.EffectiveSecurityRuleProtocol + :param source_port_range: The source port or range. + :type source_port_range: str + :param destination_port_range: The destination port or range. + :type destination_port_range: str + :param source_port_ranges: The source port ranges. Expected values include + a single integer between 0 and 65535, a range using '-' as seperator (e.g. + 100-400), or an asterix (*) + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. Expected + values include a single integer between 0 and 65535, a range using '-' as + seperator (e.g. 100-400), or an asterix (*) + :type destination_port_ranges: list[str] + :param source_address_prefix: The source address prefix. + :type source_address_prefix: str + :param destination_address_prefix: The destination address prefix. + :type destination_address_prefix: str + :param source_address_prefixes: The source address prefixes. Expected + values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type source_address_prefixes: list[str] + :param destination_address_prefixes: The destination address prefixes. + Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type destination_address_prefixes: list[str] + :param expanded_source_address_prefix: The expanded source address prefix. + :type expanded_source_address_prefix: list[str] + :param expanded_destination_address_prefix: Expanded destination address + prefix. + :type expanded_destination_address_prefix: list[str] + :param access: Whether network traffic is allowed or denied. Possible + values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or + ~azure.mgmt.network.v2017_11_01.models.SecurityRuleAccess + :param priority: The priority of the rule. + :type priority: int + :param direction: The direction of the rule. Possible values are: 'Inbound + and Outbound'. Possible values include: 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2017_11_01.models.SecurityRuleDirection + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'source_port_ranges': {'key': 'sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'destinationPortRanges', 'type': '[str]'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'sourceAddressPrefixes', 'type': '[str]'}, + 'destination_address_prefixes': {'key': 'destinationAddressPrefixes', 'type': '[str]'}, + 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, + 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, + 'access': {'key': 'access', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, protocol=None, source_port_range: str=None, destination_port_range: str=None, source_port_ranges=None, destination_port_ranges=None, source_address_prefix: str=None, destination_address_prefix: str=None, source_address_prefixes=None, destination_address_prefixes=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority: int=None, direction=None, **kwargs) -> None: + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = name + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.source_address_prefixes = source_address_prefixes + self.destination_address_prefixes = destination_address_prefixes + self.expanded_source_address_prefix = expanded_source_address_prefix + self.expanded_destination_address_prefix = expanded_destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route.py index 8fbe931b32dc..e3e9718a6916 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route.py @@ -50,11 +50,11 @@ class EffectiveRoute(Model): 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, } - def __init__(self, name=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None): - super(EffectiveRoute, self).__init__() - self.name = name - self.source = source - self.state = state - self.address_prefix = address_prefix - self.next_hop_ip_address = next_hop_ip_address - self.next_hop_type = next_hop_type + def __init__(self, **kwargs): + super(EffectiveRoute, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.next_hop_type = kwargs.get('next_hop_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route_list_result.py index 09a4fe309605..28a528f84cae 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route_list_result.py @@ -33,7 +33,7 @@ class EffectiveRouteListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None): - super(EffectiveRouteListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route_list_result_py3.py new file mode 100644 index 000000000000..cb6c23a7d25d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route_list_result_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRouteListResult(Model): + """Response for list effective route API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective routes. + :type value: list[~azure.mgmt.network.v2017_11_01.models.EffectiveRoute] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route_py3.py new file mode 100644 index 000000000000..0e70ae26d6d6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/effective_route_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRoute(Model): + """Effective Route. + + :param name: The name of the user defined route. This is optional. + :type name: str + :param source: Who created the route. Possible values are: 'Unknown', + 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: + 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' + :type source: str or + ~azure.mgmt.network.v2017_11_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values are: 'Active' + and 'Invalid'. Possible values include: 'Active', 'Invalid' + :type state: str or + ~azure.mgmt.network.v2017_11_01.models.EffectiveRouteState + :param address_prefix: The address prefixes of the effective routes in + CIDR notation. + :type address_prefix: list[str] + :param next_hop_ip_address: The IP address of the next hop of the + effective route. + :type next_hop_ip_address: list[str] + :param next_hop_type: The type of Azure hop the packet should be sent to. + Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_11_01.models.RouteNextHopType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None, **kwargs) -> None: + super(EffectiveRoute, self).__init__(**kwargs) + self.name = name + self.source = source + self.state = state + self.address_prefix = address_prefix + self.next_hop_ip_address = next_hop_ip_address + self.next_hop_type = next_hop_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/endpoint_service_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/endpoint_service_result.py index 9098a41ff164..9ca0e203a834 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/endpoint_service_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/endpoint_service_result.py @@ -37,7 +37,7 @@ class EndpointServiceResult(SubResource): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, id=None): - super(EndpointServiceResult, self).__init__(id=id) + def __init__(self, **kwargs): + super(EndpointServiceResult, self).__init__(**kwargs) self.name = None self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/endpoint_service_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/endpoint_service_result_py3.py new file mode 100644 index 000000000000..c45df94a6533 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/endpoint_service_result_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class EndpointServiceResult(SubResource): + """Endpoint service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Name of the endpoint service. + :vartype name: str + :ivar type: Type of the endpoint service. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(EndpointServiceResult, self).__init__(id=id, **kwargs) + self.name = None + self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error.py index 6da3fd016bcf..118762a52efe 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error.py @@ -35,10 +35,10 @@ class Error(Model): 'inner_error': {'key': 'innerError', 'type': 'str'}, } - def __init__(self, code=None, message=None, target=None, details=None, inner_error=None): - super(Error, self).__init__() - self.code = code - self.message = message - self.target = target - self.details = details - self.inner_error = inner_error + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error_details.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error_details.py index 40bea00aa2fb..a8c4da6ba955 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error_details.py @@ -29,8 +29,8 @@ class ErrorDetails(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code=None, target=None, message=None): - super(ErrorDetails, self).__init__() - self.code = code - self.target = target - self.message = message + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error_details_py3.py new file mode 100644 index 000000000000..d791f0895345 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error_details_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """ErrorDetails. + + :param code: + :type code: str + :param target: + :type target: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error_py3.py new file mode 100644 index 000000000000..89d6608d7bac --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(Model): + """Error. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.network.v2017_11_01.models.ErrorDetails] + :param inner_error: + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, inner_error: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit.py index fb73e47e2867..e06b244936a1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit.py @@ -91,17 +91,17 @@ class ExpressRouteCircuit(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, allow_classic_operations=None, circuit_provisioning_state=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key=None, service_provider_notes=None, service_provider_properties=None, provisioning_state=None, gateway_manager_etag=None): - super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.allow_classic_operations = allow_classic_operations - self.circuit_provisioning_state = circuit_provisioning_state - self.service_provider_provisioning_state = service_provider_provisioning_state - self.authorizations = authorizations - self.peerings = peerings - self.service_key = service_key - self.service_provider_notes = service_provider_notes - self.service_provider_properties = service_provider_properties - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag + def __init__(self, **kwargs): + super(ExpressRouteCircuit, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.allow_classic_operations = kwargs.get('allow_classic_operations', None) + self.circuit_provisioning_state = kwargs.get('circuit_provisioning_state', None) + self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) + self.authorizations = kwargs.get('authorizations', None) + self.peerings = kwargs.get('peerings', None) + self.service_key = kwargs.get('service_key', None) + self.service_provider_notes = kwargs.get('service_provider_notes', None) + self.service_provider_properties = kwargs.get('service_provider_properties', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_arp_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_arp_table.py index ace325747ee5..826796619769 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_arp_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_arp_table.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitArpTable(Model): 'mac_address': {'key': 'macAddress', 'type': 'str'}, } - def __init__(self, age=None, interface=None, ip_address=None, mac_address=None): - super(ExpressRouteCircuitArpTable, self).__init__() - self.age = age - self.interface = interface - self.ip_address = ip_address - self.mac_address = mac_address + def __init__(self, **kwargs): + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = kwargs.get('age', None) + self.interface = kwargs.get('interface', None) + self.ip_address = kwargs.get('ip_address', None) + self.mac_address = kwargs.get('mac_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_arp_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_arp_table_py3.py new file mode 100644 index 000000000000..4401108c6001 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_arp_table_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitArpTable(Model): + """The ARP table associated with the ExpressRouteCircuit. + + :param age: Age + :type age: int + :param interface: Interface + :type interface: str + :param ip_address: The IP address. + :type ip_address: str + :param mac_address: The MAC address. + :type mac_address: str + """ + + _attribute_map = { + 'age': {'key': 'age', 'type': 'int'}, + 'interface': {'key': 'interface', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, *, age: int=None, interface: str=None, ip_address: str=None, mac_address: str=None, **kwargs) -> None: + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = age + self.interface = interface + self.ip_address = ip_address + self.mac_address = mac_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_authorization.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_authorization.py index bd02b0bee1a0..03a344b14bd4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_authorization.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_authorization.py @@ -51,10 +51,10 @@ class ExpressRouteCircuitAuthorization(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, authorization_key=None, authorization_use_status=None, provisioning_state=None, name=None): - super(ExpressRouteCircuitAuthorization, self).__init__(id=id) - self.authorization_key = authorization_key - self.authorization_use_status = authorization_use_status - self.provisioning_state = provisioning_state - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitAuthorization, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.authorization_use_status = kwargs.get('authorization_use_status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_authorization_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_authorization_py3.py new file mode 100644 index 000000000000..3381e3bd57d9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_authorization_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param authorization_use_status: AuthorizationUseStatus. Possible values + are: 'Available' and 'InUse'. Possible values include: 'Available', + 'InUse' + :type authorization_use_status: str or + ~azure.mgmt.network.v2017_11_01.models.AuthorizationUseStatus + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, authorization_key: str=None, authorization_use_status=None, provisioning_state: str=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitAuthorization, self).__init__(id=id, **kwargs) + self.authorization_key = authorization_key + self.authorization_use_status = authorization_use_status + self.provisioning_state = provisioning_state + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering.py index 98a2a206cbe8..b9b2ccdaaf79 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering.py @@ -101,24 +101,24 @@ class ExpressRouteCircuitPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, peering_type=None, state=None, azure_asn=None, peer_asn=None, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, primary_azure_port=None, secondary_azure_port=None, shared_key=None, vlan_id=None, microsoft_peering_config=None, stats=None, provisioning_state=None, gateway_manager_etag=None, last_modified_by=None, route_filter=None, ipv6_peering_config=None, name=None): - super(ExpressRouteCircuitPeering, self).__init__(id=id) - self.peering_type = peering_type - self.state = state - self.azure_asn = azure_asn - self.peer_asn = peer_asn - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.primary_azure_port = primary_azure_port - self.secondary_azure_port = secondary_azure_port - self.shared_key = shared_key - self.vlan_id = vlan_id - self.microsoft_peering_config = microsoft_peering_config - self.stats = stats - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag - self.last_modified_by = last_modified_by - self.route_filter = route_filter - self.ipv6_peering_config = ipv6_peering_config - self.name = name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeering, self).__init__(**kwargs) + self.peering_type = kwargs.get('peering_type', None) + self.state = kwargs.get('state', None) + self.azure_asn = kwargs.get('azure_asn', None) + self.peer_asn = kwargs.get('peer_asn', None) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.primary_azure_port = kwargs.get('primary_azure_port', None) + self.secondary_azure_port = kwargs.get('secondary_azure_port', None) + self.shared_key = kwargs.get('shared_key', None) + self.vlan_id = kwargs.get('vlan_id', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.stats = kwargs.get('stats', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.route_filter = kwargs.get('route_filter', None) + self.ipv6_peering_config = kwargs.get('ipv6_peering_config', None) + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering_config.py index d004e2e8af37..e37485acf7db 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering_config.py @@ -45,11 +45,11 @@ class ExpressRouteCircuitPeeringConfig(Model): 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, } - def __init__(self, advertised_public_prefixes=None, advertised_communities=None, advertised_public_prefixes_state=None, legacy_mode=None, customer_asn=None, routing_registry_name=None): - super(ExpressRouteCircuitPeeringConfig, self).__init__() - self.advertised_public_prefixes = advertised_public_prefixes - self.advertised_communities = advertised_communities - self.advertised_public_prefixes_state = advertised_public_prefixes_state - self.legacy_mode = legacy_mode - self.customer_asn = customer_asn - self.routing_registry_name = routing_registry_name + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = kwargs.get('advertised_public_prefixes', None) + self.advertised_communities = kwargs.get('advertised_communities', None) + self.advertised_public_prefixes_state = kwargs.get('advertised_public_prefixes_state', None) + self.legacy_mode = kwargs.get('legacy_mode', None) + self.customer_asn = kwargs.get('customer_asn', None) + self.routing_registry_name = kwargs.get('routing_registry_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..3813a5866a94 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering_config_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitPeeringConfig(Model): + """Specifies the peering configuration. + + :param advertised_public_prefixes: The reference of + AdvertisedPublicPrefixes. + :type advertised_public_prefixes: list[str] + :param advertised_communities: The communities of bgp peering. Spepcified + for microsoft peering + :type advertised_communities: list[str] + :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of + the Peering resource. Possible values are 'NotConfigured', 'Configuring', + 'Configured', and 'ValidationNeeded'. Possible values include: + 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' + :type advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :param legacy_mode: The legacy mode of the peering. + :type legacy_mode: int + :param customer_asn: The CustomerASN of the peering. + :type customer_asn: int + :param routing_registry_name: The RoutingRegistryName of the + configuration. + :type routing_registry_name: str + """ + + _attribute_map = { + 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, + 'advertised_communities': {'key': 'advertisedCommunities', 'type': '[str]'}, + 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, + 'legacy_mode': {'key': 'legacyMode', 'type': 'int'}, + 'customer_asn': {'key': 'customerASN', 'type': 'int'}, + 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, + } + + def __init__(self, *, advertised_public_prefixes=None, advertised_communities=None, advertised_public_prefixes_state=None, legacy_mode: int=None, customer_asn: int=None, routing_registry_name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = advertised_public_prefixes + self.advertised_communities = advertised_communities + self.advertised_public_prefixes_state = advertised_public_prefixes_state + self.legacy_mode = legacy_mode + self.customer_asn = customer_asn + self.routing_registry_name = routing_registry_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering_py3.py new file mode 100644 index 000000000000..8ca2ebce35ed --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_peering_py3.py @@ -0,0 +1,124 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitPeering(SubResource): + """Peering in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param peering_type: The PeeringType. Possible values are: + 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. + Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + 'MicrosoftPeering' + :type peering_type: str or + ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeeringType + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeeringState + :param azure_asn: The Azure ASN. + :type azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: long + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param primary_azure_port: The primary port. + :type primary_azure_port: str + :param secondary_azure_port: The secondary port. + :type secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeeringConfig + :param stats: Gets peering stats. + :type stats: + ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitStats + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :param last_modified_by: Gets whether the provider or the customer last + modified the peering. + :type last_modified_by: str + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2017_11_01.models.RouteFilter + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2017_11_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'peer_asn': {'maximum': 4294967295, 'minimum': 1}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'long'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'route_filter': {'key': 'properties.routeFilter', 'type': 'RouteFilter'}, + 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, peering_type=None, state=None, azure_asn: int=None, peer_asn: int=None, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, primary_azure_port: str=None, secondary_azure_port: str=None, shared_key: str=None, vlan_id: int=None, microsoft_peering_config=None, stats=None, provisioning_state: str=None, gateway_manager_etag: str=None, last_modified_by: str=None, route_filter=None, ipv6_peering_config=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeering, self).__init__(id=id, **kwargs) + self.peering_type = peering_type + self.state = state + self.azure_asn = azure_asn + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = primary_azure_port + self.secondary_azure_port = secondary_azure_port + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.stats = stats + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.last_modified_by = last_modified_by + self.route_filter = route_filter + self.ipv6_peering_config = ipv6_peering_config + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_py3.py new file mode 100644 index 000000000000..171a84dc48a1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteCircuit(Resource): + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The SKU. + :type sku: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitSku + :param allow_classic_operations: Allow classic operations + :type allow_classic_operations: bool + :param circuit_provisioning_state: The CircuitProvisioningState state of + the resource. + :type circuit_provisioning_state: str + :param service_provider_provisioning_state: The + ServiceProviderProvisioningState state of the resource. Possible values + are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + 'Deprovisioning' + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2017_11_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: + list[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeering] + :param service_key: The ServiceKey. + :type service_key: str + :param service_provider_notes: The ServiceProviderNotes. + :type service_provider_notes: str + :param service_provider_properties: The ServiceProviderProperties. + :type service_provider_properties: + ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitServiceProviderProperties + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, + 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, + 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, allow_classic_operations: bool=None, circuit_provisioning_state: str=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key: str=None, service_provider_notes: str=None, service_provider_properties=None, provisioning_state: str=None, gateway_manager_etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.allow_classic_operations = allow_classic_operations + self.circuit_provisioning_state = circuit_provisioning_state + self.service_provider_provisioning_state = service_provider_provisioning_state + self.authorizations = authorizations + self.peerings = peerings + self.service_key = service_key + self.service_provider_notes = service_provider_notes + self.service_provider_properties = service_provider_properties + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table.py index 804d29a2f9bb..7517e9867cfb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table.py @@ -35,10 +35,10 @@ class ExpressRouteCircuitRoutesTable(Model): 'path': {'key': 'path', 'type': 'str'}, } - def __init__(self, network=None, next_hop=None, loc_prf=None, weight=None, path=None): - super(ExpressRouteCircuitRoutesTable, self).__init__() - self.network = network - self.next_hop = next_hop - self.loc_prf = loc_prf - self.weight = weight - self.path = path + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = kwargs.get('network', None) + self.next_hop = kwargs.get('next_hop', None) + self.loc_prf = kwargs.get('loc_prf', None) + self.weight = kwargs.get('weight', None) + self.path = kwargs.get('path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table_py3.py new file mode 100644 index 000000000000..38ea85cf642d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTable(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param network: network + :type network: str + :param next_hop: nextHop + :type next_hop: str + :param loc_prf: locPrf + :type loc_prf: str + :param weight: weight. + :type weight: int + :param path: path + :type path: str + """ + + _attribute_map = { + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'loc_prf': {'key': 'locPrf', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, *, network: str=None, next_hop: str=None, loc_prf: str=None, weight: int=None, path: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = network + self.next_hop = next_hop + self.loc_prf = loc_prf + self.weight = weight + self.path = path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table_summary.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table_summary.py index 6f5f89764dd4..577c3c2edd45 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table_summary.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table_summary.py @@ -37,10 +37,10 @@ class ExpressRouteCircuitRoutesTableSummary(Model): 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, } - def __init__(self, neighbor=None, v=None, as_property=None, up_down=None, state_pfx_rcd=None): - super(ExpressRouteCircuitRoutesTableSummary, self).__init__() - self.neighbor = neighbor - self.v = v - self.as_property = as_property - self.up_down = up_down - self.state_pfx_rcd = state_pfx_rcd + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = kwargs.get('neighbor', None) + self.v = kwargs.get('v', None) + self.as_property = kwargs.get('as_property', None) + self.up_down = kwargs.get('up_down', None) + self.state_pfx_rcd = kwargs.get('state_pfx_rcd', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table_summary_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table_summary_py3.py new file mode 100644 index 000000000000..e18d0051d218 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_routes_table_summary_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTableSummary(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: Neighbor + :type neighbor: str + :param v: BGP version number spoken to the neighbor. + :type v: int + :param as_property: Autonomous system number. + :type as_property: int + :param up_down: The length of time that the BGP session has been in the + Established state, or the current status if not in the Established state. + :type up_down: str + :param state_pfx_rcd: Current state of the BGP session, and the number of + prefixes that have been received from a neighbor or peer group. + :type state_pfx_rcd: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'v': {'key': 'v', 'type': 'int'}, + 'as_property': {'key': 'as', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, + } + + def __init__(self, *, neighbor: str=None, v: int=None, as_property: int=None, up_down: str=None, state_pfx_rcd: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = neighbor + self.v = v + self.as_property = as_property + self.up_down = up_down + self.state_pfx_rcd = state_pfx_rcd diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_service_provider_properties.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_service_provider_properties.py index 7a6b4ba96061..c51e6d8d653b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_service_provider_properties.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_service_provider_properties.py @@ -29,8 +29,8 @@ class ExpressRouteCircuitServiceProviderProperties(Model): 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, } - def __init__(self, service_provider_name=None, peering_location=None, bandwidth_in_mbps=None): - super(ExpressRouteCircuitServiceProviderProperties, self).__init__() - self.service_provider_name = service_provider_name - self.peering_location = peering_location - self.bandwidth_in_mbps = bandwidth_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = kwargs.get('service_provider_name', None) + self.peering_location = kwargs.get('peering_location', None) + self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_service_provider_properties_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_service_provider_properties_py3.py new file mode 100644 index 000000000000..ea701a54c3fe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_service_provider_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitServiceProviderProperties(Model): + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :param service_provider_name: The serviceProviderName. + :type service_provider_name: str + :param peering_location: The peering location. + :type peering_location: str + :param bandwidth_in_mbps: The BandwidthInMbps. + :type bandwidth_in_mbps: int + """ + + _attribute_map = { + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + } + + def __init__(self, *, service_provider_name: str=None, peering_location: str=None, bandwidth_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = service_provider_name + self.peering_location = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_sku.py index 6b2320365346..34322b73e2b5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_sku.py @@ -33,8 +33,8 @@ class ExpressRouteCircuitSku(Model): 'family': {'key': 'family', 'type': 'str'}, } - def __init__(self, name=None, tier=None, family=None): - super(ExpressRouteCircuitSku, self).__init__() - self.name = name - self.tier = tier - self.family = family + def __init__(self, **kwargs): + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.family = kwargs.get('family', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_sku_py3.py new file mode 100644 index 000000000000..728defb0834f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_sku_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitSku(Model): + """Contains SKU in an ExpressRouteCircuit. + + :param name: The name of the SKU. + :type name: str + :param tier: The tier of the SKU. Possible values are 'Standard' and + 'Premium'. Possible values include: 'Standard', 'Premium' + :type tier: str or + ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values are: 'UnlimitedData' + and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' + :type family: str or + ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, tier=None, family=None, **kwargs) -> None: + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.family = family diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_stats.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_stats.py index e26f6f7d2f74..41c45ae2b19a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_stats.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_stats.py @@ -32,9 +32,9 @@ class ExpressRouteCircuitStats(Model): 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, } - def __init__(self, primarybytes_in=None, primarybytes_out=None, secondarybytes_in=None, secondarybytes_out=None): - super(ExpressRouteCircuitStats, self).__init__() - self.primarybytes_in = primarybytes_in - self.primarybytes_out = primarybytes_out - self.secondarybytes_in = secondarybytes_in - self.secondarybytes_out = secondarybytes_out + def __init__(self, **kwargs): + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = kwargs.get('primarybytes_in', None) + self.primarybytes_out = kwargs.get('primarybytes_out', None) + self.secondarybytes_in = kwargs.get('secondarybytes_in', None) + self.secondarybytes_out = kwargs.get('secondarybytes_out', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_stats_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_stats_py3.py new file mode 100644 index 000000000000..f78335343544 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_stats_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitStats(Model): + """Contains stats associated with the peering. + + :param primarybytes_in: Gets BytesIn of the peering. + :type primarybytes_in: long + :param primarybytes_out: Gets BytesOut of the peering. + :type primarybytes_out: long + :param secondarybytes_in: Gets BytesIn of the peering. + :type secondarybytes_in: long + :param secondarybytes_out: Gets BytesOut of the peering. + :type secondarybytes_out: long + """ + + _attribute_map = { + 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, + 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, + 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, + 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, + } + + def __init__(self, *, primarybytes_in: int=None, primarybytes_out: int=None, secondarybytes_in: int=None, secondarybytes_out: int=None, **kwargs) -> None: + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = primarybytes_in + self.primarybytes_out = primarybytes_out + self.secondarybytes_in = secondarybytes_in + self.secondarybytes_out = secondarybytes_out diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_arp_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_arp_table_list_result.py index 242a1c6f8400..338cb377c771 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_arp_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_arp_table_list_result.py @@ -27,7 +27,7 @@ class ExpressRouteCircuitsArpTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsArpTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_arp_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_arp_table_list_result_py3.py new file mode 100644 index 000000000000..b326fc921c4b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_arp_table_list_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsArpTableListResult(Model): + """Response for ListArpTable associated with the Express Route Circuits API. + + :param value: Gets list of the ARP table. + :type value: + list[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitArpTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_list_result.py index 38508d0baeb3..0f24151ffbb5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_list_result_py3.py new file mode 100644 index 000000000000..3953c09fc846 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: The list of routes table. + :type value: + list[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitRoutesTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_summary_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_summary_list_result.py index 19a4be7f8ac3..e21c1f4698f2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_summary_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_summary_list_result.py @@ -28,7 +28,7 @@ class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): 'next_link': {'key': 'nextLink', 'type': 'str'}, } - def __init__(self, value=None, next_link=None): - super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__() - self.value = value - self.next_link = next_link + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_summary_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_summary_list_result_py3.py new file mode 100644 index 000000000000..7156867c56b1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuits_routes_table_summary_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: A list of the routes table. + :type value: + list[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitRoutesTableSummary] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider.py index 5ce79018bbe5..03649b28364a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider.py @@ -53,8 +53,8 @@ class ExpressRouteServiceProvider(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state=None): - super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags) - self.peering_locations = peering_locations - self.bandwidths_offered = bandwidths_offered - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ExpressRouteServiceProvider, self).__init__(**kwargs) + self.peering_locations = kwargs.get('peering_locations', None) + self.bandwidths_offered = kwargs.get('bandwidths_offered', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider_bandwidths_offered.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider_bandwidths_offered.py index 9cbba2fcfe97..b27622af42d1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider_bandwidths_offered.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider_bandwidths_offered.py @@ -26,7 +26,7 @@ class ExpressRouteServiceProviderBandwidthsOffered(Model): 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, } - def __init__(self, offer_name=None, value_in_mbps=None): - super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__() - self.offer_name = offer_name - self.value_in_mbps = value_in_mbps + def __init__(self, **kwargs): + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = kwargs.get('offer_name', None) + self.value_in_mbps = kwargs.get('value_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider_bandwidths_offered_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider_bandwidths_offered_py3.py new file mode 100644 index 000000000000..88516a0dfcf8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider_bandwidths_offered_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteServiceProviderBandwidthsOffered(Model): + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :param offer_name: The OfferName. + :type offer_name: str + :param value_in_mbps: The ValueInMbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__(self, *, offer_name: str=None, value_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = offer_name + self.value_in_mbps = value_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider_py3.py new file mode 100644 index 000000000000..0cc07712b012 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_service_provider_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param peering_locations: Get a list of peering locations. + :type peering_locations: list[str] + :param bandwidths_offered: Gets bandwidths offered. + :type bandwidths_offered: + list[~azure.mgmt.network.v2017_11_01.models.ExpressRouteServiceProviderBandwidthsOffered] + :param provisioning_state: Gets the provisioning state of the resource. + :type provisioning_state: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, + 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state: str=None, **kwargs) -> None: + super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.peering_locations = peering_locations + self.bandwidths_offered = bandwidths_offered + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_information.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_information.py index 3f68a2f82541..adc8c469a520 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_information.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_information.py @@ -15,13 +15,15 @@ class FlowLogInformation(Model): """Information on the configuration of flow log. - :param target_resource_id: The ID of the resource to configure for flow - logging. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. :type target_resource_id: str - :param storage_id: ID of the storage account which is used to store the - flow log. + :param storage_id: Required. ID of the storage account which is used to + store the flow log. :type storage_id: str - :param enabled: Flag to enable/disable flow logging. + :param enabled: Required. Flag to enable/disable flow logging. :type enabled: bool :param retention_policy: :type retention_policy: @@ -41,9 +43,9 @@ class FlowLogInformation(Model): 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, } - def __init__(self, target_resource_id, storage_id, enabled, retention_policy=None): - super(FlowLogInformation, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.enabled = enabled - self.retention_policy = retention_policy + def __init__(self, **kwargs): + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.enabled = kwargs.get('enabled', None) + self.retention_policy = kwargs.get('retention_policy', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_information_py3.py new file mode 100644 index 000000000000..015e146fe649 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_information_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogInformation(Model): + """Information on the configuration of flow log. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. + :type target_resource_id: str + :param storage_id: Required. ID of the storage account which is used to + store the flow log. + :type storage_id: str + :param enabled: Required. Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: + :type retention_policy: + ~azure.mgmt.network.v2017_11_01.models.RetentionPolicyParameters + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, enabled: bool, retention_policy=None, **kwargs) -> None: + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.enabled = enabled + self.retention_policy = retention_policy diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_status_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_status_parameters.py index 4cd22222bb45..5a48e938f2d6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_status_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_status_parameters.py @@ -15,8 +15,10 @@ class FlowLogStatusParameters(Model): """Parameters that define a resource to query flow log status. - :param target_resource_id: The target resource where getting the flow - logging status. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class FlowLogStatusParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(FlowLogStatusParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_status_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_status_parameters_py3.py new file mode 100644 index 000000000000..0768d2495150 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/flow_log_status_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogStatusParameters(Model): + """Parameters that define a resource to query flow log status. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging status. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/frontend_ip_configuration.py index 60dc1f82a128..669593818add 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/frontend_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/frontend_ip_configuration.py @@ -85,17 +85,17 @@ class FrontendIPConfiguration(SubResource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None, zones=None): - super(FrontendIPConfiguration, self).__init__(id=id) + def __init__(self, **kwargs): + super(FrontendIPConfiguration, self).__init__(**kwargs) self.inbound_nat_rules = None self.inbound_nat_pools = None self.outbound_nat_rules = None self.load_balancing_rules = None - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag - self.zones = zones + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..4b5b1ffb24a8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/frontend_ip_configuration_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class FrontendIPConfiguration(SubResource): + """Frontend IP address of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar inbound_nat_rules: Read only. Inbound rules URIs that use this + frontend IP. + :vartype inbound_nat_rules: + list[~azure.mgmt.network.v2017_11_01.models.SubResource] + :ivar inbound_nat_pools: Read only. Inbound pools URIs that use this + frontend IP. + :vartype inbound_nat_pools: + list[~azure.mgmt.network.v2017_11_01.models.SubResource] + :ivar outbound_nat_rules: Read only. Outbound rules URIs that use this + frontend IP. + :vartype outbound_nat_rules: + list[~azure.mgmt.network.v2017_11_01.models.SubResource] + :ivar load_balancing_rules: Gets load balancing rules URIs that use this + frontend IP. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_11_01.models.SubResource] + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The Private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_11_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_11_01.models.Subnet + :param public_ip_address: The reference of the Public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_11_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'inbound_nat_rules': {'readonly': True}, + 'inbound_nat_pools': {'readonly': True}, + 'outbound_nat_rules': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[SubResource]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, zones=None, **kwargs) -> None: + super(FrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.inbound_nat_rules = None + self.inbound_nat_pools = None + self.outbound_nat_rules = None + self.load_balancing_rules = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.zones = zones diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route.py index 64a53f146c0b..0b96cb661e70 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route.py @@ -54,8 +54,8 @@ class GatewayRoute(Model): 'weight': {'key': 'weight', 'type': 'int'}, } - def __init__(self): - super(GatewayRoute, self).__init__() + def __init__(self, **kwargs): + super(GatewayRoute, self).__init__(**kwargs) self.local_address = None self.network = None self.next_hop = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route_list_result.py index f9b141df3209..a8dbe31257ce 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route_list_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route_list_result.py @@ -23,6 +23,6 @@ class GatewayRouteListResult(Model): 'value': {'key': 'value', 'type': '[GatewayRoute]'}, } - def __init__(self, value=None): - super(GatewayRouteListResult, self).__init__() - self.value = value + def __init__(self, **kwargs): + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route_list_result_py3.py new file mode 100644 index 000000000000..4c51d9e07dea --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRouteListResult(Model): + """List of virtual network gateway routes. + + :param value: List of gateway routes + :type value: list[~azure.mgmt.network.v2017_11_01.models.GatewayRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayRoute]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route_py3.py new file mode 100644 index 000000000000..1aa3ba60605f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/gateway_route_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRoute(Model): + """Gateway routing details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The gateway's local address + :vartype local_address: str + :ivar network: The route's network prefix + :vartype network: str + :ivar next_hop: The route's next hop + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from + :vartype source_peer: str + :ivar origin: The source this route was learned from + :vartype origin: str + :ivar as_path: The route's AS path sequence + :vartype as_path: str + :ivar weight: The route's weight + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(GatewayRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_pool.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_pool.py index 2248f1439706..bf52a67731ba 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_pool.py @@ -15,24 +15,28 @@ class InboundNatPool(SubResource): """Inbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. :type frontend_ip_configuration: ~azure.mgmt.network.v2017_11_01.models.SubResource - :param protocol: Possible values include: 'Udp', 'Tcp', 'All' + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' :type protocol: str or ~azure.mgmt.network.v2017_11_01.models.TransportProtocol - :param frontend_port_range_start: The first port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65534. + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. :type frontend_port_range_start: int - :param frontend_port_range_end: The last port number in the range of - external ports that will be used to provide Inbound Nat to NICs associated - with a load balancer. Acceptable values range between 1 and 65535. + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. :type frontend_port_range_end: int - :param backend_port: The port used for internal connections on the - endpoint. Acceptable values are between 1 and 65535. + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. :type backend_port: int :param idle_timeout_in_minutes: The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 @@ -76,15 +80,15 @@ class InboundNatPool(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port_range_start, frontend_port_range_end, backend_port, id=None, frontend_ip_configuration=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(InboundNatPool, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.protocol = protocol - self.frontend_port_range_start = frontend_port_range_start - self.frontend_port_range_end = frontend_port_range_end - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(InboundNatPool, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.protocol = kwargs.get('protocol', None) + self.frontend_port_range_start = kwargs.get('frontend_port_range_start', None) + self.frontend_port_range_end = kwargs.get('frontend_port_range_end', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_pool_py3.py new file mode 100644 index 000000000000..9219aef1f15d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_pool_py3.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatPool(SubResource): + """Inbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_11_01.models.TransportProtocol + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. + :type frontend_port_range_start: int + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. + :type frontend_port_range_end: int + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port_range_start': {'required': True}, + 'frontend_port_range_end': {'required': True}, + 'backend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, + 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port_range_start: int, frontend_port_range_end: int, backend_port: int, id: str=None, frontend_ip_configuration=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatPool, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.protocol = protocol + self.frontend_port_range_start = frontend_port_range_start + self.frontend_port_range_end = frontend_port_range_end + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_rule.py index c24df0b5317f..e14fb2858aa0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_rule.py @@ -77,15 +77,15 @@ class InboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, frontend_ip_configuration=None, protocol=None, frontend_port=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, provisioning_state=None, name=None, etag=None): - super(InboundNatRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration + def __init__(self, **kwargs): + super(InboundNatRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) self.backend_ip_configuration = None - self.protocol = protocol - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_rule_py3.py new file mode 100644 index 000000000000..1024de45abab --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/inbound_nat_rule_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatRule(SubResource): + """Inbound NAT rule of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :ivar backend_ip_configuration: A reference to a private IP address + defined on a network interface of a VM. Traffic sent to the frontend port + of each of the frontend IP configurations is forwarded to the backend IP. + :vartype backend_ip_configuration: + ~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceIPConfiguration + :param protocol: Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_11_01.models.TransportProtocol + :param frontend_port: The port for the external endpoint. Port numbers for + each rule must be unique within the Load Balancer. Acceptable values range + from 1 to 65534. + :type frontend_port: int + :param backend_port: The port used for the internal endpoint. Acceptable + values range from 1 to 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, protocol=None, frontend_port: int=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_ip_configuration = None + self.protocol = protocol + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_address_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_address_availability_result.py index f2cb36a550ec..6bcf52275711 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_address_availability_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_address_availability_result.py @@ -27,7 +27,7 @@ class IPAddressAvailabilityResult(Model): 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, } - def __init__(self, available=None, available_ip_addresses=None): - super(IPAddressAvailabilityResult, self).__init__() - self.available = available - self.available_ip_addresses = available_ip_addresses + def __init__(self, **kwargs): + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) + self.available_ip_addresses = kwargs.get('available_ip_addresses', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_address_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_address_availability_result_py3.py new file mode 100644 index 000000000000..e5fc4340d370 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_address_availability_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPAddressAvailabilityResult(Model): + """Response for CheckIPAddressAvailability API service call. + + :param available: Private IP address availability. + :type available: bool + :param available_ip_addresses: Contains other available private IP + addresses if the asked for address is taken. + :type available_ip_addresses: list[str] + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, + } + + def __init__(self, *, available: bool=None, available_ip_addresses=None, **kwargs) -> None: + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = available + self.available_ip_addresses = available_ip_addresses diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_configuration.py index 4022e3619a50..3362adb77d07 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_configuration.py @@ -51,12 +51,12 @@ class IPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_address=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state=None, name=None, etag=None): - super(IPConfiguration, self).__init__(id=id) - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(IPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_configuration_py3.py new file mode 100644 index 000000000000..b065bf68c3ee --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_configuration_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class IPConfiguration(SubResource): + """IP configuration. + + :param id: Resource ID. + :type id: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_11_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_11_01.models.Subnet + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_11_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(IPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_tag.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_tag.py index 38b3de761dd5..b8690371226d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_tag.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_tag.py @@ -27,7 +27,7 @@ class IpTag(Model): 'tag': {'key': 'tag', 'type': 'str'}, } - def __init__(self, ip_tag_type=None, tag=None): - super(IpTag, self).__init__() - self.ip_tag_type = ip_tag_type - self.tag = tag + def __init__(self, **kwargs): + super(IpTag, self).__init__(**kwargs) + self.ip_tag_type = kwargs.get('ip_tag_type', None) + self.tag = kwargs.get('tag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_tag_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_tag_py3.py new file mode 100644 index 000000000000..fbb5338ff30e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ip_tag_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IpTag(Model): + """Contains the IpTag associated with the public IP address. + + :param ip_tag_type: Gets or sets the ipTag type: Example FirstPartyUsage. + :type ip_tag_type: str + :param tag: Gets or sets value of the IpTag associated with the public IP. + Example SQL, Storage etc + :type tag: str + """ + + _attribute_map = { + 'ip_tag_type': {'key': 'ipTagType', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + } + + def __init__(self, *, ip_tag_type: str=None, tag: str=None, **kwargs) -> None: + super(IpTag, self).__init__(**kwargs) + self.ip_tag_type = ip_tag_type + self.tag = tag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipsec_policy.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipsec_policy.py index 649f9eafe5ce..31b94a374392 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipsec_policy.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipsec_policy.py @@ -15,39 +15,41 @@ class IpsecPolicy(Model): """An IPSec Policy configuration for a virtual network gateway connection. - :param sa_life_time_seconds: The IPSec Security Association (also called - Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN - tunnel. + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. :type sa_life_time_seconds: int - :param sa_data_size_kilobytes: The IPSec Security Association (also called - Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN - tunnel. + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. :type sa_data_size_kilobytes: int - :param ipsec_encryption: The IPSec encryption algorithm (IKE phase 1). - Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', - 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' :type ipsec_encryption: str or ~azure.mgmt.network.v2017_11_01.models.IpsecEncryption - :param ipsec_integrity: The IPSec integrity algorithm (IKE phase 1). - Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', 'GCMAES192', 'GCMAES256' :type ipsec_integrity: str or ~azure.mgmt.network.v2017_11_01.models.IpsecIntegrity - :param ike_encryption: The IKE encryption algorithm (IKE phase 2). - Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' :type ike_encryption: str or ~azure.mgmt.network.v2017_11_01.models.IkeEncryption - :param ike_integrity: The IKE integrity algorithm (IKE phase 2). Possible - values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' :type ike_integrity: str or ~azure.mgmt.network.v2017_11_01.models.IkeIntegrity - :param dh_group: The DH Groups used in IKE Phase 1 for initial SA. - Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' :type dh_group: str or ~azure.mgmt.network.v2017_11_01.models.DhGroup - :param pfs_group: The DH Groups used in IKE Phase 2 for new child SA. - Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', - 'ECP384', 'PFS24' + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' :type pfs_group: str or ~azure.mgmt.network.v2017_11_01.models.PfsGroup """ @@ -73,13 +75,13 @@ class IpsecPolicy(Model): 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, } - def __init__(self, sa_life_time_seconds, sa_data_size_kilobytes, ipsec_encryption, ipsec_integrity, ike_encryption, ike_integrity, dh_group, pfs_group): - super(IpsecPolicy, self).__init__() - self.sa_life_time_seconds = sa_life_time_seconds - self.sa_data_size_kilobytes = sa_data_size_kilobytes - self.ipsec_encryption = ipsec_encryption - self.ipsec_integrity = ipsec_integrity - self.ike_encryption = ike_encryption - self.ike_integrity = ike_integrity - self.dh_group = dh_group - self.pfs_group = pfs_group + def __init__(self, **kwargs): + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = kwargs.get('sa_life_time_seconds', None) + self.sa_data_size_kilobytes = kwargs.get('sa_data_size_kilobytes', None) + self.ipsec_encryption = kwargs.get('ipsec_encryption', None) + self.ipsec_integrity = kwargs.get('ipsec_integrity', None) + self.ike_encryption = kwargs.get('ike_encryption', None) + self.ike_integrity = kwargs.get('ike_integrity', None) + self.dh_group = kwargs.get('dh_group', None) + self.pfs_group = kwargs.get('pfs_group', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipsec_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipsec_policy_py3.py new file mode 100644 index 000000000000..c7df7f333796 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipsec_policy_py3.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IpsecPolicy(Model): + """An IPSec Policy configuration for a virtual network gateway connection. + + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. + :type sa_life_time_seconds: int + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. + :type sa_data_size_kilobytes: int + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :type ipsec_encryption: str or + ~azure.mgmt.network.v2017_11_01.models.IpsecEncryption + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + 'GCMAES192', 'GCMAES256' + :type ipsec_integrity: str or + ~azure.mgmt.network.v2017_11_01.models.IpsecIntegrity + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :type ike_encryption: str or + ~azure.mgmt.network.v2017_11_01.models.IkeEncryption + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :type ike_integrity: str or + ~azure.mgmt.network.v2017_11_01.models.IkeIntegrity + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + :type dh_group: str or ~azure.mgmt.network.v2017_11_01.models.DhGroup + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' + :type pfs_group: str or ~azure.mgmt.network.v2017_11_01.models.PfsGroup + """ + + _validation = { + 'sa_life_time_seconds': {'required': True}, + 'sa_data_size_kilobytes': {'required': True}, + 'ipsec_encryption': {'required': True}, + 'ipsec_integrity': {'required': True}, + 'ike_encryption': {'required': True}, + 'ike_integrity': {'required': True}, + 'dh_group': {'required': True}, + 'pfs_group': {'required': True}, + } + + _attribute_map = { + 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, + 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, + 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, + 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, + 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, + 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, + 'dh_group': {'key': 'dhGroup', 'type': 'str'}, + 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, + } + + def __init__(self, *, sa_life_time_seconds: int, sa_data_size_kilobytes: int, ipsec_encryption, ipsec_integrity, ike_encryption, ike_integrity, dh_group, pfs_group, **kwargs) -> None: + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = sa_life_time_seconds + self.sa_data_size_kilobytes = sa_data_size_kilobytes + self.ipsec_encryption = ipsec_encryption + self.ipsec_integrity = ipsec_integrity + self.ike_encryption = ike_encryption + self.ike_integrity = ike_integrity + self.dh_group = dh_group + self.pfs_group = pfs_group diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipv6_express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipv6_express_route_circuit_peering_config.py index d6a11d062b2e..e6d1b2ba28da 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipv6_express_route_circuit_peering_config.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipv6_express_route_circuit_peering_config.py @@ -38,10 +38,10 @@ class Ipv6ExpressRouteCircuitPeeringConfig(Model): 'state': {'key': 'state', 'type': 'str'}, } - def __init__(self, primary_peer_address_prefix=None, secondary_peer_address_prefix=None, microsoft_peering_config=None, route_filter=None, state=None): - super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__() - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.microsoft_peering_config = microsoft_peering_config - self.route_filter = route_filter - self.state = state + def __init__(self, **kwargs): + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.route_filter = kwargs.get('route_filter', None) + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipv6_express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipv6_express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..cf6558bf21f6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/ipv6_express_route_circuit_peering_config_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv6ExpressRouteCircuitPeeringConfig(Model): + """Contains IPv6 peering config. + + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2017_11_01.models.RouteFilter + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeeringState + """ + + _attribute_map = { + 'primary_peer_address_prefix': {'key': 'primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'secondaryPeerAddressPrefix', 'type': 'str'}, + 'microsoft_peering_config': {'key': 'microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'route_filter': {'key': 'routeFilter', 'type': 'RouteFilter'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, microsoft_peering_config=None, route_filter=None, state=None, **kwargs) -> None: + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.microsoft_peering_config = microsoft_peering_config + self.route_filter = route_filter + self.state = state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer.py index 05d62900bd5d..1e63141e623d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer.py @@ -100,16 +100,16 @@ class LoadBalancer(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(LoadBalancer, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pools = backend_address_pools - self.load_balancing_rules = load_balancing_rules - self.probes = probes - self.inbound_nat_rules = inbound_nat_rules - self.inbound_nat_pools = inbound_nat_pools - self.outbound_nat_rules = outbound_nat_rules - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancer, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.load_balancing_rules = kwargs.get('load_balancing_rules', None) + self.probes = kwargs.get('probes', None) + self.inbound_nat_rules = kwargs.get('inbound_nat_rules', None) + self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) + self.outbound_nat_rules = kwargs.get('outbound_nat_rules', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer_py3.py new file mode 100644 index 000000000000..2a434be050c2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer_py3.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LoadBalancer(Resource): + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The load balancer SKU. + :type sku: ~azure.mgmt.network.v2017_11_01.models.LoadBalancerSku + :param frontend_ip_configurations: Object representing the frontend IPs to + be used for the load balancer + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_11_01.models.FrontendIPConfiguration] + :param backend_address_pools: Collection of backend address pools used by + a load balancer + :type backend_address_pools: + list[~azure.mgmt.network.v2017_11_01.models.BackendAddressPool] + :param load_balancing_rules: Object collection representing the load + balancing rules Gets the provisioning + :type load_balancing_rules: + list[~azure.mgmt.network.v2017_11_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer + :type probes: list[~azure.mgmt.network.v2017_11_01.models.Probe] + :param inbound_nat_rules: Collection of inbound NAT Rules used by a load + balancer. Defining inbound NAT rules on your load balancer is mutually + exclusive with defining an inbound NAT pool. Inbound NAT pools are + referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an Inbound NAT pool. They + have to reference individual inbound NAT rules. + :type inbound_nat_rules: + list[~azure.mgmt.network.v2017_11_01.models.InboundNatRule] + :param inbound_nat_pools: Defines an external port range for inbound NAT + to a single backend port on NICs associated with a load balancer. Inbound + NAT rules are created automatically for each NIC associated with the Load + Balancer using an external port from this range. Defining an Inbound NAT + pool on your Load Balancer is mutually exclusive with defining inbound Nat + rules. Inbound NAT pools are referenced from virtual machine scale sets. + NICs that are associated with individual virtual machines cannot reference + an inbound NAT pool. They have to reference individual inbound NAT rules. + :type inbound_nat_pools: + list[~azure.mgmt.network.v2017_11_01.models.InboundNatPool] + :param outbound_nat_rules: The outbound NAT rules. + :type outbound_nat_rules: + list[~azure.mgmt.network.v2017_11_01.models.OutboundNatRule] + :param resource_guid: The resource GUID property of the load balancer + resource. + :type resource_guid: str + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'LoadBalancerSku'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, + 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[OutboundNatRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancer, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pools = backend_address_pools + self.load_balancing_rules = load_balancing_rules + self.probes = probes + self.inbound_nat_rules = inbound_nat_rules + self.inbound_nat_pools = inbound_nat_pools + self.outbound_nat_rules = outbound_nat_rules + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer_sku.py index d49fe89818a0..62d44e611690 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer_sku.py @@ -25,6 +25,6 @@ class LoadBalancerSku(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - super(LoadBalancerSku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer_sku_py3.py new file mode 100644 index 000000000000..5305f95bc535 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancer_sku_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LoadBalancerSku(Model): + """SKU of a load balancer. + + :param name: Name of a load balancer SKU. Possible values include: + 'Basic', 'Standard' + :type name: str or + ~azure.mgmt.network.v2017_11_01.models.LoadBalancerSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancing_rule.py index 6c880395533a..64f43d958111 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancing_rule.py @@ -15,6 +15,8 @@ class LoadBalancingRule(SubResource): """A load balancing rule for a load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param frontend_ip_configuration: A reference to frontend IP addresses. @@ -27,7 +29,7 @@ class LoadBalancingRule(SubResource): :param probe: The reference of the load balancer probe used by the load balancing rule. :type probe: ~azure.mgmt.network.v2017_11_01.models.SubResource - :param protocol: Possible values include: 'Udp', 'Tcp', 'All' + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' :type protocol: str or ~azure.mgmt.network.v2017_11_01.models.TransportProtocol :param load_distribution: The load distribution policy for this rule. @@ -35,9 +37,9 @@ class LoadBalancingRule(SubResource): Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' :type load_distribution: str or ~azure.mgmt.network.v2017_11_01.models.LoadDistribution - :param frontend_port: The port for the external endpoint. Port numbers for - each rule must be unique within the Load Balancer. Acceptable values are - between 0 and 65534. Note that value 0 enables "Any Port" + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 0 and 65534. Note that value 0 enables "Any Port" :type frontend_port: int :param backend_port: The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 @@ -90,18 +92,18 @@ class LoadBalancingRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, frontend_port, id=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port=None, idle_timeout_in_minutes=None, enable_floating_ip=None, disable_outbound_snat=None, provisioning_state=None, name=None, etag=None): - super(LoadBalancingRule, self).__init__(id=id) - self.frontend_ip_configuration = frontend_ip_configuration - self.backend_address_pool = backend_address_pool - self.probe = probe - self.protocol = protocol - self.load_distribution = load_distribution - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.disable_outbound_snat = disable_outbound_snat - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(LoadBalancingRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.probe = kwargs.get('probe', None) + self.protocol = kwargs.get('protocol', None) + self.load_distribution = kwargs.get('load_distribution', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.disable_outbound_snat = kwargs.get('disable_outbound_snat', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancing_rule_py3.py new file mode 100644 index 000000000000..e01cd6dcb92f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/load_balancing_rule_py3.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class LoadBalancingRule(SubResource): + """A load balancing rule for a load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param backend_address_pool: A reference to a pool of DIPs. Inbound + traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param probe: The reference of the load balancer probe used by the load + balancing rule. + :type probe: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2017_11_01.models.TransportProtocol + :param load_distribution: The load distribution policy for this rule. + Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + :type load_distribution: str or + ~azure.mgmt.network.v2017_11_01.models.LoadDistribution + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 0 and 65534. Note that value 0 enables "Any Port" + :type frontend_port: int + :param backend_port: The port used for internal connections on the + endpoint. Acceptable values are between 0 and 65535. Note that value 0 + enables "Any Port" + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param disable_outbound_snat: Configures SNAT for the VMs in the backend + pool to use the publicIP address specified in the frontend of the load + balancing rule. + :type disable_outbound_snat: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'disable_outbound_snat': {'key': 'properties.disableOutboundSnat', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port: int, id: str=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, disable_outbound_snat: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancingRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_address_pool = backend_address_pool + self.probe = probe + self.protocol = protocol + self.load_distribution = load_distribution + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.disable_outbound_snat = disable_outbound_snat + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/local_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/local_network_gateway.py index 235072053cb5..376f1b0f1b4e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/local_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/local_network_gateway.py @@ -67,11 +67,11 @@ class LocalNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, local_network_address_space=None, gateway_ip_address=None, bgp_settings=None, resource_guid=None, etag=None): - super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.local_network_address_space = local_network_address_space - self.gateway_ip_address = gateway_ip_address - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(LocalNetworkGateway, self).__init__(**kwargs) + self.local_network_address_space = kwargs.get('local_network_address_space', None) + self.gateway_ip_address = kwargs.get('gateway_ip_address', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/local_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/local_network_gateway_py3.py new file mode 100644 index 000000000000..127501027e79 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/local_network_gateway_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LocalNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param local_network_address_space: Local network site address space. + :type local_network_address_space: + ~azure.mgmt.network.v2017_11_01.models.AddressSpace + :param gateway_ip_address: IP address of local network gateway. + :type gateway_ip_address: str + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2017_11_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + LocalNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', + and 'Failed'. + :vartype provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, + 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, local_network_address_space=None, gateway_ip_address: str=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.local_network_address_space = local_network_address_space + self.gateway_ip_address = gateway_ip_address + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/log_specification.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/log_specification.py index 2386ea5f799f..ab592992d904 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/log_specification.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/log_specification.py @@ -29,8 +29,8 @@ class LogSpecification(Model): 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, blob_duration=None): - super(LogSpecification, self).__init__() - self.name = name - self.display_name = display_name - self.blob_duration = blob_duration + def __init__(self, **kwargs): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/log_specification_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/log_specification_py3.py new file mode 100644 index 000000000000..6184811d393e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/log_specification_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LogSpecification(Model): + """Description of logging specification. + + :param name: The name of the specification. + :type name: str + :param display_name: The display name of the specification. + :type display_name: str + :param blob_duration: Duration of the blob. + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str=None, **kwargs) -> None: + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/metric_specification.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/metric_specification.py index b335b2333886..883c63451ffa 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/metric_specification.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/metric_specification.py @@ -64,19 +64,19 @@ class MetricSpecification(Model): 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, } - def __init__(self, name=None, display_name=None, display_description=None, unit=None, aggregation_type=None, availabilities=None, enable_regional_mdm_account=None, fill_gap_with_zero=None, metric_filter_pattern=None, dimensions=None, is_internal=None, source_mdm_account=None, source_mdm_namespace=None, resource_id_dimension_name_override=None): - super(MetricSpecification, self).__init__() - self.name = name - self.display_name = display_name - self.display_description = display_description - self.unit = unit - self.aggregation_type = aggregation_type - self.availabilities = availabilities - self.enable_regional_mdm_account = enable_regional_mdm_account - self.fill_gap_with_zero = fill_gap_with_zero - self.metric_filter_pattern = metric_filter_pattern - self.dimensions = dimensions - self.is_internal = is_internal - self.source_mdm_account = source_mdm_account - self.source_mdm_namespace = source_mdm_namespace - self.resource_id_dimension_name_override = resource_id_dimension_name_override + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.availabilities = kwargs.get('availabilities', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.metric_filter_pattern = kwargs.get('metric_filter_pattern', None) + self.dimensions = kwargs.get('dimensions', None) + self.is_internal = kwargs.get('is_internal', None) + self.source_mdm_account = kwargs.get('source_mdm_account', None) + self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/metric_specification_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/metric_specification_py3.py new file mode 100644 index 000000000000..6e972621e0ae --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/metric_specification_py3.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricSpecification(Model): + """Description of metrics specification. + + :param name: The name of the metric. + :type name: str + :param display_name: The display name of the metric. + :type display_name: str + :param display_description: The description of the metric. + :type display_description: str + :param unit: Units the metric to be displayed in. + :type unit: str + :param aggregation_type: The aggregation type. + :type aggregation_type: str + :param availabilities: List of availability. + :type availabilities: + list[~azure.mgmt.network.v2017_11_01.models.Availability] + :param enable_regional_mdm_account: Whether regional MDM account enabled. + :type enable_regional_mdm_account: bool + :param fill_gap_with_zero: Whether gaps would be filled with zeros. + :type fill_gap_with_zero: bool + :param metric_filter_pattern: Pattern for the filter of the metric. + :type metric_filter_pattern: str + :param dimensions: List of dimensions. + :type dimensions: list[~azure.mgmt.network.v2017_11_01.models.Dimension] + :param is_internal: Whether the metric is internal. + :type is_internal: bool + :param source_mdm_account: The source MDM account. + :type source_mdm_account: str + :param source_mdm_namespace: The source MDM namespace. + :type source_mdm_namespace: str + :param resource_id_dimension_name_override: The resource Id dimension name + override. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[Availability]'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, availabilities=None, enable_regional_mdm_account: bool=None, fill_gap_with_zero: bool=None, metric_filter_pattern: str=None, dimensions=None, is_internal: bool=None, source_mdm_account: str=None, source_mdm_namespace: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.availabilities = availabilities + self.enable_regional_mdm_account = enable_regional_mdm_account + self.fill_gap_with_zero = fill_gap_with_zero + self.metric_filter_pattern = metric_filter_pattern + self.dimensions = dimensions + self.is_internal = is_internal + self.source_mdm_account = source_mdm_account + self.source_mdm_namespace = source_mdm_namespace + self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface.py index 21c21fe1e7ba..6c68be7501fb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface.py @@ -87,16 +87,16 @@ class NetworkInterface(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address=None, primary=None, enable_accelerated_networking=None, enable_ip_forwarding=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkInterface, self).__init__(id=id, location=location, tags=tags) - self.virtual_machine = virtual_machine - self.network_security_group = network_security_group - self.ip_configurations = ip_configurations - self.dns_settings = dns_settings - self.mac_address = mac_address - self.primary = primary - self.enable_accelerated_networking = enable_accelerated_networking - self.enable_ip_forwarding = enable_ip_forwarding - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.virtual_machine = kwargs.get('virtual_machine', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.mac_address = kwargs.get('mac_address', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_association.py index 69295c231697..578c405ebd55 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_association.py @@ -34,7 +34,7 @@ class NetworkInterfaceAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(NetworkInterfaceAssociation, self).__init__() + def __init__(self, **kwargs): + super(NetworkInterfaceAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_association_py3.py new file mode 100644 index 000000000000..a20e2decab3c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Network interface ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2017_11_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(NetworkInterfaceAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_dns_settings.py index 675a4a1eb08a..b6ee0ff40d51 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_dns_settings.py @@ -46,10 +46,10 @@ class NetworkInterfaceDnsSettings(Model): 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, } - def __init__(self, dns_servers=None, applied_dns_servers=None, internal_dns_name_label=None, internal_fqdn=None, internal_domain_name_suffix=None): - super(NetworkInterfaceDnsSettings, self).__init__() - self.dns_servers = dns_servers - self.applied_dns_servers = applied_dns_servers - self.internal_dns_name_label = internal_dns_name_label - self.internal_fqdn = internal_fqdn - self.internal_domain_name_suffix = internal_domain_name_suffix + def __init__(self, **kwargs): + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + self.applied_dns_servers = kwargs.get('applied_dns_servers', None) + self.internal_dns_name_label = kwargs.get('internal_dns_name_label', None) + self.internal_fqdn = kwargs.get('internal_fqdn', None) + self.internal_domain_name_suffix = kwargs.get('internal_domain_name_suffix', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_dns_settings_py3.py new file mode 100644 index 000000000000..ccdcc937def8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_dns_settings_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceDnsSettings(Model): + """DNS settings of a network interface. + + :param dns_servers: List of DNS servers IP addresses. Use + 'AzureProvidedDNS' to switch to azure provided DNS resolution. + 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + only value in dnsServers collection. + :type dns_servers: list[str] + :param applied_dns_servers: If the VM that uses this NIC is part of an + Availability Set, then this list will have the union of all DNS servers + from all NICs that are part of the Availability Set. This property is what + is configured on each of those VMs. + :type applied_dns_servers: list[str] + :param internal_dns_name_label: Relative DNS name for this NIC used for + internal communications between VMs in the same virtual network. + :type internal_dns_name_label: str + :param internal_fqdn: Fully qualified DNS name supporting internal + communications between VMs in the same virtual network. + :type internal_fqdn: str + :param internal_domain_name_suffix: Even if internalDnsNameLabel is not + specified, a DNS entry is created for the primary NIC of the VM. This DNS + name can be constructed by concatenating the VM name with the value of + internalDomainNameSuffix. + :type internal_domain_name_suffix: str + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, + 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, + } + + def __init__(self, *, dns_servers=None, applied_dns_servers=None, internal_dns_name_label: str=None, internal_fqdn: str=None, internal_domain_name_suffix: str=None, **kwargs) -> None: + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers + self.applied_dns_servers = applied_dns_servers + self.internal_dns_name_label = internal_dns_name_label + self.internal_fqdn = internal_fqdn + self.internal_domain_name_suffix = internal_domain_name_suffix diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_ip_configuration.py index 1dd9ea7c3b0f..cf3de3376b13 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_ip_configuration.py @@ -83,18 +83,18 @@ class NetworkInterfaceIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary=None, public_ip_address=None, application_security_groups=None, provisioning_state=None, name=None, etag=None): - super(NetworkInterfaceIPConfiguration, self).__init__(id=id) - self.application_gateway_backend_address_pools = application_gateway_backend_address_pools - self.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.private_ip_address_version = private_ip_address_version - self.subnet = subnet - self.primary = primary - self.public_ip_address = public_ip_address - self.application_security_groups = application_security_groups - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(NetworkInterfaceIPConfiguration, self).__init__(**kwargs) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_rules = kwargs.get('load_balancer_inbound_nat_rules', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.application_security_groups = kwargs.get('application_security_groups', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_ip_configuration_py3.py new file mode 100644 index 000000000000..546bc8d06a80 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_ip_configuration_py3.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class NetworkInterfaceIPConfiguration(SubResource): + """IPConfiguration in a network interface. + + :param id: Resource ID. + :type id: str + :param application_gateway_backend_address_pools: The reference of + ApplicationGatewayBackendAddressPool resource. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendAddressPool] + :param load_balancer_backend_address_pools: The reference of + LoadBalancerBackendAddressPool resource. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2017_11_01.models.BackendAddressPool] + :param load_balancer_inbound_nat_rules: A list of references of + LoadBalancerInboundNatRules. + :type load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2017_11_01.models.InboundNatRule] + :param private_ip_address: Private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: Defines how a private IP address is + assigned. Possible values are: 'Static' and 'Dynamic'. Possible values + include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_11_01.models.IPAllocationMethod + :param private_ip_address_version: Available from Api-Version 2016-03-30 + onwards, it represents whether the specific ipconfiguration is IPv4 or + IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.network.v2017_11_01.models.IPVersion + :param subnet: Subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.network.v2017_11_01.models.Subnet + :param primary: Gets whether this is a primary customer address on the + network interface. + :type primary: bool + :param public_ip_address: Public IP address bound to the IP configuration. + :type public_ip_address: + ~azure.mgmt.network.v2017_11_01.models.PublicIPAddress + :param application_security_groups: Application security groups in which + the IP configuration is included. + :type application_security_groups: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroup] + :param provisioning_state: The provisioning state of the network interface + IP configuration. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'application_security_groups': {'key': 'properties.applicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address: str=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary: bool=None, public_ip_address=None, application_security_groups=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterfaceIPConfiguration, self).__init__(id=id, **kwargs) + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.private_ip_address_version = private_ip_address_version + self.subnet = subnet + self.primary = primary + self.public_ip_address = public_ip_address + self.application_security_groups = application_security_groups + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_py3.py new file mode 100644 index 000000000000..0ddd8bf321e5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_interface_py3.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkInterface(Resource): + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param virtual_machine: The reference of a virtual machine. + :type virtual_machine: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroup + :param ip_configurations: A list of IPConfigurations of the network + interface. + :type ip_configurations: + list[~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceIPConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: + ~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceDnsSettings + :param mac_address: The MAC address of the network interface. + :type mac_address: str + :param primary: Gets whether this is a primary network interface on a + virtual machine. + :type primary: bool + :param enable_accelerated_networking: If the network interface is + accelerated networking enabled. + :type enable_accelerated_networking: bool + :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on + this network interface. + :type enable_ip_forwarding: bool + :param resource_guid: The resource GUID property of the network interface + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, + 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address: str=None, primary: bool=None, enable_accelerated_networking: bool=None, enable_ip_forwarding: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterface, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.virtual_machine = virtual_machine + self.network_security_group = network_security_group + self.ip_configurations = ip_configurations + self.dns_settings = dns_settings + self.mac_address = mac_address + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.enable_ip_forwarding = enable_ip_forwarding + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_management_client_enums.py index abd139a2762c..80779ff26b9f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_management_client_enums.py @@ -12,45 +12,45 @@ from enum import Enum -class TransportProtocol(Enum): +class TransportProtocol(str, Enum): udp = "Udp" tcp = "Tcp" all = "All" -class IPAllocationMethod(Enum): +class IPAllocationMethod(str, Enum): static = "Static" dynamic = "Dynamic" -class IPVersion(Enum): +class IPVersion(str, Enum): ipv4 = "IPv4" ipv6 = "IPv6" -class SecurityRuleProtocol(Enum): +class SecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" asterisk = "*" -class SecurityRuleAccess(Enum): +class SecurityRuleAccess(str, Enum): allow = "Allow" deny = "Deny" -class SecurityRuleDirection(Enum): +class SecurityRuleDirection(str, Enum): inbound = "Inbound" outbound = "Outbound" -class RouteNextHopType(Enum): +class RouteNextHopType(str, Enum): virtual_network_gateway = "VirtualNetworkGateway" vnet_local = "VnetLocal" @@ -59,25 +59,25 @@ class RouteNextHopType(Enum): none = "None" -class PublicIPAddressSkuName(Enum): +class PublicIPAddressSkuName(str, Enum): basic = "Basic" standard = "Standard" -class ApplicationGatewayProtocol(Enum): +class ApplicationGatewayProtocol(str, Enum): http = "Http" https = "Https" -class ApplicationGatewayCookieBasedAffinity(Enum): +class ApplicationGatewayCookieBasedAffinity(str, Enum): enabled = "Enabled" disabled = "Disabled" -class ApplicationGatewayBackendHealthServerHealth(Enum): +class ApplicationGatewayBackendHealthServerHealth(str, Enum): unknown = "Unknown" up = "Up" @@ -86,7 +86,7 @@ class ApplicationGatewayBackendHealthServerHealth(Enum): draining = "Draining" -class ApplicationGatewaySkuName(Enum): +class ApplicationGatewaySkuName(str, Enum): standard_small = "Standard_Small" standard_medium = "Standard_Medium" @@ -95,33 +95,33 @@ class ApplicationGatewaySkuName(Enum): waf_large = "WAF_Large" -class ApplicationGatewayTier(Enum): +class ApplicationGatewayTier(str, Enum): standard = "Standard" waf = "WAF" -class ApplicationGatewaySslProtocol(Enum): +class ApplicationGatewaySslProtocol(str, Enum): tl_sv1_0 = "TLSv1_0" tl_sv1_1 = "TLSv1_1" tl_sv1_2 = "TLSv1_2" -class ApplicationGatewaySslPolicyType(Enum): +class ApplicationGatewaySslPolicyType(str, Enum): predefined = "Predefined" custom = "Custom" -class ApplicationGatewaySslPolicyName(Enum): +class ApplicationGatewaySslPolicyName(str, Enum): app_gw_ssl_policy20150501 = "AppGwSslPolicy20150501" app_gw_ssl_policy20170401 = "AppGwSslPolicy20170401" app_gw_ssl_policy20170401_s = "AppGwSslPolicy20170401S" -class ApplicationGatewaySslCipherSuite(Enum): +class ApplicationGatewaySslCipherSuite(str, Enum): tls_ecdhe_rsa_with_aes_256_cbc_sha384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" tls_ecdhe_rsa_with_aes_128_cbc_sha256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" @@ -150,13 +150,13 @@ class ApplicationGatewaySslCipherSuite(Enum): tls_rsa_with_3_des_ede_cbc_sha = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" -class ApplicationGatewayRequestRoutingRuleType(Enum): +class ApplicationGatewayRequestRoutingRuleType(str, Enum): basic = "Basic" path_based_routing = "PathBasedRouting" -class ApplicationGatewayRedirectType(Enum): +class ApplicationGatewayRedirectType(str, Enum): permanent = "Permanent" found = "Found" @@ -164,7 +164,7 @@ class ApplicationGatewayRedirectType(Enum): temporary = "Temporary" -class ApplicationGatewayOperationalState(Enum): +class ApplicationGatewayOperationalState(str, Enum): stopped = "Stopped" starting = "Starting" @@ -172,19 +172,19 @@ class ApplicationGatewayOperationalState(Enum): stopping = "Stopping" -class ApplicationGatewayFirewallMode(Enum): +class ApplicationGatewayFirewallMode(str, Enum): detection = "Detection" prevention = "Prevention" -class AuthorizationUseStatus(Enum): +class AuthorizationUseStatus(str, Enum): available = "Available" in_use = "InUse" -class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(str, Enum): not_configured = "NotConfigured" configuring = "Configuring" @@ -192,38 +192,38 @@ class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(Enum): validation_needed = "ValidationNeeded" -class Access(Enum): +class Access(str, Enum): allow = "Allow" deny = "Deny" -class ExpressRouteCircuitPeeringType(Enum): +class ExpressRouteCircuitPeeringType(str, Enum): azure_public_peering = "AzurePublicPeering" azure_private_peering = "AzurePrivatePeering" microsoft_peering = "MicrosoftPeering" -class ExpressRouteCircuitPeeringState(Enum): +class ExpressRouteCircuitPeeringState(str, Enum): disabled = "Disabled" enabled = "Enabled" -class ExpressRouteCircuitSkuTier(Enum): +class ExpressRouteCircuitSkuTier(str, Enum): standard = "Standard" premium = "Premium" -class ExpressRouteCircuitSkuFamily(Enum): +class ExpressRouteCircuitSkuFamily(str, Enum): unlimited_data = "UnlimitedData" metered_data = "MeteredData" -class ServiceProviderProvisioningState(Enum): +class ServiceProviderProvisioningState(str, Enum): not_provisioned = "NotProvisioned" provisioning = "Provisioning" @@ -231,40 +231,40 @@ class ServiceProviderProvisioningState(Enum): deprovisioning = "Deprovisioning" -class LoadBalancerSkuName(Enum): +class LoadBalancerSkuName(str, Enum): basic = "Basic" standard = "Standard" -class LoadDistribution(Enum): +class LoadDistribution(str, Enum): default = "Default" source_ip = "SourceIP" source_ip_protocol = "SourceIPProtocol" -class ProbeProtocol(Enum): +class ProbeProtocol(str, Enum): http = "Http" tcp = "Tcp" -class NetworkOperationStatus(Enum): +class NetworkOperationStatus(str, Enum): in_progress = "InProgress" succeeded = "Succeeded" failed = "Failed" -class EffectiveSecurityRuleProtocol(Enum): +class EffectiveSecurityRuleProtocol(str, Enum): tcp = "Tcp" udp = "Udp" all = "All" -class EffectiveRouteSource(Enum): +class EffectiveRouteSource(str, Enum): unknown = "Unknown" user = "User" @@ -272,13 +272,13 @@ class EffectiveRouteSource(Enum): default = "Default" -class EffectiveRouteState(Enum): +class EffectiveRouteState(str, Enum): active = "Active" invalid = "Invalid" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): succeeded = "Succeeded" updating = "Updating" @@ -286,25 +286,25 @@ class ProvisioningState(Enum): failed = "Failed" -class AssociationType(Enum): +class AssociationType(str, Enum): associated = "Associated" contains = "Contains" -class Direction(Enum): +class Direction(str, Enum): inbound = "Inbound" outbound = "Outbound" -class Protocol(Enum): +class Protocol(str, Enum): tcp = "TCP" udp = "UDP" -class NextHopType(Enum): +class NextHopType(str, Enum): internet = "Internet" virtual_appliance = "VirtualAppliance" @@ -314,14 +314,14 @@ class NextHopType(Enum): none = "None" -class PcProtocol(Enum): +class PcProtocol(str, Enum): tcp = "TCP" udp = "UDP" any = "Any" -class PcStatus(Enum): +class PcStatus(str, Enum): not_started = "NotStarted" running = "Running" @@ -330,7 +330,7 @@ class PcStatus(Enum): unknown = "Unknown" -class PcError(Enum): +class PcError(str, Enum): internal_error = "InternalError" agent_stopped = "AgentStopped" @@ -339,20 +339,20 @@ class PcError(Enum): storage_failed = "StorageFailed" -class Origin(Enum): +class Origin(str, Enum): local = "Local" inbound = "Inbound" outbound = "Outbound" -class Severity(Enum): +class Severity(str, Enum): error = "Error" warning = "Warning" -class IssueType(Enum): +class IssueType(str, Enum): unknown = "Unknown" agent_stopped = "AgentStopped" @@ -365,7 +365,7 @@ class IssueType(Enum): platform = "Platform" -class ConnectionStatus(Enum): +class ConnectionStatus(str, Enum): unknown = "Unknown" connected = "Connected" @@ -373,40 +373,40 @@ class ConnectionStatus(Enum): degraded = "Degraded" -class ConnectionState(Enum): +class ConnectionState(str, Enum): reachable = "Reachable" unreachable = "Unreachable" unknown = "Unknown" -class EvaluationState(Enum): +class EvaluationState(str, Enum): not_started = "NotStarted" in_progress = "InProgress" completed = "Completed" -class VirtualNetworkPeeringState(Enum): +class VirtualNetworkPeeringState(str, Enum): initiated = "Initiated" connected = "Connected" disconnected = "Disconnected" -class VirtualNetworkGatewayType(Enum): +class VirtualNetworkGatewayType(str, Enum): vpn = "Vpn" express_route = "ExpressRoute" -class VpnType(Enum): +class VpnType(str, Enum): policy_based = "PolicyBased" route_based = "RouteBased" -class VirtualNetworkGatewaySkuName(Enum): +class VirtualNetworkGatewaySkuName(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -417,7 +417,7 @@ class VirtualNetworkGatewaySkuName(Enum): vpn_gw3 = "VpnGw3" -class VirtualNetworkGatewaySkuTier(Enum): +class VirtualNetworkGatewaySkuTier(str, Enum): basic = "Basic" high_performance = "HighPerformance" @@ -428,13 +428,13 @@ class VirtualNetworkGatewaySkuTier(Enum): vpn_gw3 = "VpnGw3" -class VpnClientProtocol(Enum): +class VpnClientProtocol(str, Enum): ike_v2 = "IkeV2" sstp = "SSTP" -class BgpPeerState(Enum): +class BgpPeerState(str, Enum): unknown = "Unknown" stopped = "Stopped" @@ -443,19 +443,19 @@ class BgpPeerState(Enum): connected = "Connected" -class ProcessorArchitecture(Enum): +class ProcessorArchitecture(str, Enum): amd64 = "Amd64" x86 = "X86" -class AuthenticationMethod(Enum): +class AuthenticationMethod(str, Enum): eaptls = "EAPTLS" eapmscha_pv2 = "EAPMSCHAPv2" -class VirtualNetworkGatewayConnectionStatus(Enum): +class VirtualNetworkGatewayConnectionStatus(str, Enum): unknown = "Unknown" connecting = "Connecting" @@ -463,7 +463,7 @@ class VirtualNetworkGatewayConnectionStatus(Enum): not_connected = "NotConnected" -class VirtualNetworkGatewayConnectionType(Enum): +class VirtualNetworkGatewayConnectionType(str, Enum): ipsec = "IPsec" vnet2_vnet = "Vnet2Vnet" @@ -471,7 +471,7 @@ class VirtualNetworkGatewayConnectionType(Enum): vpn_client = "VPNClient" -class IpsecEncryption(Enum): +class IpsecEncryption(str, Enum): none = "None" des = "DES" @@ -484,7 +484,7 @@ class IpsecEncryption(Enum): gcmaes256 = "GCMAES256" -class IpsecIntegrity(Enum): +class IpsecIntegrity(str, Enum): md5 = "MD5" sha1 = "SHA1" @@ -494,7 +494,7 @@ class IpsecIntegrity(Enum): gcmaes256 = "GCMAES256" -class IkeEncryption(Enum): +class IkeEncryption(str, Enum): des = "DES" des3 = "DES3" @@ -503,7 +503,7 @@ class IkeEncryption(Enum): aes256 = "AES256" -class IkeIntegrity(Enum): +class IkeIntegrity(str, Enum): md5 = "MD5" sha1 = "SHA1" @@ -511,7 +511,7 @@ class IkeIntegrity(Enum): sha384 = "SHA384" -class DhGroup(Enum): +class DhGroup(str, Enum): none = "None" dh_group1 = "DHGroup1" @@ -523,7 +523,7 @@ class DhGroup(Enum): dh_group24 = "DHGroup24" -class PfsGroup(Enum): +class PfsGroup(str, Enum): none = "None" pfs1 = "PFS1" diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_security_group.py index e76e4d18248e..2a223c8934ac 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_security_group.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_security_group.py @@ -75,12 +75,12 @@ class NetworkSecurityGroup(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, security_rules=None, default_security_rules=None, resource_guid=None, provisioning_state=None, etag=None): - super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags) - self.security_rules = security_rules - self.default_security_rules = default_security_rules + def __init__(self, **kwargs): + super(NetworkSecurityGroup, self).__init__(**kwargs) + self.security_rules = kwargs.get('security_rules', None) + self.default_security_rules = kwargs.get('default_security_rules', None) self.network_interfaces = None self.subnets = None - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_security_group_py3.py new file mode 100644 index 000000000000..897bda91be59 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_security_group_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkSecurityGroup(Resource): + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param security_rules: A collection of security rules of the network + security group. + :type security_rules: + list[~azure.mgmt.network.v2017_11_01.models.SecurityRule] + :param default_security_rules: The default security rules of network + security group. + :type default_security_rules: + list[~azure.mgmt.network.v2017_11_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network + interfaces. + :vartype network_interfaces: + list[~azure.mgmt.network.v2017_11_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2017_11_01.models.Subnet] + :param resource_guid: The resource GUID property of the network security + group resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, + 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, security_rules=None, default_security_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.security_rules = security_rules + self.default_security_rules = default_security_rules + self.network_interfaces = None + self.subnets = None + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_watcher.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_watcher.py index b3ef9b0362fb..22d7a8966b8d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_watcher.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_watcher.py @@ -53,7 +53,7 @@ class NetworkWatcher(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, etag=None): - super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags) - self.etag = etag + def __init__(self, **kwargs): + super(NetworkWatcher, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_watcher_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_watcher_py3.py new file mode 100644 index 000000000000..1421fe4b4047 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/network_watcher_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkWatcher(Resource): + """Network watcher in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.network.v2017_11_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, etag: str=None, **kwargs) -> None: + super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = etag + self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_parameters.py index 3e1478409a0a..54d8674c8884 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_parameters.py @@ -15,12 +15,14 @@ class NextHopParameters(Model): """Parameters that define the source and destination endpoint. - :param target_resource_id: The resource identifier of the target resource - against which the action is to be performed. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. :type target_resource_id: str - :param source_ip_address: The source IP address. + :param source_ip_address: Required. The source IP address. :type source_ip_address: str - :param destination_ip_address: The destination IP address. + :param destination_ip_address: Required. The destination IP address. :type destination_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be @@ -41,9 +43,9 @@ class NextHopParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, source_ip_address, destination_ip_address, target_nic_resource_id=None): - super(NextHopParameters, self).__init__() - self.target_resource_id = target_resource_id - self.source_ip_address = source_ip_address - self.destination_ip_address = destination_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.source_ip_address = kwargs.get('source_ip_address', None) + self.destination_ip_address = kwargs.get('destination_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_parameters_py3.py new file mode 100644 index 000000000000..50ee3d334e91 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_parameters_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopParameters(Model): + """Parameters that define the source and destination endpoint. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. + :type target_resource_id: str + :param source_ip_address: Required. The source IP address. + :type source_ip_address: str + :param destination_ip_address: Required. The destination IP address. + :type destination_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of the nics, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'source_ip_address': {'required': True}, + 'destination_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, + 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, source_ip_address: str, destination_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.source_ip_address = source_ip_address + self.destination_ip_address = destination_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_result.py index 3709d2400d0a..aad27228a28f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_result.py @@ -35,8 +35,8 @@ class NextHopResult(Model): 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, } - def __init__(self, next_hop_type=None, next_hop_ip_address=None, route_table_id=None): - super(NextHopResult, self).__init__() - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.route_table_id = route_table_id + def __init__(self, **kwargs): + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.route_table_id = kwargs.get('route_table_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_result_py3.py new file mode 100644 index 000000000000..778e4728f24c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/next_hop_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopResult(Model): + """The information about next hop from the specified VM. + + :param next_hop_type: Next hop type. Possible values include: 'Internet', + 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', + 'HyperNetGateway', 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_11_01.models.NextHopType + :param next_hop_ip_address: Next hop IP Address + :type next_hop_ip_address: str + :param route_table_id: The resource identifier for the route table + associated with the route being returned. If the route being returned does + not correspond to any user created routes then this field will be the + string 'System Route'. + :type route_table_id: str + """ + + _attribute_map = { + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type=None, next_hop_ip_address: str=None, route_table_id: str=None, **kwargs) -> None: + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.route_table_id = route_table_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation.py index 004cbeabf67d..31a3a62b63db 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation.py @@ -33,9 +33,9 @@ class Operation(Model): 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationPropertiesFormatServiceSpecification'}, } - def __init__(self, name=None, display=None, origin=None, service_specification=None): - super(Operation, self).__init__() - self.name = name - self.display = display - self.origin = origin - self.service_specification = service_specification + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_display.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_display.py index 91ea63defbf0..6e37c2433f56 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_display.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_display.py @@ -32,9 +32,9 @@ class OperationDisplay(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_display_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_display_py3.py new file mode 100644 index 000000000000..c0508a41bd48 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Network. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of the operation: get, read, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_properties_format_service_specification.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_properties_format_service_specification.py index a002cb3432c8..9781a6aa0587 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_properties_format_service_specification.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_properties_format_service_specification.py @@ -28,7 +28,7 @@ class OperationPropertiesFormatServiceSpecification(Model): 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, } - def __init__(self, metric_specifications=None, log_specifications=None): - super(OperationPropertiesFormatServiceSpecification, self).__init__() - self.metric_specifications = metric_specifications - self.log_specifications = log_specifications + def __init__(self, **kwargs): + super(OperationPropertiesFormatServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + self.log_specifications = kwargs.get('log_specifications', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_properties_format_service_specification_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_properties_format_service_specification_py3.py new file mode 100644 index 000000000000..bcf96531b448 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_properties_format_service_specification_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationPropertiesFormatServiceSpecification(Model): + """Specification of the service. + + :param metric_specifications: Operation service specification. + :type metric_specifications: + list[~azure.mgmt.network.v2017_11_01.models.MetricSpecification] + :param log_specifications: Operation log specification. + :type log_specifications: + list[~azure.mgmt.network.v2017_11_01.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, log_specifications=None, **kwargs) -> None: + super(OperationPropertiesFormatServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + self.log_specifications = log_specifications diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_py3.py new file mode 100644 index 000000000000..cec5ebc88202 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/operation_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Network REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.network.v2017_11_01.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param service_specification: Specification of the service. + :type service_specification: + ~azure.mgmt.network.v2017_11_01.models.OperationPropertiesFormatServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationPropertiesFormatServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/outbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/outbound_nat_rule.py index 9493ad294d8a..cc5ea3f8c672 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/outbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/outbound_nat_rule.py @@ -15,6 +15,8 @@ class OutboundNatRule(SubResource): """Outbound NAT pool of the load balancer. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param allocated_outbound_ports: The number of outbound ports to be used @@ -24,8 +26,8 @@ class OutboundNatRule(SubResource): balancer. :type frontend_ip_configurations: list[~azure.mgmt.network.v2017_11_01.models.SubResource] - :param backend_address_pool: A reference to a pool of DIPs. Outbound - traffic is randomly load balanced across IPs in the backend IPs. + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. :type backend_address_pool: ~azure.mgmt.network.v2017_11_01.models.SubResource :param provisioning_state: Gets the provisioning state of the PublicIP @@ -53,11 +55,11 @@ class OutboundNatRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, backend_address_pool, id=None, allocated_outbound_ports=None, frontend_ip_configurations=None, provisioning_state=None, name=None, etag=None): - super(OutboundNatRule, self).__init__(id=id) - self.allocated_outbound_ports = allocated_outbound_ports - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pool = backend_address_pool - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(OutboundNatRule, self).__init__(**kwargs) + self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/outbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/outbound_nat_rule_py3.py new file mode 100644 index 000000000000..4f6db2a63618 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/outbound_nat_rule_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class OutboundNatRule(SubResource): + """Outbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param allocated_outbound_ports: The number of outbound ports to be used + for NAT. + :type allocated_outbound_ports: int + :param frontend_ip_configurations: The Frontend IP addresses of the load + balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2017_11_01.models.SubResource] + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_address_pool': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, backend_address_pool, id: str=None, allocated_outbound_ports: int=None, frontend_ip_configurations=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(OutboundNatRule, self).__init__(id=id, **kwargs) + self.allocated_outbound_ports = allocated_outbound_ports + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pool = backend_address_pool + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture.py index 15f058db3525..5f9d8af144e4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture.py @@ -15,8 +15,10 @@ class PacketCapture(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCapture(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_11_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCapture(Model): 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCapture, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCapture, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_filter.py index b74b44a56c0b..356a2661fa96 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_filter.py @@ -51,10 +51,10 @@ class PacketCaptureFilter(Model): 'remote_port': {'key': 'remotePort', 'type': 'str'}, } - def __init__(self, protocol="Any", local_ip_address=None, remote_ip_address=None, local_port=None, remote_port=None): - super(PacketCaptureFilter, self).__init__() - self.protocol = protocol - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.local_port = local_port - self.remote_port = remote_port + def __init__(self, **kwargs): + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', "Any") + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_filter_py3.py new file mode 100644 index 000000000000..7bacc1df6245 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_filter_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureFilter(Model): + """Filter that is applied to packet capture request. Multiple filters can be + applied. + + :param protocol: Protocol to be filtered on. Possible values include: + 'TCP', 'UDP', 'Any'. Default value: "Any" . + :type protocol: str or ~azure.mgmt.network.v2017_11_01.models.PcProtocol + :param local_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type local_ip_address: str + :param remote_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type remote_ip_address: str + :param local_port: Local port to be filtered on. Notation: "80" for single + port entry."80-85" for range. "80;443;" for multiple entries. Multiple + ranges not currently supported. Mixing ranges with multiple entries not + currently supported. Default = null. + :type local_port: str + :param remote_port: Remote port to be filtered on. Notation: "80" for + single port entry."80-85" for range. "80;443;" for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple + entries not currently supported. Default = null. + :type remote_port: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + } + + def __init__(self, *, protocol="Any", local_ip_address: str=None, remote_ip_address: str=None, local_port: str=None, remote_port: str=None, **kwargs) -> None: + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = protocol + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.local_port = local_port + self.remote_port = remote_port diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_parameters.py index cfd2ced1aeb6..f48f8207d634 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_parameters.py @@ -15,8 +15,10 @@ class PacketCaptureParameters(Model): """Parameters that define the create packet capture operation. - :param target: The ID of the targeted resource, only VM is currently - supported. + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -27,7 +29,7 @@ class PacketCaptureParameters(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_11_01.models.PacketCaptureStorageLocation :param filters: @@ -49,11 +51,11 @@ class PacketCaptureParameters(Model): 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, } - def __init__(self, target, storage_location, bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None): - super(PacketCaptureParameters, self).__init__() - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters + def __init__(self, **kwargs): + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_parameters_py3.py new file mode 100644 index 000000000000..293a65e928a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_parameters_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureParameters(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_11_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_11_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_py3.py new file mode 100644 index 000000000000..80b6db826059 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCapture(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_11_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_11_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCapture, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_query_status_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_query_status_result.py index cc83b7c67694..786bd7726cf0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_query_status_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_query_status_result.py @@ -43,11 +43,11 @@ class PacketCaptureQueryStatusResult(Model): 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, } - def __init__(self, name=None, id=None, capture_start_time=None, packet_capture_status=None, stop_reason=None, packet_capture_error=None): - super(PacketCaptureQueryStatusResult, self).__init__() - self.name = name - self.id = id - self.capture_start_time = capture_start_time - self.packet_capture_status = packet_capture_status - self.stop_reason = stop_reason - self.packet_capture_error = packet_capture_error + def __init__(self, **kwargs): + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.capture_start_time = kwargs.get('capture_start_time', None) + self.packet_capture_status = kwargs.get('packet_capture_status', None) + self.stop_reason = kwargs.get('stop_reason', None) + self.packet_capture_error = kwargs.get('packet_capture_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_query_status_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_query_status_result_py3.py new file mode 100644 index 000000000000..02586a92fb7a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_query_status_result_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureQueryStatusResult(Model): + """Status of packet capture session. + + :param name: The name of the packet capture resource. + :type name: str + :param id: The ID of the packet capture resource. + :type id: str + :param capture_start_time: The start time of the packet capture session. + :type capture_start_time: datetime + :param packet_capture_status: The status of the packet capture session. + Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', + 'Unknown' + :type packet_capture_status: str or + ~azure.mgmt.network.v2017_11_01.models.PcStatus + :param stop_reason: The reason the current packet capture session was + stopped. + :type stop_reason: str + :param packet_capture_error: List of errors of packet capture session. + :type packet_capture_error: list[str or + ~azure.mgmt.network.v2017_11_01.models.PcError] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, + 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, + 'stop_reason': {'key': 'stopReason', 'type': 'str'}, + 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, id: str=None, capture_start_time=None, packet_capture_status=None, stop_reason: str=None, packet_capture_error=None, **kwargs) -> None: + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = name + self.id = id + self.capture_start_time = capture_start_time + self.packet_capture_status = packet_capture_status + self.stop_reason = stop_reason + self.packet_capture_error = packet_capture_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_result.py index ea843c998bf2..d43e171bc5e4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_result.py @@ -18,6 +18,8 @@ class PacketCaptureResult(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar name: Name of the packet capture session. :vartype name: str :ivar id: ID of the packet capture operation. @@ -25,8 +27,8 @@ class PacketCaptureResult(Model): :param etag: Default value: "A unique read-only string that changes whenever the resource is updated." . :type etag: str - :param target: The ID of the targeted resource, only VM is currently - supported. + :param target: Required. The ID of the targeted resource, only VM is + currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes are truncated. Default value: 0 . @@ -37,7 +39,7 @@ class PacketCaptureResult(Model): :param time_limit_in_seconds: Maximum duration of the capture session in seconds. Default value: 18000 . :type time_limit_in_seconds: int - :param storage_location: + :param storage_location: Required. :type storage_location: ~azure.mgmt.network.v2017_11_01.models.PacketCaptureStorageLocation :param filters: @@ -70,15 +72,15 @@ class PacketCaptureResult(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, target, storage_location, etag="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet=0, total_bytes_per_session=1073741824, time_limit_in_seconds=18000, filters=None, provisioning_state=None): - super(PacketCaptureResult, self).__init__() + def __init__(self, **kwargs): + super(PacketCaptureResult, self).__init__(**kwargs) self.name = None self.id = None - self.etag = etag - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters - self.provisioning_state = provisioning_state + self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_result_py3.py new file mode 100644 index 000000000000..53674dc7c601 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_result_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureResult(Model): + """Information about packet capture session. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the packet capture session. + :vartype name: str + :ivar id: ID of the packet capture operation. + :vartype id: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2017_11_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2017_11_01.models.PacketCaptureFilter] + :param provisioning_state: The provisioning state of the packet capture + session. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2017_11_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, target: str, storage_location, etag: str="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, provisioning_state=None, **kwargs) -> None: + super(PacketCaptureResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = etag + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_storage_location.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_storage_location.py index 773b04d22501..62ed83d592b3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_storage_location.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_storage_location.py @@ -35,8 +35,8 @@ class PacketCaptureStorageLocation(Model): 'file_path': {'key': 'filePath', 'type': 'str'}, } - def __init__(self, storage_id=None, storage_path=None, file_path=None): - super(PacketCaptureStorageLocation, self).__init__() - self.storage_id = storage_id - self.storage_path = storage_path - self.file_path = file_path + def __init__(self, **kwargs): + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) + self.file_path = kwargs.get('file_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_storage_location_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_storage_location_py3.py new file mode 100644 index 000000000000..6925dd4f9bdf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/packet_capture_storage_location_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureStorageLocation(Model): + """Describes the storage location for a packet capture session. + + :param storage_id: The ID of the storage account to save the packet + capture session. Required if no local file path is provided. + :type storage_id: str + :param storage_path: The URI of the storage path to save the packet + capture. Must be a well-formed URI describing the location to save the + packet capture. + :type storage_path: str + :param file_path: A valid local path on the targeting VM. Must include the + name of the capture file (*.cap). For linux virtual machine it must start + with /var/captures. Required if no storage ID is provided, otherwise + optional. + :type file_path: str + """ + + _attribute_map = { + 'storage_id': {'key': 'storageId', 'type': 'str'}, + 'storage_path': {'key': 'storagePath', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + } + + def __init__(self, *, storage_id: str=None, storage_path: str=None, file_path: str=None, **kwargs) -> None: + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = storage_id + self.storage_path = storage_path + self.file_path = file_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter.py index 378c04b6fea7..b5c4b36bc00e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter.py @@ -60,12 +60,12 @@ class PatchRouteFilter(SubResource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, rules=None, peerings=None, tags=None): - super(PatchRouteFilter, self).__init__(id=id) - self.rules = rules - self.peerings = peerings + def __init__(self, **kwargs): + super(PatchRouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.peerings = kwargs.get('peerings', None) self.provisioning_state = None self.name = None self.etag = None self.type = None - self.tags = tags + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter_py3.py new file mode 100644 index 000000000000..1354226d050d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilter(SubResource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2017_11_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, rules=None, peerings=None, tags=None, **kwargs) -> None: + super(PatchRouteFilter, self).__init__(id=id, **kwargs) + self.rules = rules + self.peerings = peerings + self.provisioning_state = None + self.name = None + self.etag = None + self.type = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter_rule.py index cfab772335cf..f91bac2a478f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter_rule.py @@ -18,16 +18,18 @@ class PatchRouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2017_11_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -38,8 +40,6 @@ class PatchRouteFilterRule(SubResource): :ivar etag: A unique read-only string that changes whenever the resource is updated. :vartype etag: str - :param tags: Resource tags. - :type tags: dict[str, str] """ _validation = { @@ -59,16 +59,14 @@ class PatchRouteFilterRule(SubResource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, } route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, tags=None): - super(PatchRouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(PatchRouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None self.name = None self.etag = None - self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter_rule_py3.py new file mode 100644 index 000000000000..bc4052e802dd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/patch_route_filter_rule_py3.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_11_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, **kwargs) -> None: + super(PatchRouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/probe.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/probe.py index c8298581dc4f..b2c40fcf5d54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/probe.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/probe.py @@ -18,20 +18,22 @@ class Probe(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar load_balancing_rules: The load balancer rules that use this probe. :vartype load_balancing_rules: list[~azure.mgmt.network.v2017_11_01.models.SubResource] - :param protocol: The protocol of the end point. Possible values are: - 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required for the - probe to be successful. If 'Http' is specified, a 200 OK response from the - specifies URI is required for the probe to be successful. Possible values - include: 'Http', 'Tcp' + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' :type protocol: str or ~azure.mgmt.network.v2017_11_01.models.ProbeProtocol - :param port: The port for communicating the probe. Possible values range - from 1 to 65535, inclusive. + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. :type port: int :param interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is @@ -78,14 +80,14 @@ class Probe(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, port, id=None, interval_in_seconds=None, number_of_probes=None, request_path=None, provisioning_state=None, name=None, etag=None): - super(Probe, self).__init__(id=id) + def __init__(self, **kwargs): + super(Probe, self).__init__(**kwargs) self.load_balancing_rules = None - self.protocol = protocol - self.port = port - self.interval_in_seconds = interval_in_seconds - self.number_of_probes = number_of_probes - self.request_path = request_path - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.protocol = kwargs.get('protocol', None) + self.port = kwargs.get('port', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.number_of_probes = kwargs.get('number_of_probes', None) + self.request_path = kwargs.get('request_path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/probe_py3.py new file mode 100644 index 000000000000..51304f2df5d7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Probe(SubResource): + """A load balancer probe. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar load_balancing_rules: The load balancer rules that use this probe. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2017_11_01.models.SubResource] + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2017_11_01.models.ProbeProtocol + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. + :type port: int + :param interval_in_seconds: The interval, in seconds, for how frequently + to probe the endpoint for health status. Typically, the interval is + slightly less than half the allocated timeout period (in seconds) which + allows two full probes before taking the instance out of rotation. The + default value is 15, the minimum value is 5. + :type interval_in_seconds: int + :param number_of_probes: The number of probes where if no response, will + result in stopping further traffic from being delivered to the endpoint. + This values allows endpoints to be taken out of rotation faster or slower + than the typical times used in Azure. + :type number_of_probes: int + :param request_path: The URI used for requesting health status from the + VM. Path is required if a protocol is set to http. Otherwise, it is not + allowed. There is no default value. + :type request_path: str + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'load_balancing_rules': {'readonly': True}, + 'protocol': {'required': True}, + 'port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, + 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, port: int, id: str=None, interval_in_seconds: int=None, number_of_probes: int=None, request_path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Probe, self).__init__(id=id, **kwargs) + self.load_balancing_rules = None + self.protocol = protocol + self.port = port + self.interval_in_seconds = interval_in_seconds + self.number_of_probes = number_of_probes + self.request_path = request_path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address.py index 20eb8491678c..3efb82d0fa82 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address.py @@ -94,17 +94,17 @@ class PublicIPAddress(Resource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, id=None, location=None, tags=None, sku=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_tags=None, ip_address=None, idle_timeout_in_minutes=None, resource_guid=None, provisioning_state=None, etag=None, zones=None): - super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags) - self.sku = sku - self.public_ip_allocation_method = public_ip_allocation_method - self.public_ip_address_version = public_ip_address_version + def __init__(self, **kwargs): + super(PublicIPAddress, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) + self.public_ip_address_version = kwargs.get('public_ip_address_version', None) self.ip_configuration = None - self.dns_settings = dns_settings - self.ip_tags = ip_tags - self.ip_address = ip_address - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.etag = etag - self.zones = zones + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_tags = kwargs.get('ip_tags', None) + self.ip_address = kwargs.get('ip_address', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_dns_settings.py index a248461f05d7..07dfe30433a6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_dns_settings.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_dns_settings.py @@ -38,8 +38,8 @@ class PublicIPAddressDnsSettings(Model): 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, } - def __init__(self, domain_name_label=None, fqdn=None, reverse_fqdn=None): - super(PublicIPAddressDnsSettings, self).__init__() - self.domain_name_label = domain_name_label - self.fqdn = fqdn - self.reverse_fqdn = reverse_fqdn + def __init__(self, **kwargs): + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) + self.fqdn = kwargs.get('fqdn', None) + self.reverse_fqdn = kwargs.get('reverse_fqdn', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_dns_settings_py3.py new file mode 100644 index 000000000000..e84aa9c10bf5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_dns_settings_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressDnsSettings(Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :param domain_name_label: Gets or sets the Domain name label.The + concatenation of the domain name label and the regionalized DNS zone make + up the fully qualified domain name associated with the public IP address. + If a domain name label is specified, an A DNS record is created for the + public IP in the Microsoft Azure DNS system. + :type domain_name_label: str + :param fqdn: Gets the FQDN, Fully qualified domain name of the A DNS + record associated with the public IP. This is the concatenation of the + domainNameLabel and the regionalized DNS zone. + :type fqdn: str + :param reverse_fqdn: Gets or Sets the Reverse FQDN. A user-visible, fully + qualified domain name that resolves to this public IP address. If the + reverseFqdn is specified, then a PTR DNS record is created pointing from + the IP address in the in-addr.arpa domain to the reverse FQDN. + :type reverse_fqdn: str + """ + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, + } + + def __init__(self, *, domain_name_label: str=None, fqdn: str=None, reverse_fqdn: str=None, **kwargs) -> None: + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label + self.fqdn = fqdn + self.reverse_fqdn = reverse_fqdn diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_py3.py new file mode 100644 index 000000000000..699532593e2d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_py3.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PublicIPAddress(Resource): + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The public IP address SKU. + :type sku: ~azure.mgmt.network.v2017_11_01.models.PublicIPAddressSku + :param public_ip_allocation_method: The public IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type public_ip_allocation_method: str or + ~azure.mgmt.network.v2017_11_01.models.IPAllocationMethod + :param public_ip_address_version: The public IP address version. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + :type public_ip_address_version: str or + ~azure.mgmt.network.v2017_11_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP + address. + :vartype ip_configuration: + ~azure.mgmt.network.v2017_11_01.models.IPConfiguration + :param dns_settings: The FQDN of the DNS record associated with the public + IP address. + :type dns_settings: + ~azure.mgmt.network.v2017_11_01.models.PublicIPAddressDnsSettings + :param ip_tags: The list of tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.network.v2017_11_01.models.IpTag] + :param ip_address: The IP address associated with the public IP address + resource. + :type ip_address: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param resource_guid: The resource GUID property of the public IP + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, + 'ip_tags': {'key': 'properties.ipTags', 'type': '[IpTag]'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_tags=None, ip_address: str=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, zones=None, **kwargs) -> None: + super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.public_ip_allocation_method = public_ip_allocation_method + self.public_ip_address_version = public_ip_address_version + self.ip_configuration = None + self.dns_settings = dns_settings + self.ip_tags = ip_tags + self.ip_address = ip_address + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag + self.zones = zones diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_sku.py index 3a3b8e2c69e5..591823033f01 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_sku.py @@ -25,6 +25,6 @@ class PublicIPAddressSku(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - super(PublicIPAddressSku, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_sku_py3.py new file mode 100644 index 000000000000..99b0c0bfb6ae --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/public_ip_address_sku_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressSku(Model): + """SKU of a public IP address. + + :param name: Name of a public IP address SKU. Possible values include: + 'Basic', 'Standard' + :type name: str or + ~azure.mgmt.network.v2017_11_01.models.PublicIPAddressSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/query_troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/query_troubleshooting_parameters.py index 9b6801eb7b63..6ae1924916c6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/query_troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/query_troubleshooting_parameters.py @@ -15,7 +15,9 @@ class QueryTroubleshootingParameters(Model): """Parameters that define the resource to query the troubleshooting result. - :param target_resource_id: The target resource ID to query the + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the troubleshooting result. :type target_resource_id: str """ @@ -28,6 +30,6 @@ class QueryTroubleshootingParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(QueryTroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/query_troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/query_troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..b5fccb87857c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/query_troubleshooting_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryTroubleshootingParameters(Model): + """Parameters that define the resource to query the troubleshooting result. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the + troubleshooting result. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource.py index ff5f1f40e14e..7dabab29ac9d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource.py @@ -43,10 +43,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, id=None, location=None, tags=None): - super(Resource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource_navigation_link.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource_navigation_link.py index 9b4484be654a..705698f513f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource_navigation_link.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource_navigation_link.py @@ -49,10 +49,10 @@ class ResourceNavigationLink(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, linked_resource_type=None, link=None, name=None): - super(ResourceNavigationLink, self).__init__(id=id) - self.linked_resource_type = linked_resource_type - self.link = link + def __init__(self, **kwargs): + super(ResourceNavigationLink, self).__init__(**kwargs) + self.linked_resource_type = kwargs.get('linked_resource_type', None) + self.link = kwargs.get('link', None) self.provisioning_state = None - self.name = name + self.name = kwargs.get('name', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource_navigation_link_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource_navigation_link_py3.py new file mode 100644 index 000000000000..5cb22d347836 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource_navigation_link_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ResourceNavigationLink(SubResource): + """ResourceNavigationLink resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource + :type link: str + :ivar provisioning_state: Provisioning state of the ResourceNavigationLink + resource. + :vartype provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, linked_resource_type: str=None, link: str=None, name: str=None, **kwargs) -> None: + super(ResourceNavigationLink, self).__init__(id=id, **kwargs) + self.linked_resource_type = linked_resource_type + self.link = link + self.provisioning_state = None + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource_py3.py new file mode 100644 index 000000000000..ae95b78b4f23 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/resource_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Common resource representation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/retention_policy_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/retention_policy_parameters.py index 102f4c5c3b4c..28cb43056d47 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/retention_policy_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/retention_policy_parameters.py @@ -26,7 +26,7 @@ class RetentionPolicyParameters(Model): 'enabled': {'key': 'enabled', 'type': 'bool'}, } - def __init__(self, days=0, enabled=False): - super(RetentionPolicyParameters, self).__init__() - self.days = days - self.enabled = enabled + def __init__(self, **kwargs): + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = kwargs.get('days', 0) + self.enabled = kwargs.get('enabled', False) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/retention_policy_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/retention_policy_parameters_py3.py new file mode 100644 index 000000000000..3b2ffc5e741e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/retention_policy_parameters_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RetentionPolicyParameters(Model): + """Parameters that define the retention policy for flow log. + + :param days: Number of days to retain flow log records. Default value: 0 . + :type days: int + :param enabled: Flag to enable/disable retention. Default value: False . + :type enabled: bool + """ + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, days: int=0, enabled: bool=False, **kwargs) -> None: + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = days + self.enabled = enabled diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route.py index c735c60857b3..5eb9fbb74e12 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route.py @@ -15,13 +15,15 @@ class Route(SubResource): """Route resource. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param address_prefix: The destination CIDR to which the route applies. :type address_prefix: str - :param next_hop_type: The type of Azure hop the packet should be sent to. - Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - 'VirtualAppliance', and 'None'. Possible values include: + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' :type next_hop_type: str or @@ -55,11 +57,11 @@ class Route(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, next_hop_type, id=None, address_prefix=None, next_hop_ip_address=None, provisioning_state=None, name=None, etag=None): - super(Route, self).__init__(id=id) - self.address_prefix = address_prefix - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(Route, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter.py index 9b09ead896eb..7bef856349df 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter.py @@ -62,9 +62,9 @@ class RouteFilter(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, rules=None, peerings=None): - super(RouteFilter, self).__init__(id=id, location=location, tags=tags) - self.rules = rules - self.peerings = peerings + def __init__(self, **kwargs): + super(RouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.peerings = kwargs.get('peerings', None) self.provisioning_state = None self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter_py3.py new file mode 100644 index 000000000000..65edfdcb4f08 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteFilter(Resource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2017_11_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, rules=None, peerings=None, **kwargs) -> None: + super(RouteFilter, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.rules = rules + self.peerings = peerings + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter_rule.py index a8253fc60c47..4dd12c96a874 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter_rule.py @@ -18,16 +18,18 @@ class RouteFilterRule(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param access: The access type of the rule. Valid values are: 'Allow', - 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' :type access: str or ~azure.mgmt.network.v2017_11_01.models.Access - :ivar route_filter_rule_type: The rule type of the rule. Valid value is: - 'Community'. Default value: "Community" . + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . :vartype route_filter_rule_type: str - :param communities: The collection for bgp community values to filter on. - e.g. ['12076:5010','12076:5020'] + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] :type communities: list[str] :ivar provisioning_state: The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. @@ -40,8 +42,6 @@ class RouteFilterRule(SubResource): :ivar etag: A unique read-only string that changes whenever the resource is updated. :vartype etag: str - :param tags: Resource tags. - :type tags: dict[str, str] """ _validation = { @@ -61,17 +61,15 @@ class RouteFilterRule(SubResource): 'name': {'key': 'name', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, } route_filter_rule_type = "Community" - def __init__(self, access, communities, id=None, name=None, location=None, tags=None): - super(RouteFilterRule, self).__init__(id=id) - self.access = access - self.communities = communities + def __init__(self, **kwargs): + super(RouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) self.provisioning_state = None - self.name = name - self.location = location + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) self.etag = None - self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter_rule_py3.py new file mode 100644 index 000000000000..87d24b2569b0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_filter_rule_py3.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class RouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_11_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param location: Resource location. + :type location: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, name: str=None, location: str=None, **kwargs) -> None: + super(RouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = name + self.location = location + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_py3.py new file mode 100644 index 000000000000..fbbd629711f4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Route(SubResource): + """Route resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param address_prefix: The destination CIDR to which the route applies. + :type address_prefix: str + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2017_11_01.models.RouteNextHopType + :param next_hop_ip_address: The IP address packets should be forwarded to. + Next hop values are only allowed in routes where the next hop type is + VirtualAppliance. + :type next_hop_ip_address: str + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'next_hop_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type, id: str=None, address_prefix: str=None, next_hop_ip_address: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Route, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_table.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_table.py index fa02aba77b89..094f73fd974e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_table.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_table.py @@ -62,10 +62,10 @@ class RouteTable(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, routes=None, disable_bgp_route_propagation=None, provisioning_state=None, etag=None): - super(RouteTable, self).__init__(id=id, location=location, tags=tags) - self.routes = routes + def __init__(self, **kwargs): + super(RouteTable, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) self.subnets = None - self.disable_bgp_route_propagation = disable_bgp_route_propagation - self.provisioning_state = provisioning_state - self.etag = etag + self.disable_bgp_route_propagation = kwargs.get('disable_bgp_route_propagation', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_table_py3.py new file mode 100644 index 000000000000..2716013ebff9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/route_table_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteTable(Resource): + """Route table resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param routes: Collection of routes contained within a route table. + :type routes: list[~azure.mgmt.network.v2017_11_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2017_11_01.models.Subnet] + :param disable_bgp_route_propagation: Gets or sets whether to disable the + routes learned by BGP on that route table. True means disable. + :type disable_bgp_route_propagation: bool + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'routes': {'key': 'properties.routes', 'type': '[Route]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'disable_bgp_route_propagation': {'key': 'properties.disableBgpRoutePropagation', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, routes=None, disable_bgp_route_propagation: bool=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(RouteTable, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.routes = routes + self.subnets = None + self.disable_bgp_route_propagation = disable_bgp_route_propagation + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_network_interface.py index 13563f8e2cab..afda74414e0a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_network_interface.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_network_interface.py @@ -27,7 +27,7 @@ class SecurityGroupNetworkInterface(Model): 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, } - def __init__(self, id=None, security_rule_associations=None): - super(SecurityGroupNetworkInterface, self).__init__() - self.id = id - self.security_rule_associations = security_rule_associations + def __init__(self, **kwargs): + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.security_rule_associations = kwargs.get('security_rule_associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_network_interface_py3.py new file mode 100644 index 000000000000..4ab6dd998cb5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_network_interface_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupNetworkInterface(Model): + """Network interface and all its associated security rules. + + :param id: ID of the network interface. + :type id: str + :param security_rule_associations: + :type security_rule_associations: + ~azure.mgmt.network.v2017_11_01.models.SecurityRuleAssociations + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, + } + + def __init__(self, *, id: str=None, security_rule_associations=None, **kwargs) -> None: + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = id + self.security_rule_associations = security_rule_associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_parameters.py index 5c0972e5d55e..1d547b0b0e2b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_parameters.py @@ -15,7 +15,9 @@ class SecurityGroupViewParameters(Model): """Parameters that define the VM to check security groups for. - :param target_resource_id: ID of the target VM. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. :type target_resource_id: str """ @@ -27,6 +29,6 @@ class SecurityGroupViewParameters(Model): 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id): - super(SecurityGroupViewParameters, self).__init__() - self.target_resource_id = target_resource_id + def __init__(self, **kwargs): + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_parameters_py3.py new file mode 100644 index 000000000000..7ccc48017444 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_parameters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewParameters(Model): + """Parameters that define the VM to check security groups for. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_result.py index c8598ec7f557..659e71ab1c60 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_result.py @@ -24,6 +24,6 @@ class SecurityGroupViewResult(Model): 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, } - def __init__(self, network_interfaces=None): - super(SecurityGroupViewResult, self).__init__() - self.network_interfaces = network_interfaces + def __init__(self, **kwargs): + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_result_py3.py new file mode 100644 index 000000000000..5f1f6e189193 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_group_view_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewResult(Model): + """The information about security rules applied to the specified VM. + + :param network_interfaces: List of network interfaces on the specified VM. + :type network_interfaces: + list[~azure.mgmt.network.v2017_11_01.models.SecurityGroupNetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule.py index 7e64f6ff4b06..234e88a7e698 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule.py @@ -15,12 +15,15 @@ class SecurityRule(SubResource): """Network security rule. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :param description: A description for this rule. Restricted to 140 chars. :type description: str - :param protocol: Network protocol this rule applies to. Possible values - are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*' + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' :type protocol: str or ~azure.mgmt.network.v2017_11_01.models.SecurityRuleProtocol :param source_port_range: The source port or range. Integer or range @@ -57,8 +60,9 @@ class SecurityRule(SubResource): :type source_port_ranges: list[str] :param destination_port_ranges: The destination port ranges. :type destination_port_ranges: list[str] - :param access: The network traffic is allowed or denied. Possible values - are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' :type access: str or ~azure.mgmt.network.v2017_11_01.models.SecurityRuleAccess :param priority: The priority of the rule. The value can be between 100 @@ -66,10 +70,10 @@ class SecurityRule(SubResource): collection. The lower the priority number, the higher the priority of the rule. :type priority: int - :param direction: The direction of the rule. The direction specifies if - rule will be evaluated on incoming or outcoming traffic. Possible values - are: 'Inbound' and 'Outbound'. Possible values include: 'Inbound', - 'Outbound' + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2017_11_01.models.SecurityRuleDirection :param provisioning_state: The provisioning state of the public IP @@ -111,23 +115,23 @@ class SecurityRule(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, protocol, source_address_prefix=None, destination_address_prefix=None, access=None, direction=None, id=None, description=None, source_port_range=None, destination_port_range=None, source_address_prefixes=None, source_application_security_groups=None, destination_address_prefixes=None, destination_application_security_groups=None, source_port_ranges=None, destination_port_ranges=None, priority=None, provisioning_state=None, name=None, etag=None): - super(SecurityRule, self).__init__(id=id) - self.description = description - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_address_prefix = source_address_prefix - self.source_address_prefixes = source_address_prefixes - self.source_application_security_groups = source_application_security_groups - self.destination_address_prefix = destination_address_prefix - self.destination_address_prefixes = destination_address_prefixes - self.destination_application_security_groups = destination_application_security_groups - self.source_port_ranges = source_port_ranges - self.destination_port_ranges = destination_port_ranges - self.access = access - self.priority = priority - self.direction = direction - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(SecurityRule, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.source_application_security_groups = kwargs.get('source_application_security_groups', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.destination_application_security_groups = kwargs.get('destination_application_security_groups', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule_associations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule_associations.py index 9ade4c0403b2..f1aae8ec969e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule_associations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule_associations.py @@ -37,9 +37,9 @@ class SecurityRuleAssociations(Model): 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, } - def __init__(self, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None): - super(SecurityRuleAssociations, self).__init__() - self.network_interface_association = network_interface_association - self.subnet_association = subnet_association - self.default_security_rules = default_security_rules - self.effective_security_rules = effective_security_rules + def __init__(self, **kwargs): + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = kwargs.get('network_interface_association', None) + self.subnet_association = kwargs.get('subnet_association', None) + self.default_security_rules = kwargs.get('default_security_rules', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule_associations_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule_associations_py3.py new file mode 100644 index 000000000000..9e5be5698d83 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule_associations_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityRuleAssociations(Model): + """All security rules associated with the network interface. + + :param network_interface_association: + :type network_interface_association: + ~azure.mgmt.network.v2017_11_01.models.NetworkInterfaceAssociation + :param subnet_association: + :type subnet_association: + ~azure.mgmt.network.v2017_11_01.models.SubnetAssociation + :param default_security_rules: Collection of default security rules of the + network security group. + :type default_security_rules: + list[~azure.mgmt.network.v2017_11_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2017_11_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, + 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, + 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__(self, *, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None, **kwargs) -> None: + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = network_interface_association + self.subnet_association = subnet_association + self.default_security_rules = default_security_rules + self.effective_security_rules = effective_security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule_py3.py new file mode 100644 index 000000000000..c45066131e53 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/security_rule_py3.py @@ -0,0 +1,137 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class SecurityRule(SubResource): + """Network security rule. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2017_11_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. Integer or range + between 0 and 65535. Asterix '*' can also be used to match all ports. + :type source_port_range: str + :param destination_port_range: The destination port or range. Integer or + range between 0 and 65535. Asterix '*' can also be used to match all + ports. + :type destination_port_range: str + :param source_address_prefix: The CIDR or source IP range. Asterix '*' can + also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + this is an ingress rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param source_address_prefixes: The CIDR or source IP ranges. + :type source_address_prefixes: list[str] + :param source_application_security_groups: The application security group + specified as source. + :type source_application_security_groups: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroup] + :param destination_address_prefix: The destination address prefix. CIDR or + destination IP range. Asterix '*' can also be used to match all source + IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. + :type destination_address_prefix: str + :param destination_address_prefixes: The destination address prefixes. + CIDR or destination IP ranges. + :type destination_address_prefixes: list[str] + :param destination_application_security_groups: The application security + group specified as destination. + :type destination_application_security_groups: + list[~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroup] + :param source_port_ranges: The source port ranges. + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. + :type destination_port_ranges: list[str] + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' + :type access: str or + ~azure.mgmt.network.v2017_11_01.models.SecurityRuleAccess + :param priority: The priority of the rule. The value can be between 100 + and 4096. The priority number must be unique for each rule in the + collection. The lower the priority number, the higher the priority of the + rule. + :type priority: int + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2017_11_01.models.SecurityRuleDirection + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'access': {'required': True}, + 'direction': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'properties.sourceAddressPrefixes', 'type': '[str]'}, + 'source_application_security_groups': {'key': 'properties.sourceApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, + 'destination_address_prefixes': {'key': 'properties.destinationAddressPrefixes', 'type': '[str]'}, + 'destination_application_security_groups': {'key': 'properties.destinationApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'source_port_ranges': {'key': 'properties.sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'properties.destinationPortRanges', 'type': '[str]'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, access, direction, id: str=None, description: str=None, source_port_range: str=None, destination_port_range: str=None, source_address_prefix: str=None, source_address_prefixes=None, source_application_security_groups=None, destination_address_prefix: str=None, destination_address_prefixes=None, destination_application_security_groups=None, source_port_ranges=None, destination_port_ranges=None, priority: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(SecurityRule, self).__init__(id=id, **kwargs) + self.description = description + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.source_address_prefixes = source_address_prefixes + self.source_application_security_groups = source_application_security_groups + self.destination_address_prefix = destination_address_prefix + self.destination_address_prefixes = destination_address_prefixes + self.destination_application_security_groups = destination_application_security_groups + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/service_endpoint_properties_format.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/service_endpoint_properties_format.py index 847cb9ac8b3b..87ca01e64540 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/service_endpoint_properties_format.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/service_endpoint_properties_format.py @@ -29,8 +29,8 @@ class ServiceEndpointPropertiesFormat(Model): 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } - def __init__(self, service=None, locations=None, provisioning_state=None): - super(ServiceEndpointPropertiesFormat, self).__init__() - self.service = service - self.locations = locations - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = kwargs.get('service', None) + self.locations = kwargs.get('locations', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/service_endpoint_properties_format_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/service_endpoint_properties_format_py3.py new file mode 100644 index 000000000000..8d3d2e5e8347 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/service_endpoint_properties_format_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceEndpointPropertiesFormat(Model): + """The service endpoint properties. + + :param service: The type of the endpoint service. + :type service: str + :param locations: A list of locations. + :type locations: list[str] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + """ + + _attribute_map = { + 'service': {'key': 'service', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, service: str=None, locations=None, provisioning_state: str=None, **kwargs) -> None: + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = service + self.locations = locations + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/sub_resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/sub_resource.py index 491f1d1caf83..6ab81f55f21b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/sub_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/sub_resource.py @@ -23,6 +23,6 @@ class SubResource(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id=None): - super(SubResource, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/sub_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/sub_resource_py3.py new file mode 100644 index 000000000000..8f4c4c816061 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """Reference to another subresource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet.py index 87bbc5e098d0..5bb75977cae2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet.py @@ -66,14 +66,14 @@ class Subnet(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, address_prefix=None, network_security_group=None, route_table=None, service_endpoints=None, resource_navigation_links=None, provisioning_state=None, name=None, etag=None): - super(Subnet, self).__init__(id=id) - self.address_prefix = address_prefix - self.network_security_group = network_security_group - self.route_table = route_table - self.service_endpoints = service_endpoints + def __init__(self, **kwargs): + super(Subnet, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.route_table = kwargs.get('route_table', None) + self.service_endpoints = kwargs.get('service_endpoints', None) self.ip_configurations = None - self.resource_navigation_links = resource_navigation_links - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + self.resource_navigation_links = kwargs.get('resource_navigation_links', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet_association.py index 3365de9efb1f..6969144447e2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet_association.py @@ -34,7 +34,7 @@ class SubnetAssociation(Model): 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, } - def __init__(self, security_rules=None): - super(SubnetAssociation, self).__init__() + def __init__(self, **kwargs): + super(SubnetAssociation, self).__init__(**kwargs) self.id = None - self.security_rules = security_rules + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet_association_py3.py new file mode 100644 index 000000000000..1d0d57dfdcd8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Subnet ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2017_11_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(SubnetAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet_py3.py new file mode 100644 index 000000000000..371823b09364 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/subnet_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Subnet(SubResource): + """Subnet in a virtual network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param address_prefix: The address prefix for the subnet. + :type address_prefix: str + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroup + :param route_table: The reference of the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2017_11_01.models.RouteTable + :param service_endpoints: An array of service endpoints. + :type service_endpoints: + list[~azure.mgmt.network.v2017_11_01.models.ServiceEndpointPropertiesFormat] + :ivar ip_configurations: Gets an array of references to the network + interface IP configurations using subnet. + :vartype ip_configurations: + list[~azure.mgmt.network.v2017_11_01.models.IPConfiguration] + :param resource_navigation_links: Gets an array of references to the + external resources using subnet. + :type resource_navigation_links: + list[~azure.mgmt.network.v2017_11_01.models.ResourceNavigationLink] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'ip_configurations': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, + 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, address_prefix: str=None, network_security_group=None, route_table=None, service_endpoints=None, resource_navigation_links=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Subnet, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.network_security_group = network_security_group + self.route_table = route_table + self.service_endpoints = service_endpoints + self.ip_configurations = None + self.resource_navigation_links = resource_navigation_links + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tags_object.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tags_object.py index 539129368be9..2966ec220f94 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tags_object.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tags_object.py @@ -23,6 +23,6 @@ class TagsObject(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, tags=None): - super(TagsObject, self).__init__() - self.tags = tags + def __init__(self, **kwargs): + super(TagsObject, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tags_object_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tags_object_py3.py new file mode 100644 index 000000000000..8be0bb4a15d7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tags_object_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagsObject(Model): + """Tags object for patch operations. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsObject, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology.py index cf08cec8edaa..d7d4e3d6b3ef 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology.py @@ -43,9 +43,9 @@ class Topology(Model): 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, } - def __init__(self, resources=None): - super(Topology, self).__init__() + def __init__(self, **kwargs): + super(Topology, self).__init__(**kwargs) self.id = None self.created_date_time = None self.last_modified = None - self.resources = resources + self.resources = kwargs.get('resources', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_association.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_association.py index 81faa837cd64..f24c9ea17ff6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_association.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_association.py @@ -33,8 +33,8 @@ class TopologyAssociation(Model): 'association_type': {'key': 'associationType', 'type': 'str'}, } - def __init__(self, name=None, resource_id=None, association_type=None): - super(TopologyAssociation, self).__init__() - self.name = name - self.resource_id = resource_id - self.association_type = association_type + def __init__(self, **kwargs): + super(TopologyAssociation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.resource_id = kwargs.get('resource_id', None) + self.association_type = kwargs.get('association_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_association_py3.py new file mode 100644 index 000000000000..3bfdb2cd231a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyAssociation(Model): + """Resources that have an association with the parent resource. + + :param name: The name of the resource that is associated with the parent + resource. + :type name: str + :param resource_id: The ID of the resource that is associated with the + parent resource. + :type resource_id: str + :param association_type: The association type of the child resource to the + parent resource. Possible values include: 'Associated', 'Contains' + :type association_type: str or + ~azure.mgmt.network.v2017_11_01.models.AssociationType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'association_type': {'key': 'associationType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, resource_id: str=None, association_type=None, **kwargs) -> None: + super(TopologyAssociation, self).__init__(**kwargs) + self.name = name + self.resource_id = resource_id + self.association_type = association_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_parameters.py index f16a3e1daa33..d14b3dc9bfd6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_parameters.py @@ -32,8 +32,8 @@ class TopologyParameters(Model): 'target_subnet': {'key': 'targetSubnet', 'type': 'SubResource'}, } - def __init__(self, target_resource_group_name=None, target_virtual_network=None, target_subnet=None): - super(TopologyParameters, self).__init__() - self.target_resource_group_name = target_resource_group_name - self.target_virtual_network = target_virtual_network - self.target_subnet = target_subnet + def __init__(self, **kwargs): + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = kwargs.get('target_resource_group_name', None) + self.target_virtual_network = kwargs.get('target_virtual_network', None) + self.target_subnet = kwargs.get('target_subnet', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_parameters_py3.py new file mode 100644 index 000000000000..25dae4312613 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_parameters_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyParameters(Model): + """Parameters that define the representation of topology. + + :param target_resource_group_name: The name of the target resource group + to perform topology on. + :type target_resource_group_name: str + :param target_virtual_network: The reference of the Virtual Network + resource. + :type target_virtual_network: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param target_subnet: The reference of the Subnet resource. + :type target_subnet: ~azure.mgmt.network.v2017_11_01.models.SubResource + """ + + _attribute_map = { + 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, + 'target_virtual_network': {'key': 'targetVirtualNetwork', 'type': 'SubResource'}, + 'target_subnet': {'key': 'targetSubnet', 'type': 'SubResource'}, + } + + def __init__(self, *, target_resource_group_name: str=None, target_virtual_network=None, target_subnet=None, **kwargs) -> None: + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = target_resource_group_name + self.target_virtual_network = target_virtual_network + self.target_subnet = target_subnet diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_py3.py new file mode 100644 index 000000000000..353c63765acd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Topology(Model): + """Topology of the specified resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: GUID representing the operation id. + :vartype id: str + :ivar created_date_time: The datetime when the topology was initially + created for the resource group. + :vartype created_date_time: datetime + :ivar last_modified: The datetime when the topology was last modified. + :vartype last_modified: datetime + :param resources: + :type resources: + list[~azure.mgmt.network.v2017_11_01.models.TopologyResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, + } + + def __init__(self, *, resources=None, **kwargs) -> None: + super(Topology, self).__init__(**kwargs) + self.id = None + self.created_date_time = None + self.last_modified = None + self.resources = resources diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_resource.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_resource.py index abe8bcb95eff..ff79c1a88f13 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_resource.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_resource.py @@ -34,9 +34,9 @@ class TopologyResource(Model): 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, } - def __init__(self, name=None, id=None, location=None, associations=None): - super(TopologyResource, self).__init__() - self.name = name - self.id = id - self.location = location - self.associations = associations + def __init__(self, **kwargs): + super(TopologyResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.associations = kwargs.get('associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_resource_py3.py new file mode 100644 index 000000000000..953e7b85e7e4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/topology_resource_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyResource(Model): + """The network resource topology information for the given resource group. + + :param name: Name of the resource. + :type name: str + :param id: ID of the resource. + :type id: str + :param location: Resource location. + :type location: str + :param associations: Holds the associations the resource has with other + resources in the resource group. + :type associations: + list[~azure.mgmt.network.v2017_11_01.models.TopologyAssociation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, + } + + def __init__(self, *, name: str=None, id: str=None, location: str=None, associations=None, **kwargs) -> None: + super(TopologyResource, self).__init__(**kwargs) + self.name = name + self.id = id + self.location = location + self.associations = associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_details.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_details.py index eb8407b171de..baf9e557960e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_details.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_details.py @@ -36,10 +36,10 @@ class TroubleshootingDetails(Model): 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, } - def __init__(self, id=None, reason_type=None, summary=None, detail=None, recommended_actions=None): - super(TroubleshootingDetails, self).__init__() - self.id = id - self.reason_type = reason_type - self.summary = summary - self.detail = detail - self.recommended_actions = recommended_actions + def __init__(self, **kwargs): + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.reason_type = kwargs.get('reason_type', None) + self.summary = kwargs.get('summary', None) + self.detail = kwargs.get('detail', None) + self.recommended_actions = kwargs.get('recommended_actions', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_details_py3.py new file mode 100644 index 000000000000..a9c01a31488f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_details_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingDetails(Model): + """Information gained from troubleshooting of specified resource. + + :param id: The id of the get troubleshoot operation. + :type id: str + :param reason_type: Reason type of failure. + :type reason_type: str + :param summary: A summary of troubleshooting. + :type summary: str + :param detail: Details on troubleshooting results. + :type detail: str + :param recommended_actions: List of recommended actions. + :type recommended_actions: + list[~azure.mgmt.network.v2017_11_01.models.TroubleshootingRecommendedActions] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'reason_type': {'key': 'reasonType', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'detail': {'key': 'detail', 'type': 'str'}, + 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, + } + + def __init__(self, *, id: str=None, reason_type: str=None, summary: str=None, detail: str=None, recommended_actions=None, **kwargs) -> None: + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = id + self.reason_type = reason_type + self.summary = summary + self.detail = detail + self.recommended_actions = recommended_actions diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_parameters.py index c4833fb8eeb3..6b11d3eb5ffc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_parameters.py @@ -15,13 +15,15 @@ class TroubleshootingParameters(Model): """Parameters that define the resource to troubleshoot. - :param target_resource_id: The target resource to troubleshoot. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. :type target_resource_id: str - :param storage_id: The ID for the storage account to save the troubleshoot - result. + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. :type storage_id: str - :param storage_path: The path to the blob to save the troubleshoot result - in. + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. :type storage_path: str """ @@ -37,8 +39,8 @@ class TroubleshootingParameters(Model): 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, } - def __init__(self, target_resource_id, storage_id, storage_path): - super(TroubleshootingParameters, self).__init__() - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.storage_path = storage_path + def __init__(self, **kwargs): + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..e010b7bdc9de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_parameters_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingParameters(Model): + """Parameters that define the resource to troubleshoot. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. + :type target_resource_id: str + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. + :type storage_id: str + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. + :type storage_path: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'storage_path': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, storage_path: str, **kwargs) -> None: + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.storage_path = storage_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_recommended_actions.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_recommended_actions.py index cbc5e31177c7..be395be4ad54 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_recommended_actions.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_recommended_actions.py @@ -34,9 +34,9 @@ class TroubleshootingRecommendedActions(Model): 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, } - def __init__(self, action_id=None, action_text=None, action_uri=None, action_uri_text=None): - super(TroubleshootingRecommendedActions, self).__init__() - self.action_id = action_id - self.action_text = action_text - self.action_uri = action_uri - self.action_uri_text = action_uri_text + def __init__(self, **kwargs): + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = kwargs.get('action_id', None) + self.action_text = kwargs.get('action_text', None) + self.action_uri = kwargs.get('action_uri', None) + self.action_uri_text = kwargs.get('action_uri_text', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_recommended_actions_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_recommended_actions_py3.py new file mode 100644 index 000000000000..05c3f654353b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_recommended_actions_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingRecommendedActions(Model): + """Recommended actions based on discovered issues. + + :param action_id: ID of the recommended action. + :type action_id: str + :param action_text: Description of recommended actions. + :type action_text: str + :param action_uri: The uri linking to a documentation for the recommended + troubleshooting actions. + :type action_uri: str + :param action_uri_text: The information from the URI for the recommended + troubleshooting actions. + :type action_uri_text: str + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'action_text': {'key': 'actionText', 'type': 'str'}, + 'action_uri': {'key': 'actionUri', 'type': 'str'}, + 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, + } + + def __init__(self, *, action_id: str=None, action_text: str=None, action_uri: str=None, action_uri_text: str=None, **kwargs) -> None: + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = action_id + self.action_text = action_text + self.action_uri = action_uri + self.action_uri_text = action_uri_text diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_result.py index d357c270d18f..6833e3fc539a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_result.py @@ -33,9 +33,9 @@ class TroubleshootingResult(Model): 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, } - def __init__(self, start_time=None, end_time=None, code=None, results=None): - super(TroubleshootingResult, self).__init__() - self.start_time = start_time - self.end_time = end_time - self.code = code - self.results = results + def __init__(self, **kwargs): + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.code = kwargs.get('code', None) + self.results = kwargs.get('results', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_result_py3.py new file mode 100644 index 000000000000..efe424fab38f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/troubleshooting_result_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingResult(Model): + """Troubleshooting information gained from specified resource. + + :param start_time: The start time of the troubleshooting. + :type start_time: datetime + :param end_time: The end time of the troubleshooting. + :type end_time: datetime + :param code: The result code of the troubleshooting. + :type code: str + :param results: Information from troubleshooting. + :type results: + list[~azure.mgmt.network.v2017_11_01.models.TroubleshootingDetails] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, + } + + def __init__(self, *, start_time=None, end_time=None, code: str=None, results=None, **kwargs) -> None: + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.code = code + self.results = results diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tunnel_connection_health.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tunnel_connection_health.py index 33c0eea236ac..4d1761e6bc1f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tunnel_connection_health.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tunnel_connection_health.py @@ -52,8 +52,8 @@ class TunnelConnectionHealth(Model): 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, } - def __init__(self): - super(TunnelConnectionHealth, self).__init__() + def __init__(self, **kwargs): + super(TunnelConnectionHealth, self).__init__(**kwargs) self.tunnel = None self.connection_status = None self.ingress_bytes_transferred = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tunnel_connection_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tunnel_connection_health_py3.py new file mode 100644 index 000000000000..365d927d71b9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/tunnel_connection_health_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TunnelConnectionHealth(Model): + """VirtualNetworkGatewayConnection properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tunnel: Tunnel name. + :vartype tunnel: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values include: 'Unknown', 'Connecting', 'Connected', + 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnectionStatus + :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this + connection + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: The Egress Bytes Transferred in this + connection + :vartype egress_bytes_transferred: long + :ivar last_connection_established_utc_time: The time at which connection + was established in Utc format. + :vartype last_connection_established_utc_time: str + """ + + _validation = { + 'tunnel': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'last_connection_established_utc_time': {'readonly': True}, + } + + _attribute_map = { + 'tunnel': {'key': 'tunnel', 'type': 'str'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TunnelConnectionHealth, self).__init__(**kwargs) + self.tunnel = None + self.connection_status = None + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.last_connection_established_utc_time = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage.py index 2a864d3d44e6..92526d3c9645 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage.py @@ -18,16 +18,18 @@ class Usage(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource identifier. :vartype id: str - :ivar unit: An enum describing the unit of measurement. Default value: - "Count" . + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . :vartype unit: str - :param current_value: The current value of the usage. + :param current_value: Required. The current value of the usage. :type current_value: long - :param limit: The limit of usage. + :param limit: Required. The limit of usage. :type limit: long - :param name: The name of the type of usage. + :param name: Required. The name of the type of usage. :type name: ~azure.mgmt.network.v2017_11_01.models.UsageName """ @@ -49,9 +51,9 @@ class Usage(Model): unit = "Count" - def __init__(self, current_value, limit, name): - super(Usage, self).__init__() + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) self.id = None - self.current_value = current_value - self.limit = limit - self.name = name + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage_name.py index df7f344bfb9b..bd1813944fdc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage_name.py @@ -26,7 +26,7 @@ class UsageName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self, value=None, localized_value=None): - super(UsageName, self).__init__() - self.value = value - self.localized_value = localized_value + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage_name_py3.py new file mode 100644 index 000000000000..4e5e3e10de15 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage_py3.py new file mode 100644 index 000000000000..1ec90b9401f0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/usage_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes network resource usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource identifier. + :vartype id: str + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . + :vartype unit: str + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.network.v2017_11_01.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.id = None + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_parameters.py index f8f11fff147d..ac81d450f6d8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_parameters.py @@ -15,28 +15,30 @@ class VerificationIPFlowParameters(Model): """Parameters that define the IP flow to be verified. - :param target_resource_id: The ID of the target resource to perform - next-hop on. + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. :type target_resource_id: str - :param direction: The direction of the packet represented as a 5-tuple. - Possible values include: 'Inbound', 'Outbound' + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' :type direction: str or ~azure.mgmt.network.v2017_11_01.models.Direction - :param protocol: Protocol to be verified on. Possible values include: - 'TCP', 'UDP' + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' :type protocol: str or ~azure.mgmt.network.v2017_11_01.models.Protocol - :param local_port: The local port. Acceptable values are a single integer - in the range (0-65535). Support for * for the source port, which depends - on the direction. + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type local_port: str - :param remote_port: The remote port. Acceptable values are a single - integer in the range (0-65535). Support for * for the source port, which - depends on the direction. + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. :type remote_port: str - :param local_ip_address: The local IP address. Acceptable values are valid - IPv4 addresses. + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. :type local_ip_address: str - :param remote_ip_address: The remote IP address. Acceptable values are - valid IPv4 addresses. + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. :type remote_ip_address: str :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be @@ -65,13 +67,13 @@ class VerificationIPFlowParameters(Model): 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, } - def __init__(self, target_resource_id, direction, protocol, local_port, remote_port, local_ip_address, remote_ip_address, target_nic_resource_id=None): - super(VerificationIPFlowParameters, self).__init__() - self.target_resource_id = target_resource_id - self.direction = direction - self.protocol = protocol - self.local_port = local_port - self.remote_port = remote_port - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.target_nic_resource_id = target_nic_resource_id + def __init__(self, **kwargs): + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.direction = kwargs.get('direction', None) + self.protocol = kwargs.get('protocol', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_parameters_py3.py new file mode 100644 index 000000000000..9b6d10c98818 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_parameters_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowParameters(Model): + """Parameters that define the IP flow to be verified. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. + :type target_resource_id: str + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' + :type direction: str or ~azure.mgmt.network.v2017_11_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' + :type protocol: str or ~azure.mgmt.network.v2017_11_01.models.Protocol + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type local_port: str + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type remote_port: str + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. + :type local_ip_address: str + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. + :type remote_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of them, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'local_port': {'required': True}, + 'remote_port': {'required': True}, + 'local_ip_address': {'required': True}, + 'remote_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, direction, protocol, local_port: str, remote_port: str, local_ip_address: str, remote_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.direction = direction + self.protocol = protocol + self.local_port = local_port + self.remote_port = remote_port + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_result.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_result.py index b1851e06df67..b003cadd0abb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_result.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_result.py @@ -28,7 +28,7 @@ class VerificationIPFlowResult(Model): 'rule_name': {'key': 'ruleName', 'type': 'str'}, } - def __init__(self, access=None, rule_name=None): - super(VerificationIPFlowResult, self).__init__() - self.access = access - self.rule_name = rule_name + def __init__(self, **kwargs): + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.rule_name = kwargs.get('rule_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_result_py3.py new file mode 100644 index 000000000000..d5fd3888a8b7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/verification_ip_flow_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowResult(Model): + """Results of IP flow verification on the target resource. + + :param access: Indicates whether the traffic is allowed or denied. + Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2017_11_01.models.Access + :param rule_name: Name of the rule. If input is not matched against any + security rule, it is not displayed. + :type rule_name: str + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + } + + def __init__(self, *, access=None, rule_name: str=None, **kwargs) -> None: + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = access + self.rule_name = rule_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network.py index 3499d1abfba0..2366b0c073cb 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network.py @@ -78,14 +78,14 @@ class VirtualNetwork(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid=None, provisioning_state=None, enable_ddos_protection=None, enable_vm_protection=None, etag=None): - super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags) - self.address_space = address_space - self.dhcp_options = dhcp_options - self.subnets = subnets - self.virtual_network_peerings = virtual_network_peerings - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - self.enable_ddos_protection = enable_ddos_protection - self.enable_vm_protection = enable_vm_protection - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetwork, self).__init__(**kwargs) + self.address_space = kwargs.get('address_space', None) + self.dhcp_options = kwargs.get('dhcp_options', None) + self.subnets = kwargs.get('subnets', None) + self.virtual_network_peerings = kwargs.get('virtual_network_peerings', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.enable_ddos_protection = kwargs.get('enable_ddos_protection', None) + self.enable_vm_protection = kwargs.get('enable_vm_protection', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_connection_gateway_reference.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_connection_gateway_reference.py index eb18a3c124ff..aa10101778f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_connection_gateway_reference.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_connection_gateway_reference.py @@ -15,8 +15,10 @@ class VirtualNetworkConnectionGatewayReference(Model): """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. - :param id: The ID of VirtualNetworkGateway or LocalNetworkGateway - resource. + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or + LocalNetworkGateway resource. :type id: str """ @@ -28,6 +30,6 @@ class VirtualNetworkConnectionGatewayReference(Model): 'id': {'key': 'id', 'type': 'str'}, } - def __init__(self, id): - super(VirtualNetworkConnectionGatewayReference, self).__init__() - self.id = id + def __init__(self, **kwargs): + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_connection_gateway_reference_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_connection_gateway_reference_py3.py new file mode 100644 index 000000000000..b2d9734baf3c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_connection_gateway_reference_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkConnectionGatewayReference(Model): + """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or + LocalNetworkGateway resource. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway.py index f05245297e35..79ad244a51e0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway.py @@ -98,17 +98,17 @@ class VirtualNetworkGateway(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, location=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp=None, active_active=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid=None, etag=None): - super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags) - self.ip_configurations = ip_configurations - self.gateway_type = gateway_type - self.vpn_type = vpn_type - self.enable_bgp = enable_bgp - self.active_active = active_active - self.gateway_default_site = gateway_default_site - self.sku = sku - self.vpn_client_configuration = vpn_client_configuration - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid + def __init__(self, **kwargs): + super(VirtualNetworkGateway, self).__init__(**kwargs) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.gateway_type = kwargs.get('gateway_type', None) + self.vpn_type = kwargs.get('vpn_type', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.active_active = kwargs.get('active_active', None) + self.gateway_default_site = kwargs.get('gateway_default_site', None) + self.sku = kwargs.get('sku', None) + self.vpn_client_configuration = kwargs.get('vpn_client_configuration', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection.py index e47041a53bec..94eea71eb2e0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayConnection(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -30,8 +32,8 @@ class VirtualNetworkGatewayConnection(Resource): :type tags: dict[str, str] :param authorization_key: The authorizationKey. :type authorization_key: str - :param virtual_network_gateway1: The reference to virtual network gateway - resource. + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. :type virtual_network_gateway1: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway :param virtual_network_gateway2: The reference to virtual network gateway @@ -42,8 +44,8 @@ class VirtualNetworkGatewayConnection(Resource): resource. :type local_network_gateway2: ~azure.mgmt.network.v2017_11_01.models.LocalNetworkGateway - :param connection_type: Gateway connection type. Possible values are: - 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' :type connection_type: str or ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnectionType @@ -128,23 +130,23 @@ class VirtualNetworkGatewayConnection(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, virtual_network_gateway1, connection_type, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight=None, shared_key=None, peer=None, enable_bgp=None, use_policy_based_traffic_selectors=None, ipsec_policies=None, resource_guid=None, etag=None): - super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnection, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) self.connection_status = None self.tunnel_connection_status = None self.egress_bytes_transferred = None self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors - self.ipsec_policies = ipsec_policies - self.resource_guid = resource_guid + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection_list_entity.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection_list_entity.py index 2b83791ad142..b95f3ee3ea4f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection_list_entity.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection_list_entity.py @@ -18,6 +18,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str :ivar name: Resource name. @@ -30,8 +32,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): :type tags: dict[str, str] :param authorization_key: The authorizationKey. :type authorization_key: str - :param virtual_network_gateway1: The reference to virtual network gateway - resource. + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. :type virtual_network_gateway1: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkConnectionGatewayReference :param virtual_network_gateway2: The reference to virtual network gateway @@ -42,8 +44,8 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): resource. :type local_network_gateway2: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkConnectionGatewayReference - :param connection_type: Gateway connection type. Possible values are: - 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' :type connection_type: str or ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnectionType @@ -128,23 +130,23 @@ class VirtualNetworkGatewayConnectionListEntity(Resource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, virtual_network_gateway1, connection_type, id=None, location=None, tags=None, authorization_key=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight=None, shared_key=None, peer=None, enable_bgp=None, use_policy_based_traffic_selectors=None, ipsec_policies=None, resource_guid=None, etag=None): - super(VirtualNetworkGatewayConnectionListEntity, self).__init__(id=id, location=location, tags=tags) - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) self.connection_status = None self.tunnel_connection_status = None self.egress_bytes_transferred = None self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors - self.ipsec_policies = ipsec_policies - self.resource_guid = resource_guid + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.resource_guid = kwargs.get('resource_guid', None) self.provisioning_state = None - self.etag = etag + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection_list_entity_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection_list_entity_py3.py new file mode 100644 index 000000000000..c980686bc3b9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection_list_entity_py3.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnectionListEntity(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkConnectionGatewayReference + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkConnectionGatewayReference + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkConnectionGatewayReference + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2017_11_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2017_11_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, use_policy_based_traffic_selectors: bool=None, ipsec_policies=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection_py3.py new file mode 100644 index 000000000000..5d63652f16f0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_connection_py3.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnection(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2017_11_01.models.LocalNetworkGateway + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2017_11_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2017_11_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, use_policy_based_traffic_selectors: bool=None, ipsec_policies=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_ip_configuration.py index 55aad7008a92..32ed2989b5e3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_ip_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_ip_configuration.py @@ -55,11 +55,11 @@ class VirtualNetworkGatewayIPConfiguration(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name=None, etag=None): - super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id) - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address + def __init__(self, **kwargs): + super(VirtualNetworkGatewayIPConfiguration, self).__init__(**kwargs) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..6d63fb1fad60 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_ip_configuration_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2017_11_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2017_11_01.models.SubResource + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :ivar provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_py3.py new file mode 100644 index 000000000000..dffea35bbf61 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_py3.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param ip_configurations: IP configurations for virtual network gateway. + :type ip_configurations: + list[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible + values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', + 'ExpressRoute' + :type gateway_type: str or + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayType + :param vpn_type: The type of this virtual network gateway. Possible values + are: 'PolicyBased' and 'RouteBased'. Possible values include: + 'PolicyBased', 'RouteBased' + :type vpn_type: str or ~azure.mgmt.network.v2017_11_01.models.VpnType + :param enable_bgp: Whether BGP is enabled for this virtual network gateway + or not. + :type enable_bgp: bool + :param active_active: ActiveActive flag + :type active_active: bool + :param gateway_default_site: The reference of the LocalNetworkGateway + resource which represents local network site having default routes. Assign + Null value in case of removing existing default site setting. + :type gateway_default_site: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param sku: The reference of the VirtualNetworkGatewaySku resource which + represents the SKU selected for Virtual network gateway. + :type sku: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewaySku + :param vpn_client_configuration: The reference of the + VpnClientConfiguration resource which represents the P2S VpnClient + configurations. + :type vpn_client_configuration: + ~azure.mgmt.network.v2017_11_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2017_11_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + VirtualNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGateway resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, + 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, + 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'active_active': {'key': 'properties.activeActive', 'type': 'bool'}, + 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, + 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, + 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp: bool=None, active_active: bool=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.ip_configurations = ip_configurations + self.gateway_type = gateway_type + self.vpn_type = vpn_type + self.enable_bgp = enable_bgp + self.active_active = active_active + self.gateway_default_site = gateway_default_site + self.sku = sku + self.vpn_client_configuration = vpn_client_configuration + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_sku.py index 7fab46663151..1245fef5a1e8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_sku.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_sku.py @@ -35,8 +35,8 @@ class VirtualNetworkGatewaySku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, name=None, tier=None, capacity=None): - super(VirtualNetworkGatewaySku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity + def __init__(self, **kwargs): + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_sku_py3.py new file mode 100644 index 000000000000..5ac3e4be47fc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_gateway_sku_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkGatewaySku(Model): + """VirtualNetworkGatewaySku details. + + :param name: Gateway SKU name. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type name: str or + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewaySkuName + :param tier: Gateway SKU tier. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type tier: str or + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewaySkuTier + :param capacity: The capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_peering.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_peering.py index dedf623bc6c0..1f8f0e1b595d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_peering.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_peering.py @@ -72,15 +72,15 @@ class VirtualNetworkPeering(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, allow_virtual_network_access=None, allow_forwarded_traffic=None, allow_gateway_transit=None, use_remote_gateways=None, remote_virtual_network=None, remote_address_space=None, peering_state=None, provisioning_state=None, name=None, etag=None): - super(VirtualNetworkPeering, self).__init__(id=id) - self.allow_virtual_network_access = allow_virtual_network_access - self.allow_forwarded_traffic = allow_forwarded_traffic - self.allow_gateway_transit = allow_gateway_transit - self.use_remote_gateways = use_remote_gateways - self.remote_virtual_network = remote_virtual_network - self.remote_address_space = remote_address_space - self.peering_state = peering_state - self.provisioning_state = provisioning_state - self.name = name - self.etag = etag + def __init__(self, **kwargs): + super(VirtualNetworkPeering, self).__init__(**kwargs) + self.allow_virtual_network_access = kwargs.get('allow_virtual_network_access', None) + self.allow_forwarded_traffic = kwargs.get('allow_forwarded_traffic', None) + self.allow_gateway_transit = kwargs.get('allow_gateway_transit', None) + self.use_remote_gateways = kwargs.get('use_remote_gateways', None) + self.remote_virtual_network = kwargs.get('remote_virtual_network', None) + self.remote_address_space = kwargs.get('remote_address_space', None) + self.peering_state = kwargs.get('peering_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_peering_py3.py new file mode 100644 index 000000000000..e5fd2bb197e2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_peering_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkPeering(SubResource): + """Peerings in a virtual network resource. + + :param id: Resource ID. + :type id: str + :param allow_virtual_network_access: Whether the VMs in the linked virtual + network space would be able to access all the VMs in local Virtual network + space. + :type allow_virtual_network_access: bool + :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs + in the remote virtual network will be allowed/disallowed. + :type allow_forwarded_traffic: bool + :param allow_gateway_transit: If gateway links can be used in remote + virtual networking to link to this virtual network. + :type allow_gateway_transit: bool + :param use_remote_gateways: If remote gateways can be used on this virtual + network. If the flag is set to true, and allowGatewayTransit on remote + peering is also true, virtual network will use gateways of remote virtual + network for transit. Only one peering can have this flag set to true. This + flag cannot be set if virtual network already has a gateway. + :type use_remote_gateways: bool + :param remote_virtual_network: The reference of the remote virtual + network. The remote virtual network can be in the same or different region + (preview). See here to register for the preview and learn more + (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + :type remote_virtual_network: + ~azure.mgmt.network.v2017_11_01.models.SubResource + :param remote_address_space: The reference of the remote virtual network + address space. + :type remote_address_space: + ~azure.mgmt.network.v2017_11_01.models.AddressSpace + :param peering_state: The status of the virtual network peering. Possible + values are 'Initiated', 'Connected', and 'Disconnected'. Possible values + include: 'Initiated', 'Connected', 'Disconnected' + :type peering_state: str or + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkPeeringState + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, + 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, + 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, + 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'remote_address_space': {'key': 'properties.remoteAddressSpace', 'type': 'AddressSpace'}, + 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, allow_virtual_network_access: bool=None, allow_forwarded_traffic: bool=None, allow_gateway_transit: bool=None, use_remote_gateways: bool=None, remote_virtual_network=None, remote_address_space=None, peering_state=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkPeering, self).__init__(id=id, **kwargs) + self.allow_virtual_network_access = allow_virtual_network_access + self.allow_forwarded_traffic = allow_forwarded_traffic + self.allow_gateway_transit = allow_gateway_transit + self.use_remote_gateways = use_remote_gateways + self.remote_virtual_network = remote_virtual_network + self.remote_address_space = remote_address_space + self.peering_state = peering_state + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_py3.py new file mode 100644 index 000000000000..6bb10149f148 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetwork(Resource): + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param address_space: The AddressSpace that contains an array of IP + address ranges that can be used by subnets. + :type address_space: ~azure.mgmt.network.v2017_11_01.models.AddressSpace + :param dhcp_options: The dhcpOptions that contains an array of DNS servers + available to VMs deployed in the virtual network. + :type dhcp_options: ~azure.mgmt.network.v2017_11_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2017_11_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkPeering] + :param resource_guid: The resourceGuid property of the Virtual Network + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param enable_ddos_protection: Indicates if DDoS protection is enabled for + all the protected resources in a Virtual Network. + :type enable_ddos_protection: bool + :param enable_vm_protection: Indicates if Vm protection is enabled for all + the subnets in a Virtual Network. + :type enable_vm_protection: bool + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'enable_ddos_protection': {'key': 'properties.enableDdosProtection', 'type': 'bool'}, + 'enable_vm_protection': {'key': 'properties.enableVmProtection', 'type': 'bool'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid: str=None, provisioning_state: str=None, enable_ddos_protection: bool=None, enable_vm_protection: bool=None, etag: str=None, **kwargs) -> None: + super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.address_space = address_space + self.dhcp_options = dhcp_options + self.subnets = subnets + self.virtual_network_peerings = virtual_network_peerings + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.enable_ddos_protection = enable_ddos_protection + self.enable_vm_protection = enable_vm_protection + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage.py index bbb4ff973348..c5e9e1b692fc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage.py @@ -47,8 +47,8 @@ class VirtualNetworkUsage(Model): 'unit': {'key': 'unit', 'type': 'str'}, } - def __init__(self): - super(VirtualNetworkUsage, self).__init__() + def __init__(self, **kwargs): + super(VirtualNetworkUsage, self).__init__(**kwargs) self.current_value = None self.id = None self.limit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage_name.py index 01fcbf0875eb..607ccec3b964 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage_name.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage_name.py @@ -34,7 +34,7 @@ class VirtualNetworkUsageName(Model): 'value': {'key': 'value', 'type': 'str'}, } - def __init__(self): - super(VirtualNetworkUsageName, self).__init__() + def __init__(self, **kwargs): + super(VirtualNetworkUsageName, self).__init__(**kwargs) self.localized_value = None self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage_name_py3.py new file mode 100644 index 000000000000..1651ebda7e77 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage_name_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsageName(Model): + """Usage strings container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar localized_value: Localized subnet size and usage string. + :vartype localized_value: str + :ivar value: Subnet size and usage string. + :vartype value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsageName, self).__init__(**kwargs) + self.localized_value = None + self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage_py3.py new file mode 100644 index 000000000000..59316eb433a4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/virtual_network_usage_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsage(Model): + """Usage details for subnet. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar current_value: Indicates number of IPs used from the Subnet. + :vartype current_value: float + :ivar id: Subnet identifier. + :vartype id: str + :ivar limit: Indicates the size of the subnet. + :vartype limit: float + :ivar name: The name containing common and localized value for usage. + :vartype name: + ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkUsageName + :ivar unit: Usage units. Returns 'Count' + :vartype unit: str + """ + + _validation = { + 'current_value': {'readonly': True}, + 'id': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'name': {'key': 'name', 'type': 'VirtualNetworkUsageName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsage, self).__init__(**kwargs) + self.current_value = None + self.id = None + self.limit = None + self.name = None + self.unit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_configuration.py index 258f31a2e6f0..9f310f9dad33 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_configuration.py @@ -48,11 +48,11 @@ class VpnClientConfiguration(Model): 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, } - def __init__(self, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, vpn_client_protocols=None, radius_server_address=None, radius_server_secret=None): - super(VpnClientConfiguration, self).__init__() - self.vpn_client_address_pool = vpn_client_address_pool - self.vpn_client_root_certificates = vpn_client_root_certificates - self.vpn_client_revoked_certificates = vpn_client_revoked_certificates - self.vpn_client_protocols = vpn_client_protocols - self.radius_server_address = radius_server_address - self.radius_server_secret = radius_server_secret + def __init__(self, **kwargs): + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = kwargs.get('vpn_client_address_pool', None) + self.vpn_client_root_certificates = kwargs.get('vpn_client_root_certificates', None) + self.vpn_client_revoked_certificates = kwargs.get('vpn_client_revoked_certificates', None) + self.vpn_client_protocols = kwargs.get('vpn_client_protocols', None) + self.radius_server_address = kwargs.get('radius_server_address', None) + self.radius_server_secret = kwargs.get('radius_server_secret', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_configuration_py3.py new file mode 100644 index 000000000000..f8d506aa94c3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_configuration_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientConfiguration(Model): + """VpnClientConfiguration for P2S client. + + :param vpn_client_address_pool: The reference of the address space + resource which represents Address space for P2S VpnClient. + :type vpn_client_address_pool: + ~azure.mgmt.network.v2017_11_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual + network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2017_11_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for + Virtual network gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2017_11_01.models.VpnClientRevokedCertificate] + :param vpn_client_protocols: VpnClientProtocols for Virtual network + gateway. + :type vpn_client_protocols: list[str or + ~azure.mgmt.network.v2017_11_01.models.VpnClientProtocol] + :param radius_server_address: The radius server address property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_address: str + :param radius_server_secret: The radius secret property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_secret: str + """ + + _attribute_map = { + 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, + 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, + 'vpn_client_protocols': {'key': 'vpnClientProtocols', 'type': '[str]'}, + 'radius_server_address': {'key': 'radiusServerAddress', 'type': 'str'}, + 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, + } + + def __init__(self, *, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, vpn_client_protocols=None, radius_server_address: str=None, radius_server_secret: str=None, **kwargs) -> None: + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = vpn_client_address_pool + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + self.vpn_client_protocols = vpn_client_protocols + self.radius_server_address = radius_server_address + self.radius_server_secret = radius_server_secret diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_parameters.py index 72c2eda37e73..1e13486a54bc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_parameters.py @@ -42,9 +42,9 @@ class VpnClientParameters(Model): 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, } - def __init__(self, processor_architecture=None, authentication_method=None, radius_server_auth_certificate=None, client_root_certificates=None): - super(VpnClientParameters, self).__init__() - self.processor_architecture = processor_architecture - self.authentication_method = authentication_method - self.radius_server_auth_certificate = radius_server_auth_certificate - self.client_root_certificates = client_root_certificates + def __init__(self, **kwargs): + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = kwargs.get('processor_architecture', None) + self.authentication_method = kwargs.get('authentication_method', None) + self.radius_server_auth_certificate = kwargs.get('radius_server_auth_certificate', None) + self.client_root_certificates = kwargs.get('client_root_certificates', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_parameters_py3.py new file mode 100644 index 000000000000..71cb5b4b8cab --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_parameters_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientParameters(Model): + """Vpn Client Parameters for package generation. + + :param processor_architecture: VPN client Processor Architecture. Possible + values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' + :type processor_architecture: str or + ~azure.mgmt.network.v2017_11_01.models.ProcessorArchitecture + :param authentication_method: VPN client Authentication Method. Possible + values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', + 'EAPMSCHAPv2' + :type authentication_method: str or + ~azure.mgmt.network.v2017_11_01.models.AuthenticationMethod + :param radius_server_auth_certificate: The public certificate data for the + radius server authentication certificate as a Base-64 encoded string. + Required only if external radius authentication has been configured with + EAPTLS authentication. + :type radius_server_auth_certificate: str + :param client_root_certificates: A list of client root certificates public + certificate data encoded as Base-64 strings. Optional parameter for + external radius based authentication with EAPTLS. + :type client_root_certificates: list[str] + """ + + _attribute_map = { + 'processor_architecture': {'key': 'processorArchitecture', 'type': 'str'}, + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + 'radius_server_auth_certificate': {'key': 'radiusServerAuthCertificate', 'type': 'str'}, + 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, + } + + def __init__(self, *, processor_architecture=None, authentication_method=None, radius_server_auth_certificate: str=None, client_root_certificates=None, **kwargs) -> None: + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = processor_architecture + self.authentication_method = authentication_method + self.radius_server_auth_certificate = radius_server_auth_certificate + self.client_root_certificates = client_root_certificates diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_revoked_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_revoked_certificate.py index ebd6a4bbba2f..1fa6f6a1ef23 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_revoked_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_revoked_certificate.py @@ -46,9 +46,9 @@ class VpnClientRevokedCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, id=None, thumbprint=None, name=None, etag=None): - super(VpnClientRevokedCertificate, self).__init__(id=id) - self.thumbprint = thumbprint + def __init__(self, **kwargs): + super(VpnClientRevokedCertificate, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_revoked_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_revoked_certificate_py3.py new file mode 100644 index 000000000000..7c1e05f283a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_revoked_certificate_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + :ivar provisioning_state: The provisioning state of the VPN client revoked + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, thumbprint: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRevokedCertificate, self).__init__(id=id, **kwargs) + self.thumbprint = thumbprint + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_root_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_root_certificate.py index 6d820d3a8c11..48c7033d42ec 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_root_certificate.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_root_certificate.py @@ -18,9 +18,11 @@ class VpnClientRootCertificate(SubResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param id: Resource ID. :type id: str - :param public_cert_data: The certificate public data. + :param public_cert_data: Required. The certificate public data. :type public_cert_data: str :ivar provisioning_state: The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and @@ -47,9 +49,9 @@ class VpnClientRootCertificate(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, public_cert_data, id=None, name=None, etag=None): - super(VpnClientRootCertificate, self).__init__(id=id) - self.public_cert_data = public_cert_data + def __init__(self, **kwargs): + super(VpnClientRootCertificate, self).__init__(**kwargs) + self.public_cert_data = kwargs.get('public_cert_data', None) self.provisioning_state = None - self.name = name - self.etag = etag + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_root_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_root_certificate_py3.py new file mode 100644 index 000000000000..db8a1e547705 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_client_root_certificate_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param public_cert_data: Required. The certificate public data. + :type public_cert_data: str + :ivar provisioning_state: The provisioning state of the VPN client root + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'public_cert_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, public_cert_data: str, id: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRootCertificate, self).__init__(id=id, **kwargs) + self.public_cert_data = public_cert_data + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_device_script_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_device_script_parameters.py index 89ee8af0645a..e4f8f12701b7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_device_script_parameters.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_device_script_parameters.py @@ -29,8 +29,8 @@ class VpnDeviceScriptParameters(Model): 'firmware_version': {'key': 'firmwareVersion', 'type': 'str'}, } - def __init__(self, vendor=None, device_family=None, firmware_version=None): - super(VpnDeviceScriptParameters, self).__init__() - self.vendor = vendor - self.device_family = device_family - self.firmware_version = firmware_version + def __init__(self, **kwargs): + super(VpnDeviceScriptParameters, self).__init__(**kwargs) + self.vendor = kwargs.get('vendor', None) + self.device_family = kwargs.get('device_family', None) + self.firmware_version = kwargs.get('firmware_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_device_script_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_device_script_parameters_py3.py new file mode 100644 index 000000000000..e5520ffb5a18 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/vpn_device_script_parameters_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnDeviceScriptParameters(Model): + """Vpn device configuration script generation parameters. + + :param vendor: The vendor for the vpn device. + :type vendor: str + :param device_family: The device family for the vpn device. + :type device_family: str + :param firmware_version: The firmware version for the vpn device. + :type firmware_version: str + """ + + _attribute_map = { + 'vendor': {'key': 'vendor', 'type': 'str'}, + 'device_family': {'key': 'deviceFamily', 'type': 'str'}, + 'firmware_version': {'key': 'firmwareVersion', 'type': 'str'}, + } + + def __init__(self, *, vendor: str=None, device_family: str=None, firmware_version: str=None, **kwargs) -> None: + super(VpnDeviceScriptParameters, self).__init__(**kwargs) + self.vendor = vendor + self.device_family = device_family + self.firmware_version = firmware_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/network_management_client.py index 82c49c7714f8..35b21d404d8e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/network_management_client.py @@ -15,7 +15,8 @@ from .version import VERSION from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling import uuid from .operations.application_gateways_operations import ApplicationGatewaysOperations from .operations.application_security_groups_operations import ApplicationSecurityGroupsOperations @@ -292,7 +293,7 @@ def check_dns_name_availability( api_version = "2017-11-01" # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability' + url = self.check_dns_name_availability.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -333,3 +334,4 @@ def check_dns_name_availability( return client_raw_response return deserialized + check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/application_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/application_gateways_operations.py index a1892dba7a5c..7723e995d213 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/application_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/application_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ApplicationGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified application gateway. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def get( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def _create_or_update_initial( self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates the specified application gateway. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_11_01.models.ApplicationGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ApplicationGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ApplicationGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ApplicationGateway', response) if raw: @@ -312,12 +276,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def _update_tags_initial( @@ -325,7 +291,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -372,7 +338,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, application_gateway_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates the specified application gateway tags. :param resource_group_name: The name of the resource group. @@ -382,13 +348,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ApplicationGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ApplicationGateway]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -399,30 +368,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ApplicationGateway', response) if raw: @@ -431,12 +378,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -458,7 +407,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -504,6 +453,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -523,7 +473,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -568,12 +518,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} def _start_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -609,7 +560,7 @@ def _start_initial( return client_raw_response def start( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts the specified application gateway. :param resource_group_name: The name of the resource group. @@ -617,12 +568,14 @@ def start( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -632,46 +585,26 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} def _stop_initial( self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -707,7 +640,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops the specified application gateway in a resource group. :param resource_group_name: The name of the resource group. @@ -715,12 +648,14 @@ def stop( :param application_gateway_name: The name of the application gateway. :type application_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -730,46 +665,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} def _backend_health_initial( self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth' + url = self.backend_health.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), @@ -814,7 +729,7 @@ def _backend_health_initial( return deserialized def backend_health( - self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the backend health of the specified application gateway in a resource group. @@ -826,13 +741,17 @@ def backend_health( referenced in backend health. :type expand: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationGatewayBackendHealth or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApplicationGatewayBackendHealth or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendHealth] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ApplicationGatewayBackendHealth]] :raises: :class:`CloudError` """ raw_result = self._backend_health_initial( @@ -843,30 +762,8 @@ def backend_health( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ApplicationGatewayBackendHealth', response) if raw: @@ -875,12 +772,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} def list_available_waf_rule_sets( self, custom_headers=None, raw=False, **operation_config): @@ -899,7 +798,7 @@ def list_available_waf_rule_sets( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets' + url = self.list_available_waf_rule_sets.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -938,6 +837,7 @@ def list_available_waf_rule_sets( return client_raw_response return deserialized + list_available_waf_rule_sets.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'} def list_available_ssl_options( self, custom_headers=None, raw=False, **operation_config): @@ -956,7 +856,7 @@ def list_available_ssl_options( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default' + url = self.list_available_ssl_options.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -995,6 +895,7 @@ def list_available_ssl_options( return client_raw_response return deserialized + list_available_ssl_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default'} def list_available_ssl_predefined_policies( self, custom_headers=None, raw=False, **operation_config): @@ -1015,7 +916,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies' + url = self.list_available_ssl_predefined_policies.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -1060,6 +961,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_available_ssl_predefined_policies.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies'} def get_ssl_predefined_policy( self, predefined_policy_name, custom_headers=None, raw=False, **operation_config): @@ -1080,7 +982,7 @@ def get_ssl_predefined_policy( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}' + url = self.get_ssl_predefined_policy.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'predefinedPolicyName': self._serialize.url("predefined_policy_name", predefined_policy_name, 'str') @@ -1120,3 +1022,4 @@ def get_ssl_predefined_policy( return client_raw_response return deserialized + get_ssl_predefined_policy.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/application_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/application_security_groups_operations.py index 4e3d5d94a9bc..bcbd7752fd0d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/application_security_groups_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/application_security_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ApplicationSecurityGroupsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified application security group. :param resource_group_name: The name of the resource group. @@ -88,12 +88,14 @@ def delete( security group. :type application_security_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -103,40 +105,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} def get( self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, **operation_config): @@ -159,7 +141,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), @@ -200,12 +182,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} def _create_or_update_initial( self, resource_group_name, application_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_group_name, 'str'), @@ -254,7 +237,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, application_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, application_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an application security group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,17 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroup :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ApplicationSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApplicationSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ApplicationSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +271,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ApplicationSecurityGroup', response) if raw: @@ -316,12 +281,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -341,7 +308,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -386,6 +353,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -407,7 +375,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -453,3 +421,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/available_endpoint_services_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/available_endpoint_services_operations.py index 5b1d66416606..ea9361a8cd0a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/available_endpoint_services_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/available_endpoint_services_operations.py @@ -22,7 +22,7 @@ class AvailableEndpointServicesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/bgp_service_communities_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/bgp_service_communities_operations.py index 14c5e396fe28..7ea25b19f297 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/bgp_service_communities_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/bgp_service_communities_operations.py @@ -22,7 +22,7 @@ class BgpServiceCommunitiesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/connection_monitors_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/connection_monitors_operations.py index b27bea9d2770..8831479a5bb1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/connection_monitors_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/connection_monitors_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ConnectionMonitorsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -93,7 +93,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a connection monitor. :param resource_group_name: The name of the resource group containing @@ -108,13 +108,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_11_01.models.ConnectionMonitor :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionMonitorResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectionMonitorResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorResult]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -126,30 +129,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ConnectionMonitorResult', response) if raw: @@ -158,12 +139,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} def get( self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): @@ -187,7 +170,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -229,12 +212,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} def _delete_initial( self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -271,7 +255,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified connection monitor. :param resource_group_name: The name of the resource group containing @@ -282,12 +266,14 @@ def delete( :param connection_monitor_name: The name of the connection monitor. :type connection_monitor_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -298,46 +284,26 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} def _stop_initial( self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -374,7 +340,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops the specified connection monitor. :param resource_group_name: The name of the resource group containing @@ -385,12 +351,14 @@ def stop( :param connection_monitor_name: The name of the connection monitor. :type connection_monitor_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -401,46 +369,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop'} def _start_initial( self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start' + url = self.start.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -477,7 +425,7 @@ def _start_initial( return client_raw_response def start( - self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, polling=True, **operation_config): """Starts the specified connection monitor. :param resource_group_name: The name of the resource group containing @@ -488,12 +436,14 @@ def start( :param connection_monitor_name: The name of the connection monitor. :type connection_monitor_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._start_initial( @@ -504,46 +454,26 @@ def start( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start'} def _query_initial( self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query' + url = self.query.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -589,7 +519,7 @@ def _query_initial( return deserialized def query( - self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, polling=True, **operation_config): """Query a snapshot of the most recent connection states. :param resource_group_name: The name of the resource group containing @@ -601,13 +531,17 @@ def query( monitor. :type connection_monitor_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionMonitorQueryResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConnectionMonitorQueryResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorQueryResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ConnectionMonitorQueryResult]] :raises: :class:`CloudError` """ raw_result = self._query_initial( @@ -618,30 +552,8 @@ def query( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectionMonitorQueryResult', response) if raw: @@ -650,12 +562,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + query.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query'} def list( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -680,7 +594,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -727,3 +641,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/default_security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/default_security_rules_operations.py index 45e9c79332fa..1ba1f7d420b8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/default_security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/default_security_rules_operations.py @@ -22,7 +22,7 @@ class DefaultSecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -60,7 +60,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -107,6 +107,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules'} def get( self, resource_group_name, network_security_group_name, default_security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -131,7 +132,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -173,3 +174,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_circuit_authorizations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_circuit_authorizations_operations.py index 63ed48ee4dea..8779b070c27a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_circuit_authorizations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_circuit_authorizations_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitAuthorizationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified authorization from the specified express route circuit. @@ -91,12 +91,14 @@ def delete( :param authorization_name: The name of the authorization. :type authorization_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def get( self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): @@ -166,7 +148,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an authorization in the specified express route circuit. @@ -278,13 +261,17 @@ def create_or_update( :type authorization_parameters: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitAuthorization :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitAuthorization or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitAuthorization or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitAuthorization] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitAuthorization]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -296,30 +283,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitAuthorization', response) if raw: @@ -328,12 +293,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +324,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -404,3 +371,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_circuit_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_circuit_peerings_operations.py index 4b9d9a09d13d..db152d3bfd03 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_circuit_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_circuit_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified peering from the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param peering_name: The name of the peering. :type peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def get( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified express route circuits. :param resource_group_name: The name of the resource group. @@ -275,13 +258,17 @@ def create_or_update( :type peering_parameters: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitPeering or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuitPeering', response) if raw: @@ -325,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} def list( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -401,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_circuits_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_circuits_operations.py index fb9babc94710..5823e876fce3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_circuits_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_circuits_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class ExpressRouteCircuitsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified express route circuit. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param circuit_name: The name of the express route circuit. :type circuit_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def get( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -156,7 +138,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -197,12 +179,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _create_or_update_initial( self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -251,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an express route circuit. :param resource_group_name: The name of the resource group. @@ -263,13 +246,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuit :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuit or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuit] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuit]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -280,30 +266,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ExpressRouteCircuit', response) if raw: @@ -312,12 +276,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _update_tags_initial( @@ -325,7 +291,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -372,7 +338,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, circuit_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates an express route circuit tags. :param resource_group_name: The name of the resource group. @@ -382,13 +348,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuit or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuit] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuit]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -399,30 +368,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuit', response) if raw: @@ -431,18 +378,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} def _list_arp_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}' + url = self.list_arp_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -487,7 +436,7 @@ def _list_arp_table_initial( return deserialized def list_arp_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised ARP table associated with the express route circuit in a resource group. @@ -500,14 +449,17 @@ def list_arp_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsArpTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsArpTableListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitsArpTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitsArpTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_arp_table_initial( @@ -519,30 +471,8 @@ def list_arp_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', response) if raw: @@ -551,18 +481,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} def _list_routes_table_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}' + url = self.list_routes_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -607,7 +539,7 @@ def _list_routes_table_initial( return deserialized def list_routes_table( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table associated with the express route circuit in a resource group. @@ -620,14 +552,18 @@ def list_routes_table( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitsRoutesTableListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitsRoutesTableListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_initial( @@ -639,30 +575,8 @@ def list_routes_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', response) if raw: @@ -671,18 +585,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} def _list_routes_table_summary_initial( self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}' + url = self.list_routes_table_summary.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -727,7 +643,7 @@ def _list_routes_table_summary_initial( return deserialized def list_routes_table_summary( - self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the currently advertised routes table summary associated with the express route circuit in a resource group. @@ -740,14 +656,18 @@ def list_routes_table_summary( :param device_path: The path of the device. :type device_path: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ExpressRouteCircuitsRoutesTableSummaryListResult or ClientRawResponse - if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableSummaryListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult]] :raises: :class:`CloudError` """ raw_result = self._list_routes_table_summary_initial( @@ -759,30 +679,8 @@ def list_routes_table_summary( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', response) if raw: @@ -791,12 +689,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} def get_stats( self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): @@ -818,7 +718,7 @@ def get_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats' + url = self.get_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -859,6 +759,7 @@ def get_stats( return client_raw_response return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} def get_peering_stats( self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): @@ -882,7 +783,7 @@ def get_peering_stats( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats' + url = self.get_peering_stats.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), @@ -924,6 +825,7 @@ def get_peering_stats( return client_raw_response return deserialized + get_peering_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -945,7 +847,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -991,6 +893,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -1010,7 +913,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -1055,3 +958,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_service_providers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_service_providers_operations.py index 8f240dec282b..b87cbaa694a5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_service_providers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/express_route_service_providers_operations.py @@ -22,7 +22,7 @@ class ExpressRouteServiceProvidersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -100,3 +100,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/inbound_nat_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/inbound_nat_rules_operations.py index 8c6f8b65a877..79c0e8b40282 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/inbound_nat_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/inbound_nat_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class InboundNatRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -61,7 +61,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -108,12 +108,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules'} def _delete_initial( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -150,7 +151,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -160,12 +161,14 @@ def delete( :param inbound_nat_rule_name: The name of the inbound nat rule. :type inbound_nat_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -176,40 +179,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} def get( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -234,7 +217,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -278,12 +261,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -333,7 +317,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer inbound nat rule. :param resource_group_name: The name of the resource group. @@ -347,13 +331,16 @@ def create_or_update( :type inbound_nat_rule_parameters: ~azure.mgmt.network.v2017_11_01.models.InboundNatRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - InboundNatRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns InboundNatRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.InboundNatRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.InboundNatRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -365,30 +352,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('InboundNatRule', response) if raw: @@ -397,9 +362,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_backend_address_pools_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_backend_address_pools_operations.py index 073045aa1566..82a7bf53c3ad 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_backend_address_pools_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_backend_address_pools_operations.py @@ -22,7 +22,7 @@ class LoadBalancerBackendAddressPoolsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools'} def get( self, resource_group_name, load_balancer_name, backend_address_pool_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -171,3 +172,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_frontend_ip_configurations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_frontend_ip_configurations_operations.py index ba509bf05652..762ba7021d74 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_frontend_ip_configurations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_frontend_ip_configurations_operations.py @@ -22,7 +22,7 @@ class LoadBalancerFrontendIPConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations'} def get( self, resource_group_name, load_balancer_name, frontend_ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -171,3 +172,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_load_balancing_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_load_balancing_rules_operations.py index 8557cb295d5a..e3e49701c017 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_load_balancing_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_load_balancing_rules_operations.py @@ -22,7 +22,7 @@ class LoadBalancerLoadBalancingRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules'} def get( self, resource_group_name, load_balancer_name, load_balancing_rule_name, custom_headers=None, raw=False, **operation_config): @@ -128,7 +129,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -170,3 +171,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_network_interfaces_operations.py index a85bab50b4ae..168a653b0377 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_network_interfaces_operations.py @@ -22,7 +22,7 @@ class LoadBalancerNetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,3 +106,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_probes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_probes_operations.py index e87bc3c26b1f..3b4ae3406b16 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_probes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_probes_operations.py @@ -22,7 +22,7 @@ class LoadBalancerProbesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes'} def get( self, resource_group_name, load_balancer_name, probe_name, custom_headers=None, raw=False, **operation_config): @@ -128,7 +129,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -170,3 +171,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancers_operations.py index 5daf812c1eb7..f742fad106ad 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified load balancer. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param load_balancer_name: The name of the load balancer. :type load_balancer_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def get( self, resource_group_name, load_balancer_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def _create_or_update_initial( self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a load balancer. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( balancer operation. :type parameters: ~azure.mgmt.network.v2017_11_01.models.LoadBalancer :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns LoadBalancer - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.LoadBalancer] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.LoadBalancer]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LoadBalancer', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def _update_tags_initial( @@ -328,7 +294,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), @@ -375,7 +341,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, load_balancer_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, load_balancer_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a load balancer tags. :param resource_group_name: The name of the resource group. @@ -385,13 +351,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns LoadBalancer - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.LoadBalancer] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.LoadBalancer]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -402,30 +371,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('LoadBalancer', response) if raw: @@ -434,12 +381,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -459,7 +408,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -504,6 +453,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -525,7 +475,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -571,3 +521,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/local_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/local_network_gateways_operations.py index e7841b72e643..116d5d3af9fe 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/local_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/local_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class LocalNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a local network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_11_01.models.LocalNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - LocalNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.LocalNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.LocalNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('LocalNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def get( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def _delete_initial( self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified local network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type local_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def _update_tags_initial( @@ -329,7 +295,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), @@ -376,7 +342,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, local_network_gateway_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, local_network_gateway_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a local network gateway tags. :param resource_group_name: The name of the resource group. @@ -387,13 +353,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - LocalNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.LocalNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.LocalNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -404,30 +373,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('LocalNetworkGateway', response) if raw: @@ -436,12 +383,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -463,7 +412,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -509,3 +458,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_interface_ip_configurations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_interface_ip_configurations_operations.py index d3c4ff601550..6eac76762409 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_interface_ip_configurations_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_interface_ip_configurations_operations.py @@ -22,7 +22,7 @@ class NetworkInterfaceIPConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations'} def get( self, resource_group_name, network_interface_name, ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -130,7 +131,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -172,3 +173,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_interface_load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_interface_load_balancers_operations.py index c585f91bbcac..4955e9ca57af 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_interface_load_balancers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_interface_load_balancers_operations.py @@ -22,7 +22,7 @@ class NetworkInterfaceLoadBalancersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -106,3 +106,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_interfaces_operations.py index ba0940d12b6c..d8523c5cf63e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_interfaces_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkInterfacesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ models = models @@ -43,7 +43,7 @@ def _delete_initial( api_version = "2017-11-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network interface. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def get( self, resource_group_name, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( api_version = "2017-11-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -203,6 +185,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def _create_or_update_initial( @@ -210,7 +193,7 @@ def _create_or_update_initial( api_version = "2017-11-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network interface. :param resource_group_name: The name of the resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_11_01.models.NetworkInterface :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkInterface or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.NetworkInterface] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.NetworkInterface]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkInterface', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def _update_tags_initial( @@ -335,7 +301,7 @@ def _update_tags_initial( api_version = "2017-11-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -382,7 +348,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, network_interface_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a network interface tags. :param resource_group_name: The name of the resource group. @@ -392,13 +358,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkInterface or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.NetworkInterface] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.NetworkInterface]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -409,30 +378,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NetworkInterface', response) if raw: @@ -441,12 +388,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -468,7 +417,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -513,6 +462,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -536,7 +486,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -582,6 +532,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} def _get_effective_route_table_initial( @@ -589,7 +540,7 @@ def _get_effective_route_table_initial( api_version = "2017-11-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable' + url = self.get_effective_route_table.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -632,7 +583,7 @@ def _get_effective_route_table_initial( return deserialized def get_effective_route_table( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all route tables applied to a network interface. :param resource_group_name: The name of the resource group. @@ -640,13 +591,17 @@ def get_effective_route_table( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveRouteListResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.EffectiveRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.EffectiveRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_effective_route_table_initial( @@ -656,30 +611,8 @@ def get_effective_route_table( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveRouteListResult', response) if raw: @@ -688,12 +621,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_effective_route_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} def _list_effective_network_security_groups_initial( @@ -701,7 +636,7 @@ def _list_effective_network_security_groups_initial( api_version = "2017-11-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups' + url = self.list_effective_network_security_groups.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), @@ -744,7 +679,7 @@ def _list_effective_network_security_groups_initial( return deserialized def list_effective_network_security_groups( - self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets all network security groups applied to a network interface. :param resource_group_name: The name of the resource group. @@ -752,14 +687,18 @@ def list_effective_network_security_groups( :param network_interface_name: The name of the network interface. :type network_interface_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - EffectiveNetworkSecurityGroupListResult or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveNetworkSecurityGroupListResult or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.EffectiveNetworkSecurityGroupListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.EffectiveNetworkSecurityGroupListResult]] :raises: :class:`CloudError` """ raw_result = self._list_effective_network_security_groups_initial( @@ -769,30 +708,8 @@ def list_effective_network_security_groups( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', response) if raw: @@ -801,12 +718,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_effective_network_security_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} def list_virtual_machine_scale_set_vm_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, custom_headers=None, raw=False, **operation_config): @@ -836,7 +755,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces' + url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -884,6 +803,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} def list_virtual_machine_scale_set_network_interfaces( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -910,7 +830,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces' + url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -957,6 +877,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} def get_virtual_machine_scale_set_network_interface( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -986,7 +907,7 @@ def get_virtual_machine_scale_set_network_interface( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}' + url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -1031,6 +952,7 @@ def get_virtual_machine_scale_set_network_interface( return client_raw_response return deserialized + get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} def list_virtual_machine_scale_set_ip_configurations( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -1064,7 +986,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations' + url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -1115,6 +1037,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_ip_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations'} def get_virtual_machine_scale_set_ip_configuration( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -1149,7 +1072,7 @@ def get_virtual_machine_scale_set_ip_configuration( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}' + url = self.get_virtual_machine_scale_set_ip_configuration.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -1195,3 +1118,4 @@ def get_virtual_machine_scale_set_ip_configuration( return client_raw_response return deserialized + get_virtual_machine_scale_set_ip_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_security_groups_operations.py index df35bc03b584..81217d24d381 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_security_groups_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_security_groups_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkSecurityGroupsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security group. :param resource_group_name: The name of the resource group. @@ -88,12 +88,14 @@ def delete( group. :type network_security_group_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -103,40 +105,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def get( self, resource_group_name, network_security_group_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -203,12 +185,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -257,7 +240,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a network security group in the specified resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroup :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('NetworkSecurityGroup', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def _update_tags_initial( @@ -333,7 +299,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -380,7 +346,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, network_security_group_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a network security group tags. :param resource_group_name: The name of the resource group. @@ -391,13 +357,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NetworkSecurityGroup or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroup] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.NetworkSecurityGroup]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -408,30 +377,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NetworkSecurityGroup', response) if raw: @@ -440,12 +387,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -465,7 +414,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -510,6 +459,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -531,7 +481,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -577,3 +527,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_watchers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_watchers_operations.py index 9d30e302bc2e..444be3d38ff3 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_watchers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/network_watchers_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class NetworkWatchersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -62,7 +62,7 @@ def create_or_update( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -109,6 +109,7 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def get( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -129,7 +130,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -170,12 +171,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def _delete_initial( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -211,7 +213,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network watcher resource. :param resource_group_name: The name of the resource group. @@ -219,12 +221,14 @@ def delete( :param network_watcher_name: The name of the network watcher. :type network_watcher_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -234,40 +238,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def update_tags( self, resource_group_name, network_watcher_name, tags=None, custom_headers=None, raw=False, **operation_config): @@ -292,7 +276,7 @@ def update_tags( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -337,6 +321,7 @@ def update_tags( return client_raw_response return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -358,7 +343,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -404,6 +389,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -423,7 +409,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -468,6 +454,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'} def get_topology( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -492,7 +479,7 @@ def get_topology( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology' + url = self.get_topology.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -537,12 +524,13 @@ def get_topology( return client_raw_response return deserialized + get_topology.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'} def _verify_ip_flow_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify' + url = self.verify_ip_flow.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -591,7 +579,7 @@ def _verify_ip_flow_initial( return deserialized def verify_ip_flow( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Verify IP flow from the specified VM to a location given the currently configured NSG rules. @@ -603,13 +591,17 @@ def verify_ip_flow( :type parameters: ~azure.mgmt.network.v2017_11_01.models.VerificationIPFlowParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VerificationIPFlowResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VerificationIPFlowResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.VerificationIPFlowResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.VerificationIPFlowResult]] :raises: :class:`CloudError` """ raw_result = self._verify_ip_flow_initial( @@ -620,30 +612,8 @@ def verify_ip_flow( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VerificationIPFlowResult', response) if raw: @@ -652,18 +622,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + verify_ip_flow.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} def _get_next_hop_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop' + url = self.get_next_hop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -712,7 +684,7 @@ def _get_next_hop_initial( return deserialized def get_next_hop( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the next hop from the specified VM. :param resource_group_name: The name of the resource group. @@ -724,13 +696,16 @@ def get_next_hop( :type parameters: ~azure.mgmt.network.v2017_11_01.models.NextHopParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - NextHopResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NextHopResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.NextHopResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.NextHopResult]] :raises: :class:`CloudError` """ raw_result = self._get_next_hop_initial( @@ -741,30 +716,8 @@ def get_next_hop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('NextHopResult', response) if raw: @@ -773,12 +726,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_next_hop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} def _get_vm_security_rules_initial( @@ -786,7 +741,7 @@ def _get_vm_security_rules_initial( parameters = models.SecurityGroupViewParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView' + url = self.get_vm_security_rules.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -835,7 +790,7 @@ def _get_vm_security_rules_initial( return deserialized def get_vm_security_rules( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the configured and effective security group rules on the specified VM. @@ -846,13 +801,16 @@ def get_vm_security_rules( :param target_resource_id: ID of the target VM. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - SecurityGroupViewResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityGroupViewResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.SecurityGroupViewResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.SecurityGroupViewResult]] :raises: :class:`CloudError` """ raw_result = self._get_vm_security_rules_initial( @@ -863,30 +821,8 @@ def get_vm_security_rules( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('SecurityGroupViewResult', response) if raw: @@ -895,18 +831,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vm_security_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} def _get_troubleshooting_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot' + url = self.get_troubleshooting.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -955,7 +893,7 @@ def _get_troubleshooting_initial( return deserialized def get_troubleshooting( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Initiate troubleshooting on a specified resource. :param resource_group_name: The name of the resource group. @@ -967,13 +905,16 @@ def get_troubleshooting( :type parameters: ~azure.mgmt.network.v2017_11_01.models.TroubleshootingParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_initial( @@ -984,30 +925,8 @@ def get_troubleshooting( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -1016,12 +935,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} def _get_troubleshooting_result_initial( @@ -1029,7 +950,7 @@ def _get_troubleshooting_result_initial( parameters = models.QueryTroubleshootingParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult' + url = self.get_troubleshooting_result.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1078,7 +999,7 @@ def _get_troubleshooting_result_initial( return deserialized def get_troubleshooting_result( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Get the last completed troubleshooting result on a specified resource. :param resource_group_name: The name of the resource group. @@ -1089,13 +1010,16 @@ def get_troubleshooting_result( troubleshooting result. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - TroubleshootingResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.TroubleshootingResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.TroubleshootingResult]] :raises: :class:`CloudError` """ raw_result = self._get_troubleshooting_result_initial( @@ -1106,30 +1030,8 @@ def get_troubleshooting_result( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('TroubleshootingResult', response) if raw: @@ -1138,18 +1040,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} def _set_flow_log_configuration_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog' + url = self.set_flow_log_configuration.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1198,7 +1102,7 @@ def _set_flow_log_configuration_initial( return deserialized def set_flow_log_configuration( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Configures flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1211,13 +1115,16 @@ def set_flow_log_configuration( :type parameters: ~azure.mgmt.network.v2017_11_01.models.FlowLogInformation :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._set_flow_log_configuration_initial( @@ -1228,30 +1135,8 @@ def set_flow_log_configuration( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1260,12 +1145,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_flow_log_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} def _get_flow_log_status_initial( @@ -1273,7 +1160,7 @@ def _get_flow_log_status_initial( parameters = models.FlowLogStatusParameters(target_resource_id=target_resource_id) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus' + url = self.get_flow_log_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1322,7 +1209,7 @@ def _get_flow_log_status_initial( return deserialized def get_flow_log_status( - self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): """Queries status of flow log on a specified resource. :param resource_group_name: The name of the network watcher resource @@ -1334,13 +1221,16 @@ def get_flow_log_status( logging status. :type target_resource_id: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - FlowLogInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.FlowLogInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.FlowLogInformation]] :raises: :class:`CloudError` """ raw_result = self._get_flow_log_status_initial( @@ -1351,30 +1241,8 @@ def get_flow_log_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('FlowLogInformation', response) if raw: @@ -1383,12 +1251,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_flow_log_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} def _check_connectivity_initial( @@ -1396,7 +1266,7 @@ def _check_connectivity_initial( parameters = models.ConnectivityParameters(source=source, destination=destination) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck' + url = self.check_connectivity.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1445,7 +1315,7 @@ def _check_connectivity_initial( return deserialized def check_connectivity( - self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, polling=True, **operation_config): """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @@ -1462,13 +1332,16 @@ def check_connectivity( :type destination: ~azure.mgmt.network.v2017_11_01.models.ConnectivityDestination :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectivityInformation or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectivityInformation + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ConnectivityInformation] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ConnectivityInformation]] :raises: :class:`CloudError` """ raw_result = self._check_connectivity_initial( @@ -1480,30 +1353,8 @@ def check_connectivity( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectivityInformation', response) if raw: @@ -1512,18 +1363,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + check_connectivity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} def _get_azure_reachability_report_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport' + url = self.get_azure_reachability_report.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1572,7 +1425,7 @@ def _get_azure_reachability_report_initial( return deserialized def get_azure_reachability_report( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Gets the relative latency score for internet service providers from a specified location to Azure regions. @@ -1586,13 +1439,16 @@ def get_azure_reachability_report( :type parameters: ~azure.mgmt.network.v2017_11_01.models.AzureReachabilityReportParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - AzureReachabilityReport or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AzureReachabilityReport + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.AzureReachabilityReport] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.AzureReachabilityReport]] :raises: :class:`CloudError` """ raw_result = self._get_azure_reachability_report_initial( @@ -1603,30 +1459,8 @@ def get_azure_reachability_report( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AzureReachabilityReport', response) if raw: @@ -1635,18 +1469,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_azure_reachability_report.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport'} def _list_available_providers_initial( self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList' + url = self.list_available_providers.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -1695,7 +1531,7 @@ def _list_available_providers_initial( return deserialized def list_available_providers( - self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Lists all available internet service providers for a specified Azure region. @@ -1709,13 +1545,16 @@ def list_available_providers( :type parameters: ~azure.mgmt.network.v2017_11_01.models.AvailableProvidersListParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - AvailableProvidersList or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AvailableProvidersList + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.AvailableProvidersList] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.AvailableProvidersList]] :raises: :class:`CloudError` """ raw_result = self._list_available_providers_initial( @@ -1726,30 +1565,8 @@ def list_available_providers( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('AvailableProvidersList', response) if raw: @@ -1758,9 +1575,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_available_providers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/operations.py index 7703b4e6b083..294038bec3d2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Network/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -96,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Network/operations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/packet_captures_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/packet_captures_operations.py index 9bb395870eef..3aff82b28741 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/packet_captures_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/packet_captures_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PacketCapturesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -91,7 +91,7 @@ def _create_initial( return deserialized def create( - self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create and start a packet capture on the specified VM. :param resource_group_name: The name of the resource group. @@ -104,13 +104,16 @@ def create( operation. :type parameters: ~azure.mgmt.network.v2017_11_01.models.PacketCapture :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PacketCaptureResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.PacketCaptureResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.PacketCaptureResult]] :raises: :class:`CloudError` """ raw_result = self._create_initial( @@ -122,30 +125,8 @@ def create( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureResult', response) if raw: @@ -154,12 +135,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def get( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -224,12 +207,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _delete_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -266,7 +250,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified packet capture session. :param resource_group_name: The name of the resource group. @@ -276,12 +260,14 @@ def delete( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -292,46 +278,26 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} def _stop_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop' + url = self.stop.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -368,7 +334,7 @@ def _stop_initial( return client_raw_response def stop( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stops a specified packet capture session. :param resource_group_name: The name of the resource group. @@ -378,12 +344,14 @@ def stop( :param packet_capture_name: The name of the packet capture session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._stop_initial( @@ -394,46 +362,26 @@ def stop( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} def _get_status_initial( self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus' + url = self.get_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -479,7 +427,7 @@ def _get_status_initial( return deserialized def get_status( - self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): """Query the status of a running packet capture session. :param resource_group_name: The name of the resource group. @@ -490,13 +438,17 @@ def get_status( session. :type packet_capture_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PacketCaptureQueryStatusResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PacketCaptureQueryStatusResult or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.PacketCaptureQueryStatusResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.PacketCaptureQueryStatusResult]] :raises: :class:`CloudError` """ raw_result = self._get_status_initial( @@ -507,30 +459,8 @@ def get_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PacketCaptureQueryStatusResult', response) if raw: @@ -539,12 +469,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} def list( self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): @@ -568,7 +500,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), @@ -615,3 +547,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/public_ip_addresses_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/public_ip_addresses_operations.py index 9aa634c673ff..010633881a5c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/public_ip_addresses_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/public_ip_addresses_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class PublicIPAddressesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. """ models = models @@ -43,7 +43,7 @@ def _delete_initial( api_version = "2017-11-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified public IP address. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param public_ip_address_name: The name of the subnet. :type public_ip_address_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def get( self, resource_group_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -160,7 +142,7 @@ def get( api_version = "2017-11-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -203,6 +185,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def _create_or_update_initial( @@ -210,7 +193,7 @@ def _create_or_update_initial( api_version = "2017-11-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a static or dynamic public IP address. :param resource_group_name: The name of the resource group. @@ -271,13 +254,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_11_01.models.PublicIPAddress :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PublicIPAddress or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.PublicIPAddress] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.PublicIPAddress]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -288,30 +274,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('PublicIPAddress', response) if raw: @@ -320,12 +284,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def _update_tags_initial( @@ -335,7 +301,7 @@ def _update_tags_initial( api_version = "2017-11-01" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), @@ -382,7 +348,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, public_ip_address_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, public_ip_address_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates public IP address tags. :param resource_group_name: The name of the resource group. @@ -392,13 +358,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - PublicIPAddress or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.PublicIPAddress] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.PublicIPAddress]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -409,30 +378,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('PublicIPAddress', response) if raw: @@ -441,12 +388,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -468,7 +417,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -513,6 +462,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -536,7 +486,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -582,6 +532,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} def list_virtual_machine_scale_set_public_ip_addresses( self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): @@ -609,7 +560,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses' + url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -656,6 +607,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses'} def list_virtual_machine_scale_set_vm_public_ip_addresses( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, custom_headers=None, raw=False, **operation_config): @@ -689,7 +641,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses' + url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -739,6 +691,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_virtual_machine_scale_set_vm_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses'} def get_virtual_machine_scale_set_public_ip_address( self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -772,7 +725,7 @@ def get_virtual_machine_scale_set_public_ip_address( api_version = "2017-03-30" # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}' + url = self.get_virtual_machine_scale_set_public_ip_address.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), @@ -819,3 +772,4 @@ def get_virtual_machine_scale_set_public_ip_address( return client_raw_response return deserialized + get_virtual_machine_scale_set_public_ip_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/route_filter_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/route_filter_rules_operations.py index 4a4f9bebbcaa..ecac8e41dd04 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/route_filter_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/route_filter_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFilterRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified rule from a route filter. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param rule_name: The name of the rule. :type rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def get( self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -273,13 +256,16 @@ def create_or_update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_11_01.models.RouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -291,30 +277,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilterRule', response) if raw: @@ -323,18 +287,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def _update_initial( self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -382,7 +348,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route in the specified route filter. :param resource_group_name: The name of the resource group. @@ -396,13 +362,16 @@ def update( :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_11_01.models.PatchRouteFilterRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - RouteFilterRule or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.RouteFilterRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.RouteFilterRule]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -414,30 +383,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilterRule', response) if raw: @@ -446,12 +393,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} def list_by_route_filter( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): @@ -475,7 +424,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules' + url = self.list_by_route_filter.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -522,3 +471,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_route_filter.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/route_filters_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/route_filters_operations.py index 2ff3ae6f2195..65519144024c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/route_filters_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/route_filters_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteFiltersOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route filter. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_filter_name: The name of the route filter. :type route_filter_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def get( self, resource_group_name, route_filter_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _create_or_update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type route_filter_parameters: ~azure.mgmt.network.v2017_11_01.models.RouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteFilter', response) if raw: @@ -316,18 +280,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def _update_initial( self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), @@ -374,7 +340,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route filter in a specified resource group. :param resource_group_name: The name of the resource group. @@ -386,13 +352,16 @@ def update( :type route_filter_parameters: ~azure.mgmt.network.v2017_11_01.models.PatchRouteFilter :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteFilter - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.RouteFilter] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.RouteFilter]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -403,30 +372,8 @@ def update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteFilter', response) if raw: @@ -435,12 +382,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -462,7 +411,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -508,6 +457,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -527,7 +477,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -572,3 +522,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/route_tables_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/route_tables_operations.py index 9254c6a6b84c..d1f760b2a236 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/route_tables_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/route_tables_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RouteTablesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route table. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param route_table_name: The name of the route table. :type route_table_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def get( self, resource_group_name, route_table_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or updates a route table in a specified resource group. :param resource_group_name: The name of the resource group. @@ -266,13 +249,16 @@ def create_or_update( table operation. :type parameters: ~azure.mgmt.network.v2017_11_01.models.RouteTable :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteTable - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.RouteTable] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.RouteTable]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -283,30 +269,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('RouteTable', response) if raw: @@ -315,12 +279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def _update_tags_initial( @@ -328,7 +294,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -375,7 +341,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, route_table_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a route table tags. :param resource_group_name: The name of the resource group. @@ -385,13 +351,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns RouteTable - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.RouteTable] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.RouteTable]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -402,30 +371,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('RouteTable', response) if raw: @@ -434,12 +381,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -461,7 +410,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -507,6 +456,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -526,7 +476,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -571,3 +521,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/routes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/routes_operations.py index ceee3b1c3079..51932a8f1f25 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/routes_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/routes_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RoutesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified route from a route table. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param route_name: The name of the route. :type route_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def get( self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): @@ -162,7 +144,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -204,12 +186,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def _create_or_update_initial( self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -259,7 +242,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a route in the specified route table. :param resource_group_name: The name of the resource group. @@ -272,13 +255,16 @@ def create_or_update( route operation. :type route_parameters: ~azure.mgmt.network.v2017_11_01.models.Route :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Route or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Route or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.Route] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.Route]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -290,30 +276,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Route', response) if raw: @@ -322,12 +286,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} def list( self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): @@ -351,7 +317,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), @@ -398,3 +364,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/security_rules_operations.py index f776f873c8fa..8d2c9a0bc39f 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/security_rules_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/security_rules_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SecurityRulesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified network security rule. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( :param security_rule_name: The name of the security rule. :type security_rule_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def get( self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def _create_or_update_initial( self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a security rule in the specified network security group. @@ -277,13 +260,16 @@ def create_or_update( :type security_rule_parameters: ~azure.mgmt.network.v2017_11_01.models.SecurityRule :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns SecurityRule - or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityRule or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.SecurityRule] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.SecurityRule]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -295,30 +281,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('SecurityRule', response) if raw: @@ -327,12 +291,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} def list( self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): @@ -357,7 +323,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), @@ -404,3 +370,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/subnets_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/subnets_operations.py index 502e12844986..5ebb0be4ae17 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/subnets_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/subnets_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class SubnetsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified subnet. :param resource_group_name: The name of the resource group. @@ -90,12 +90,14 @@ def delete( :param subnet_name: The name of the subnet. :type subnet_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -106,40 +108,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def get( self, resource_group_name, virtual_network_name, subnet_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -208,12 +190,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -263,7 +246,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a subnet in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -276,13 +259,16 @@ def create_or_update( subnet operation. :type subnet_parameters: ~azure.mgmt.network.v2017_11_01.models.Subnet :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Subnet or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Subnet or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.Subnet] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.Subnet]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -294,30 +280,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('Subnet', response) if raw: @@ -326,12 +290,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -355,7 +321,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -402,3 +368,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/usages_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/usages_operations.py index 140c7e45595f..2d6ea888e7f9 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/usages_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/usages_operations.py @@ -22,7 +22,7 @@ class UsagesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -57,7 +57,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages' + url = self.list.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -103,3 +103,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_gateway_connections_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_gateway_connections_operations.py index 3cd9a530e65e..d59d0e575e9c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_gateway_connections_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_gateway_connections_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewayConnectionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway connection in the specified resource group. @@ -106,13 +106,17 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnection :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGatewayConnection or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnection or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnection] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnection]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +127,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGatewayConnection', response) if raw: @@ -155,12 +137,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def get( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -185,7 +169,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -226,12 +210,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -267,7 +252,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network Gateway connection. :param resource_group_name: The name of the resource group. @@ -276,12 +261,14 @@ def delete( virtual network gateway connection. :type virtual_network_gateway_connection_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -291,40 +278,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _update_tags_initial( @@ -332,7 +299,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -379,7 +346,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, virtual_network_gateway_connection_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a virtual network gateway connection tags. :param resource_group_name: The name of the resource group. @@ -390,14 +357,18 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGatewayConnectionListEntity or ClientRawResponse if - raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnectionListEntity or + ClientRawResponse if + raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnectionListEntity] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGatewayConnectionListEntity]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -408,30 +379,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGatewayConnectionListEntity', response) if raw: @@ -440,12 +389,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} def _set_shared_key_initial( @@ -453,7 +404,7 @@ def _set_shared_key_initial( parameters = models.ConnectionSharedKey(value=value) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.set_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -502,7 +453,7 @@ def _set_shared_key_initial( return deserialized def set_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, polling=True, **operation_config): """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -516,13 +467,16 @@ def set_shared_key( :param value: The virtual network connection shared key value. :type value: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectionSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ConnectionSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ConnectionSharedKey]] :raises: :class:`CloudError` """ raw_result = self._set_shared_key_initial( @@ -533,30 +487,8 @@ def set_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('ConnectionSharedKey', response) if raw: @@ -565,12 +497,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def get_shared_key( self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): @@ -594,7 +528,7 @@ def get_shared_key( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey' + url = self.get_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -635,6 +569,7 @@ def get_shared_key( return client_raw_response return deserialized + get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -657,7 +592,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -703,6 +638,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} def _reset_shared_key_initial( @@ -710,7 +646,7 @@ def _reset_shared_key_initial( parameters = models.ConnectionResetSharedKey(key_length=key_length) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset' + url = self.reset_shared_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -757,7 +693,7 @@ def _reset_shared_key_initial( return deserialized def reset_shared_key( - self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, polling=True, **operation_config): """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through @@ -772,13 +708,17 @@ def reset_shared_key( length, should between 1 and 128. :type key_length: int :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - ConnectionResetSharedKey or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConnectionResetSharedKey or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.ConnectionResetSharedKey] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.ConnectionResetSharedKey]] :raises: :class:`CloudError` """ raw_result = self._reset_shared_key_initial( @@ -789,30 +729,8 @@ def reset_shared_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('ConnectionResetSharedKey', response) if raw: @@ -821,9 +739,11 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_gateways_operations.py index b8a7c2c9f481..2d5d677fbc16 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_gateways_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkGatewaysOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _create_or_update_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -92,7 +92,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network gateway in the specified resource group. @@ -106,13 +106,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -123,30 +126,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -155,12 +136,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def get( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -182,7 +165,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -223,12 +206,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def _delete_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -264,7 +248,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network gateway. :param resource_group_name: The name of the resource group. @@ -273,12 +257,14 @@ def delete( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -288,40 +274,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def _update_tags_initial( @@ -329,7 +295,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -376,7 +342,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, virtual_network_gateway_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a virtual network gateway tags. :param resource_group_name: The name of the resource group. @@ -387,13 +353,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -404,30 +373,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -436,12 +383,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -463,7 +412,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -509,6 +458,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} def list_connections( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -534,7 +484,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections' + url = self.list_connections.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -581,12 +531,13 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections'} def _reset_initial( self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset' + url = self.reset.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -631,7 +582,7 @@ def _reset_initial( return deserialized def reset( - self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, polling=True, **operation_config): """Resets the primary of the virtual network gateway in the specified resource group. @@ -644,13 +595,16 @@ def reset( the begin reset of the active-active feature enabled gateway. :type gateway_vip: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkGateway or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkGateway]] :raises: :class:`CloudError` """ raw_result = self._reset_initial( @@ -661,30 +615,8 @@ def reset( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetworkGateway', response) if raw: @@ -693,18 +625,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} def _generatevpnclientpackage_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage' + url = self.generatevpnclientpackage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -751,7 +685,7 @@ def _generatevpnclientpackage_initial( return deserialized def generatevpnclientpackage( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @@ -765,12 +699,14 @@ def generatevpnclientpackage( :type parameters: ~azure.mgmt.network.v2017_11_01.models.VpnClientParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._generatevpnclientpackage_initial( @@ -781,30 +717,8 @@ def generatevpnclientpackage( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -813,18 +727,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} def _generate_vpn_profile_initial( self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile' + url = self.generate_vpn_profile.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -871,7 +787,7 @@ def _generate_vpn_profile_initial( return deserialized def generate_vpn_profile( - self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. @@ -886,12 +802,14 @@ def generate_vpn_profile( :type parameters: ~azure.mgmt.network.v2017_11_01.models.VpnClientParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._generate_vpn_profile_initial( @@ -902,30 +820,8 @@ def generate_vpn_profile( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -934,18 +830,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} def _get_vpn_profile_package_url_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl' + url = self.get_vpn_profile_package_url.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -988,7 +886,7 @@ def _get_vpn_profile_package_url_initial( return deserialized def get_vpn_profile_package_url( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile. @@ -999,12 +897,14 @@ def get_vpn_profile_package_url( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns str or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] :raises: :class:`CloudError` """ raw_result = self._get_vpn_profile_package_url_initial( @@ -1014,30 +914,8 @@ def get_vpn_profile_package_url( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('str', response) if raw: @@ -1046,18 +924,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vpn_profile_package_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'} def _get_bgp_peer_status_initial( self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus' + url = self.get_bgp_peer_status.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1102,7 +982,7 @@ def _get_bgp_peer_status_initial( return deserialized def get_bgp_peer_status( - self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, polling=True, **operation_config): """The GetBgpPeerStatus operation retrieves the status of all BGP peers. :param resource_group_name: The name of the resource group. @@ -1113,13 +993,16 @@ def get_bgp_peer_status( :param peer: The IP address of the peer to retrieve the status of. :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - BgpPeerStatusListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BgpPeerStatusListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.BgpPeerStatusListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.BgpPeerStatusListResult]] :raises: :class:`CloudError` """ raw_result = self._get_bgp_peer_status_initial( @@ -1130,30 +1013,8 @@ def get_bgp_peer_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('BgpPeerStatusListResult', response) if raw: @@ -1162,12 +1023,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_bgp_peer_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} def supported_vpn_devices( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): @@ -1188,7 +1051,7 @@ def supported_vpn_devices( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices' + url = self.supported_vpn_devices.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1229,12 +1092,13 @@ def supported_vpn_devices( return client_raw_response return deserialized + supported_vpn_devices.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices'} def _get_learned_routes_initial( self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes' + url = self.get_learned_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1277,7 +1141,7 @@ def _get_learned_routes_initial( return deserialized def get_learned_routes( - self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. @@ -1287,13 +1151,16 @@ def get_learned_routes( gateway. :type virtual_network_gateway_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_learned_routes_initial( @@ -1303,30 +1170,8 @@ def get_learned_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -1335,18 +1180,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} def _get_advertised_routes_initial( self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes' + url = self.get_advertised_routes.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), @@ -1390,7 +1237,7 @@ def _get_advertised_routes_initial( return deserialized def get_advertised_routes( - self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, polling=True, **operation_config): """This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer. @@ -1402,13 +1249,16 @@ def get_advertised_routes( :param peer: The IP address of the peer :type peer: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - GatewayRouteListResult or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.GatewayRouteListResult] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.GatewayRouteListResult]] :raises: :class:`CloudError` """ raw_result = self._get_advertised_routes_initial( @@ -1419,30 +1269,8 @@ def get_advertised_routes( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('GatewayRouteListResult', response) if raw: @@ -1451,12 +1279,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} def vpn_device_configuration_script( self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -1482,7 +1312,7 @@ def vpn_device_configuration_script( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript' + url = self.vpn_device_configuration_script.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), @@ -1527,3 +1357,4 @@ def vpn_device_configuration_script( return client_raw_response return deserialized + vpn_device_configuration_script.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_peerings_operations.py index fd7d92db519f..13a546d6d149 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_peerings_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_network_peerings_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworkPeeringsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -80,7 +80,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network peering. :param resource_group_name: The name of the resource group. @@ -91,12 +91,14 @@ def delete( peering. :type virtual_network_peering_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -107,40 +109,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def get( self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): @@ -164,7 +146,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -206,12 +188,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -261,7 +244,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a peering in the specified virtual network. :param resource_group_name: The name of the resource group. @@ -275,13 +258,16 @@ def create_or_update( :type virtual_network_peering_parameters: ~azure.mgmt.network.v2017_11_01.models.VirtualNetworkPeering :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkPeering or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkPeering + or ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkPeering] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.VirtualNetworkPeering]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -293,30 +279,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetworkPeering', response) if raw: @@ -325,12 +289,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} def list( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -354,7 +320,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -401,3 +367,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_networks_operations.py b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_networks_operations.py index 5e7f4eb7904f..7bd7c13744f4 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_networks_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/virtual_networks_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class VirtualNetworksOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Client API version. Constant value: "2017-11-01". """ @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer): def _delete_initial( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -79,7 +79,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes the specified virtual network. :param resource_group_name: The name of the resource group. @@ -87,12 +87,14 @@ def delete( :param virtual_network_name: The name of the virtual network. :type virtual_network_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -102,40 +104,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def get( self, resource_group_name, virtual_network_name, expand=None, custom_headers=None, raw=False, **operation_config): @@ -158,7 +140,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -201,12 +183,13 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def _create_or_update_initial( self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -255,7 +238,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a virtual network in the specified resource group. :param resource_group_name: The name of the resource group. @@ -267,13 +250,16 @@ def create_or_update( :type parameters: ~azure.mgmt.network.v2017_11_01.models.VirtualNetwork :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetwork or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetwork] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.VirtualNetwork]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -284,30 +270,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(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 = self._deserialize('VirtualNetwork', response) if raw: @@ -316,12 +280,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def _update_tags_initial( @@ -329,7 +295,7 @@ def _update_tags_initial( parameters = models.TagsObject(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}' + url = self.update_tags.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -376,7 +342,7 @@ def _update_tags_initial( return deserialized def update_tags( - self, resource_group_name, virtual_network_name, tags=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, virtual_network_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a virtual network tags. :param resource_group_name: The name of the resource group. @@ -386,13 +352,16 @@ def update_tags( :param tags: Resource tags. :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetwork or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2017_11_01.models.VirtualNetwork] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2017_11_01.models.VirtualNetwork]] :raises: :class:`CloudError` """ raw_result = self._update_tags_initial( @@ -403,30 +372,8 @@ def update_tags( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('VirtualNetwork', response) if raw: @@ -435,12 +382,14 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} def list_all( self, custom_headers=None, raw=False, **operation_config): @@ -460,7 +409,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks' + url = self.list_all.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -505,6 +454,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'} def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -526,7 +476,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks' + url = self.list.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -572,6 +522,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks'} def check_ip_address_availability( self, resource_group_name, virtual_network_name, ip_address=None, custom_headers=None, raw=False, **operation_config): @@ -595,7 +546,7 @@ def check_ip_address_availability( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability' + url = self.check_ip_address_availability.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -638,6 +589,7 @@ def check_ip_address_availability( return client_raw_response return deserialized + check_ip_address_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'} def list_usage( self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): @@ -661,7 +613,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages' + url = self.list_usage.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), @@ -708,3 +660,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/__init__.py new file mode 100644 index 000000000000..2a2f032f38aa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .network_management_client import NetworkManagementClient +from .version import VERSION + +__all__ = ['NetworkManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/__init__.py new file mode 100644 index 000000000000..a5b3107878cd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/__init__.py @@ -0,0 +1,772 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .sub_resource_py3 import SubResource + from .backend_address_pool_py3 import BackendAddressPool + from .inbound_nat_rule_py3 import InboundNatRule + from .application_security_group_py3 import ApplicationSecurityGroup + from .security_rule_py3 import SecurityRule + from .network_interface_dns_settings_py3 import NetworkInterfaceDnsSettings + from .network_interface_py3 import NetworkInterface + from .network_security_group_py3 import NetworkSecurityGroup + from .route_py3 import Route + from .route_table_py3 import RouteTable + from .service_endpoint_properties_format_py3 import ServiceEndpointPropertiesFormat + from .public_ip_address_sku_py3 import PublicIPAddressSku + from .public_ip_address_dns_settings_py3 import PublicIPAddressDnsSettings + from .ip_tag_py3 import IpTag + from .public_ip_address_py3 import PublicIPAddress + from .ip_configuration_py3 import IPConfiguration + from .resource_navigation_link_py3 import ResourceNavigationLink + from .subnet_py3 import Subnet + from .network_interface_ip_configuration_py3 import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address_py3 import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool_py3 import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining_py3 import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings_py3 import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server_py3 import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings_py3 import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool_py3 import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health_py3 import ApplicationGatewayBackendHealth + from .application_gateway_sku_py3 import ApplicationGatewaySku + from .application_gateway_ssl_policy_py3 import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration_py3 import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate_py3 import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate_py3 import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration_py3 import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port_py3 import ApplicationGatewayFrontendPort + from .application_gateway_http_listener_py3 import ApplicationGatewayHttpListener + from .application_gateway_path_rule_py3 import ApplicationGatewayPathRule + from .application_gateway_probe_health_response_match_py3 import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_probe_py3 import ApplicationGatewayProbe + from .application_gateway_request_routing_rule_py3 import ApplicationGatewayRequestRoutingRule + from .application_gateway_redirect_configuration_py3 import ApplicationGatewayRedirectConfiguration + from .application_gateway_url_path_map_py3 import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group_py3 import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration_py3 import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway_py3 import ApplicationGateway + from .application_gateway_firewall_rule_py3 import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group_py3 import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set_py3 import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result_py3 import ApplicationGatewayAvailableWafRuleSetsResult + from .application_gateway_available_ssl_options_py3 import ApplicationGatewayAvailableSslOptions + from .application_gateway_ssl_predefined_policy_py3 import ApplicationGatewaySslPredefinedPolicy + from .resource_py3 import Resource + from .tags_object_py3 import TagsObject + from .dns_name_availability_result_py3 import DnsNameAvailabilityResult + from .endpoint_service_result_py3 import EndpointServiceResult + from .express_route_circuit_authorization_py3 import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config_py3 import ExpressRouteCircuitPeeringConfig + from .route_filter_rule_py3 import RouteFilterRule + from .express_route_circuit_stats_py3 import ExpressRouteCircuitStats + from .express_route_circuit_peering_py3 import ExpressRouteCircuitPeering + from .route_filter_py3 import RouteFilter + from .ipv6_express_route_circuit_peering_config_py3 import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku_py3 import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties_py3 import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit_py3 import ExpressRouteCircuit + from .express_route_circuit_arp_table_py3 import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result_py3 import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table_py3 import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result_py3 import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary_py3 import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result_py3 import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered_py3 import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider_py3 import ExpressRouteServiceProvider + from .load_balancer_sku_py3 import LoadBalancerSku + from .frontend_ip_configuration_py3 import FrontendIPConfiguration + from .load_balancing_rule_py3 import LoadBalancingRule + from .probe_py3 import Probe + from .inbound_nat_pool_py3 import InboundNatPool + from .outbound_nat_rule_py3 import OutboundNatRule + from .load_balancer_py3 import LoadBalancer + from .error_details_py3 import ErrorDetails + from .error_py3 import Error + from .azure_async_operation_result_py3 import AzureAsyncOperationResult + from .effective_network_security_group_association_py3 import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule_py3 import EffectiveNetworkSecurityRule + from .effective_network_security_group_py3 import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result_py3 import EffectiveNetworkSecurityGroupListResult + from .effective_route_py3 import EffectiveRoute + from .effective_route_list_result_py3 import EffectiveRouteListResult + from .network_watcher_py3 import NetworkWatcher + from .topology_parameters_py3 import TopologyParameters + from .topology_association_py3 import TopologyAssociation + from .topology_resource_py3 import TopologyResource + from .topology_py3 import Topology + from .verification_ip_flow_parameters_py3 import VerificationIPFlowParameters + from .verification_ip_flow_result_py3 import VerificationIPFlowResult + from .next_hop_parameters_py3 import NextHopParameters + from .next_hop_result_py3 import NextHopResult + from .security_group_view_parameters_py3 import SecurityGroupViewParameters + from .network_interface_association_py3 import NetworkInterfaceAssociation + from .subnet_association_py3 import SubnetAssociation + from .security_rule_associations_py3 import SecurityRuleAssociations + from .security_group_network_interface_py3 import SecurityGroupNetworkInterface + from .security_group_view_result_py3 import SecurityGroupViewResult + from .packet_capture_storage_location_py3 import PacketCaptureStorageLocation + from .packet_capture_filter_py3 import PacketCaptureFilter + from .packet_capture_parameters_py3 import PacketCaptureParameters + from .packet_capture_py3 import PacketCapture + from .packet_capture_result_py3 import PacketCaptureResult + from .packet_capture_query_status_result_py3 import PacketCaptureQueryStatusResult + from .troubleshooting_parameters_py3 import TroubleshootingParameters + from .query_troubleshooting_parameters_py3 import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions_py3 import TroubleshootingRecommendedActions + from .troubleshooting_details_py3 import TroubleshootingDetails + from .troubleshooting_result_py3 import TroubleshootingResult + from .retention_policy_parameters_py3 import RetentionPolicyParameters + from .traffic_analytics_configuration_properties_py3 import TrafficAnalyticsConfigurationProperties + from .flow_log_status_parameters_py3 import FlowLogStatusParameters + from .flow_log_information_py3 import FlowLogInformation + from .connectivity_source_py3 import ConnectivitySource + from .connectivity_destination_py3 import ConnectivityDestination + from .connectivity_parameters_py3 import ConnectivityParameters + from .connectivity_issue_py3 import ConnectivityIssue + from .connectivity_hop_py3 import ConnectivityHop + from .connectivity_information_py3 import ConnectivityInformation + from .azure_reachability_report_location_py3 import AzureReachabilityReportLocation + from .azure_reachability_report_parameters_py3 import AzureReachabilityReportParameters + from .azure_reachability_report_latency_info_py3 import AzureReachabilityReportLatencyInfo + from .azure_reachability_report_item_py3 import AzureReachabilityReportItem + from .azure_reachability_report_py3 import AzureReachabilityReport + from .available_providers_list_parameters_py3 import AvailableProvidersListParameters + from .available_providers_list_city_py3 import AvailableProvidersListCity + from .available_providers_list_state_py3 import AvailableProvidersListState + from .available_providers_list_country_py3 import AvailableProvidersListCountry + from .available_providers_list_py3 import AvailableProvidersList + from .connection_monitor_source_py3 import ConnectionMonitorSource + from .connection_monitor_destination_py3 import ConnectionMonitorDestination + from .connection_monitor_parameters_py3 import ConnectionMonitorParameters + from .connection_monitor_py3 import ConnectionMonitor + from .connection_monitor_result_py3 import ConnectionMonitorResult + from .connection_state_snapshot_py3 import ConnectionStateSnapshot + from .connection_monitor_query_result_py3 import ConnectionMonitorQueryResult + from .operation_display_py3 import OperationDisplay + from .availability_py3 import Availability + from .dimension_py3 import Dimension + from .metric_specification_py3 import MetricSpecification + from .log_specification_py3 import LogSpecification + from .operation_properties_format_service_specification_py3 import OperationPropertiesFormatServiceSpecification + from .operation_py3 import Operation + from .patch_route_filter_rule_py3 import PatchRouteFilterRule + from .patch_route_filter_py3 import PatchRouteFilter + from .bgp_community_py3 import BGPCommunity + from .bgp_service_community_py3 import BgpServiceCommunity + from .usage_name_py3 import UsageName + from .usage_py3 import Usage + from .address_space_py3 import AddressSpace + from .virtual_network_peering_py3 import VirtualNetworkPeering + from .dhcp_options_py3 import DhcpOptions + from .virtual_network_py3 import VirtualNetwork + from .ip_address_availability_result_py3 import IPAddressAvailabilityResult + from .virtual_network_usage_name_py3 import VirtualNetworkUsageName + from .virtual_network_usage_py3 import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration_py3 import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku_py3 import VirtualNetworkGatewaySku + from .vpn_client_root_certificate_py3 import VpnClientRootCertificate + from .vpn_client_revoked_certificate_py3 import VpnClientRevokedCertificate + from .vpn_client_configuration_py3 import VpnClientConfiguration + from .bgp_settings_py3 import BgpSettings + from .bgp_peer_status_py3 import BgpPeerStatus + from .gateway_route_py3 import GatewayRoute + from .virtual_network_gateway_py3 import VirtualNetworkGateway + from .vpn_client_parameters_py3 import VpnClientParameters + from .bgp_peer_status_list_result_py3 import BgpPeerStatusListResult + from .gateway_route_list_result_py3 import GatewayRouteListResult + from .tunnel_connection_health_py3 import TunnelConnectionHealth + from .local_network_gateway_py3 import LocalNetworkGateway + from .ipsec_policy_py3 import IpsecPolicy + from .virtual_network_gateway_connection_py3 import VirtualNetworkGatewayConnection + from .connection_reset_shared_key_py3 import ConnectionResetSharedKey + from .connection_shared_key_py3 import ConnectionSharedKey + from .virtual_network_connection_gateway_reference_py3 import VirtualNetworkConnectionGatewayReference + from .virtual_network_gateway_connection_list_entity_py3 import VirtualNetworkGatewayConnectionListEntity + from .vpn_device_script_parameters_py3 import VpnDeviceScriptParameters +except (SyntaxError, ImportError): + from .sub_resource import SubResource + from .backend_address_pool import BackendAddressPool + from .inbound_nat_rule import InboundNatRule + from .application_security_group import ApplicationSecurityGroup + from .security_rule import SecurityRule + from .network_interface_dns_settings import NetworkInterfaceDnsSettings + from .network_interface import NetworkInterface + from .network_security_group import NetworkSecurityGroup + from .route import Route + from .route_table import RouteTable + from .service_endpoint_properties_format import ServiceEndpointPropertiesFormat + from .public_ip_address_sku import PublicIPAddressSku + from .public_ip_address_dns_settings import PublicIPAddressDnsSettings + from .ip_tag import IpTag + from .public_ip_address import PublicIPAddress + from .ip_configuration import IPConfiguration + from .resource_navigation_link import ResourceNavigationLink + from .subnet import Subnet + from .network_interface_ip_configuration import NetworkInterfaceIPConfiguration + from .application_gateway_backend_address import ApplicationGatewayBackendAddress + from .application_gateway_backend_address_pool import ApplicationGatewayBackendAddressPool + from .application_gateway_connection_draining import ApplicationGatewayConnectionDraining + from .application_gateway_backend_http_settings import ApplicationGatewayBackendHttpSettings + from .application_gateway_backend_health_server import ApplicationGatewayBackendHealthServer + from .application_gateway_backend_health_http_settings import ApplicationGatewayBackendHealthHttpSettings + from .application_gateway_backend_health_pool import ApplicationGatewayBackendHealthPool + from .application_gateway_backend_health import ApplicationGatewayBackendHealth + from .application_gateway_sku import ApplicationGatewaySku + from .application_gateway_ssl_policy import ApplicationGatewaySslPolicy + from .application_gateway_ip_configuration import ApplicationGatewayIPConfiguration + from .application_gateway_authentication_certificate import ApplicationGatewayAuthenticationCertificate + from .application_gateway_ssl_certificate import ApplicationGatewaySslCertificate + from .application_gateway_frontend_ip_configuration import ApplicationGatewayFrontendIPConfiguration + from .application_gateway_frontend_port import ApplicationGatewayFrontendPort + from .application_gateway_http_listener import ApplicationGatewayHttpListener + from .application_gateway_path_rule import ApplicationGatewayPathRule + from .application_gateway_probe_health_response_match import ApplicationGatewayProbeHealthResponseMatch + from .application_gateway_probe import ApplicationGatewayProbe + from .application_gateway_request_routing_rule import ApplicationGatewayRequestRoutingRule + from .application_gateway_redirect_configuration import ApplicationGatewayRedirectConfiguration + from .application_gateway_url_path_map import ApplicationGatewayUrlPathMap + from .application_gateway_firewall_disabled_rule_group import ApplicationGatewayFirewallDisabledRuleGroup + from .application_gateway_web_application_firewall_configuration import ApplicationGatewayWebApplicationFirewallConfiguration + from .application_gateway import ApplicationGateway + from .application_gateway_firewall_rule import ApplicationGatewayFirewallRule + from .application_gateway_firewall_rule_group import ApplicationGatewayFirewallRuleGroup + from .application_gateway_firewall_rule_set import ApplicationGatewayFirewallRuleSet + from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult + from .application_gateway_available_ssl_options import ApplicationGatewayAvailableSslOptions + from .application_gateway_ssl_predefined_policy import ApplicationGatewaySslPredefinedPolicy + from .resource import Resource + from .tags_object import TagsObject + from .dns_name_availability_result import DnsNameAvailabilityResult + from .endpoint_service_result import EndpointServiceResult + from .express_route_circuit_authorization import ExpressRouteCircuitAuthorization + from .express_route_circuit_peering_config import ExpressRouteCircuitPeeringConfig + from .route_filter_rule import RouteFilterRule + from .express_route_circuit_stats import ExpressRouteCircuitStats + from .express_route_circuit_peering import ExpressRouteCircuitPeering + from .route_filter import RouteFilter + from .ipv6_express_route_circuit_peering_config import Ipv6ExpressRouteCircuitPeeringConfig + from .express_route_circuit_sku import ExpressRouteCircuitSku + from .express_route_circuit_service_provider_properties import ExpressRouteCircuitServiceProviderProperties + from .express_route_circuit import ExpressRouteCircuit + from .express_route_circuit_arp_table import ExpressRouteCircuitArpTable + from .express_route_circuits_arp_table_list_result import ExpressRouteCircuitsArpTableListResult + from .express_route_circuit_routes_table import ExpressRouteCircuitRoutesTable + from .express_route_circuits_routes_table_list_result import ExpressRouteCircuitsRoutesTableListResult + from .express_route_circuit_routes_table_summary import ExpressRouteCircuitRoutesTableSummary + from .express_route_circuits_routes_table_summary_list_result import ExpressRouteCircuitsRoutesTableSummaryListResult + from .express_route_service_provider_bandwidths_offered import ExpressRouteServiceProviderBandwidthsOffered + from .express_route_service_provider import ExpressRouteServiceProvider + from .load_balancer_sku import LoadBalancerSku + from .frontend_ip_configuration import FrontendIPConfiguration + from .load_balancing_rule import LoadBalancingRule + from .probe import Probe + from .inbound_nat_pool import InboundNatPool + from .outbound_nat_rule import OutboundNatRule + from .load_balancer import LoadBalancer + from .error_details import ErrorDetails + from .error import Error + from .azure_async_operation_result import AzureAsyncOperationResult + from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation + from .effective_network_security_rule import EffectiveNetworkSecurityRule + from .effective_network_security_group import EffectiveNetworkSecurityGroup + from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult + from .effective_route import EffectiveRoute + from .effective_route_list_result import EffectiveRouteListResult + from .network_watcher import NetworkWatcher + from .topology_parameters import TopologyParameters + from .topology_association import TopologyAssociation + from .topology_resource import TopologyResource + from .topology import Topology + from .verification_ip_flow_parameters import VerificationIPFlowParameters + from .verification_ip_flow_result import VerificationIPFlowResult + from .next_hop_parameters import NextHopParameters + from .next_hop_result import NextHopResult + from .security_group_view_parameters import SecurityGroupViewParameters + from .network_interface_association import NetworkInterfaceAssociation + from .subnet_association import SubnetAssociation + from .security_rule_associations import SecurityRuleAssociations + from .security_group_network_interface import SecurityGroupNetworkInterface + from .security_group_view_result import SecurityGroupViewResult + from .packet_capture_storage_location import PacketCaptureStorageLocation + from .packet_capture_filter import PacketCaptureFilter + from .packet_capture_parameters import PacketCaptureParameters + from .packet_capture import PacketCapture + from .packet_capture_result import PacketCaptureResult + from .packet_capture_query_status_result import PacketCaptureQueryStatusResult + from .troubleshooting_parameters import TroubleshootingParameters + from .query_troubleshooting_parameters import QueryTroubleshootingParameters + from .troubleshooting_recommended_actions import TroubleshootingRecommendedActions + from .troubleshooting_details import TroubleshootingDetails + from .troubleshooting_result import TroubleshootingResult + from .retention_policy_parameters import RetentionPolicyParameters + from .traffic_analytics_configuration_properties import TrafficAnalyticsConfigurationProperties + from .flow_log_status_parameters import FlowLogStatusParameters + from .flow_log_information import FlowLogInformation + from .connectivity_source import ConnectivitySource + from .connectivity_destination import ConnectivityDestination + from .connectivity_parameters import ConnectivityParameters + from .connectivity_issue import ConnectivityIssue + from .connectivity_hop import ConnectivityHop + from .connectivity_information import ConnectivityInformation + from .azure_reachability_report_location import AzureReachabilityReportLocation + from .azure_reachability_report_parameters import AzureReachabilityReportParameters + from .azure_reachability_report_latency_info import AzureReachabilityReportLatencyInfo + from .azure_reachability_report_item import AzureReachabilityReportItem + from .azure_reachability_report import AzureReachabilityReport + from .available_providers_list_parameters import AvailableProvidersListParameters + from .available_providers_list_city import AvailableProvidersListCity + from .available_providers_list_state import AvailableProvidersListState + from .available_providers_list_country import AvailableProvidersListCountry + from .available_providers_list import AvailableProvidersList + from .connection_monitor_source import ConnectionMonitorSource + from .connection_monitor_destination import ConnectionMonitorDestination + from .connection_monitor_parameters import ConnectionMonitorParameters + from .connection_monitor import ConnectionMonitor + from .connection_monitor_result import ConnectionMonitorResult + from .connection_state_snapshot import ConnectionStateSnapshot + from .connection_monitor_query_result import ConnectionMonitorQueryResult + from .operation_display import OperationDisplay + from .availability import Availability + from .dimension import Dimension + from .metric_specification import MetricSpecification + from .log_specification import LogSpecification + from .operation_properties_format_service_specification import OperationPropertiesFormatServiceSpecification + from .operation import Operation + from .patch_route_filter_rule import PatchRouteFilterRule + from .patch_route_filter import PatchRouteFilter + from .bgp_community import BGPCommunity + from .bgp_service_community import BgpServiceCommunity + from .usage_name import UsageName + from .usage import Usage + from .address_space import AddressSpace + from .virtual_network_peering import VirtualNetworkPeering + from .dhcp_options import DhcpOptions + from .virtual_network import VirtualNetwork + from .ip_address_availability_result import IPAddressAvailabilityResult + from .virtual_network_usage_name import VirtualNetworkUsageName + from .virtual_network_usage import VirtualNetworkUsage + from .virtual_network_gateway_ip_configuration import VirtualNetworkGatewayIPConfiguration + from .virtual_network_gateway_sku import VirtualNetworkGatewaySku + from .vpn_client_root_certificate import VpnClientRootCertificate + from .vpn_client_revoked_certificate import VpnClientRevokedCertificate + from .vpn_client_configuration import VpnClientConfiguration + from .bgp_settings import BgpSettings + from .bgp_peer_status import BgpPeerStatus + from .gateway_route import GatewayRoute + from .virtual_network_gateway import VirtualNetworkGateway + from .vpn_client_parameters import VpnClientParameters + from .bgp_peer_status_list_result import BgpPeerStatusListResult + from .gateway_route_list_result import GatewayRouteListResult + from .tunnel_connection_health import TunnelConnectionHealth + from .local_network_gateway import LocalNetworkGateway + from .ipsec_policy import IpsecPolicy + from .virtual_network_gateway_connection import VirtualNetworkGatewayConnection + from .connection_reset_shared_key import ConnectionResetSharedKey + from .connection_shared_key import ConnectionSharedKey + from .virtual_network_connection_gateway_reference import VirtualNetworkConnectionGatewayReference + from .virtual_network_gateway_connection_list_entity import VirtualNetworkGatewayConnectionListEntity + from .vpn_device_script_parameters import VpnDeviceScriptParameters +from .application_gateway_paged import ApplicationGatewayPaged +from .application_gateway_ssl_predefined_policy_paged import ApplicationGatewaySslPredefinedPolicyPaged +from .application_security_group_paged import ApplicationSecurityGroupPaged +from .endpoint_service_result_paged import EndpointServiceResultPaged +from .express_route_circuit_authorization_paged import ExpressRouteCircuitAuthorizationPaged +from .express_route_circuit_peering_paged import ExpressRouteCircuitPeeringPaged +from .express_route_circuit_paged import ExpressRouteCircuitPaged +from .express_route_service_provider_paged import ExpressRouteServiceProviderPaged +from .load_balancer_paged import LoadBalancerPaged +from .backend_address_pool_paged import BackendAddressPoolPaged +from .frontend_ip_configuration_paged import FrontendIPConfigurationPaged +from .inbound_nat_rule_paged import InboundNatRulePaged +from .load_balancing_rule_paged import LoadBalancingRulePaged +from .network_interface_paged import NetworkInterfacePaged +from .probe_paged import ProbePaged +from .network_interface_ip_configuration_paged import NetworkInterfaceIPConfigurationPaged +from .network_security_group_paged import NetworkSecurityGroupPaged +from .security_rule_paged import SecurityRulePaged +from .network_watcher_paged import NetworkWatcherPaged +from .packet_capture_result_paged import PacketCaptureResultPaged +from .connection_monitor_result_paged import ConnectionMonitorResultPaged +from .operation_paged import OperationPaged +from .public_ip_address_paged import PublicIPAddressPaged +from .route_filter_paged import RouteFilterPaged +from .route_filter_rule_paged import RouteFilterRulePaged +from .route_table_paged import RouteTablePaged +from .route_paged import RoutePaged +from .bgp_service_community_paged import BgpServiceCommunityPaged +from .usage_paged import UsagePaged +from .virtual_network_paged import VirtualNetworkPaged +from .virtual_network_usage_paged import VirtualNetworkUsagePaged +from .subnet_paged import SubnetPaged +from .virtual_network_peering_paged import VirtualNetworkPeeringPaged +from .virtual_network_gateway_paged import VirtualNetworkGatewayPaged +from .virtual_network_gateway_connection_list_entity_paged import VirtualNetworkGatewayConnectionListEntityPaged +from .virtual_network_gateway_connection_paged import VirtualNetworkGatewayConnectionPaged +from .local_network_gateway_paged import LocalNetworkGatewayPaged +from .network_management_client_enums import ( + TransportProtocol, + IPAllocationMethod, + IPVersion, + SecurityRuleProtocol, + SecurityRuleAccess, + SecurityRuleDirection, + RouteNextHopType, + PublicIPAddressSkuName, + ApplicationGatewayProtocol, + ApplicationGatewayCookieBasedAffinity, + ApplicationGatewayBackendHealthServerHealth, + ApplicationGatewaySkuName, + ApplicationGatewayTier, + ApplicationGatewaySslProtocol, + ApplicationGatewaySslPolicyType, + ApplicationGatewaySslPolicyName, + ApplicationGatewaySslCipherSuite, + ApplicationGatewayRequestRoutingRuleType, + ApplicationGatewayRedirectType, + ApplicationGatewayOperationalState, + ApplicationGatewayFirewallMode, + AuthorizationUseStatus, + ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, + Access, + ExpressRouteCircuitPeeringType, + ExpressRouteCircuitPeeringState, + ExpressRouteCircuitSkuTier, + ExpressRouteCircuitSkuFamily, + ServiceProviderProvisioningState, + LoadBalancerSkuName, + LoadDistribution, + ProbeProtocol, + NetworkOperationStatus, + EffectiveSecurityRuleProtocol, + EffectiveRouteSource, + EffectiveRouteState, + ProvisioningState, + AssociationType, + Direction, + Protocol, + NextHopType, + PcProtocol, + PcStatus, + PcError, + Origin, + Severity, + IssueType, + ConnectionStatus, + ConnectionState, + EvaluationState, + VirtualNetworkPeeringState, + VirtualNetworkGatewayType, + VpnType, + VirtualNetworkGatewaySkuName, + VirtualNetworkGatewaySkuTier, + VpnClientProtocol, + BgpPeerState, + ProcessorArchitecture, + AuthenticationMethod, + VirtualNetworkGatewayConnectionStatus, + VirtualNetworkGatewayConnectionType, + IpsecEncryption, + IpsecIntegrity, + IkeEncryption, + IkeIntegrity, + DhGroup, + PfsGroup, +) + +__all__ = [ + 'SubResource', + 'BackendAddressPool', + 'InboundNatRule', + 'ApplicationSecurityGroup', + 'SecurityRule', + 'NetworkInterfaceDnsSettings', + 'NetworkInterface', + 'NetworkSecurityGroup', + 'Route', + 'RouteTable', + 'ServiceEndpointPropertiesFormat', + 'PublicIPAddressSku', + 'PublicIPAddressDnsSettings', + 'IpTag', + 'PublicIPAddress', + 'IPConfiguration', + 'ResourceNavigationLink', + 'Subnet', + 'NetworkInterfaceIPConfiguration', + 'ApplicationGatewayBackendAddress', + 'ApplicationGatewayBackendAddressPool', + 'ApplicationGatewayConnectionDraining', + 'ApplicationGatewayBackendHttpSettings', + 'ApplicationGatewayBackendHealthServer', + 'ApplicationGatewayBackendHealthHttpSettings', + 'ApplicationGatewayBackendHealthPool', + 'ApplicationGatewayBackendHealth', + 'ApplicationGatewaySku', + 'ApplicationGatewaySslPolicy', + 'ApplicationGatewayIPConfiguration', + 'ApplicationGatewayAuthenticationCertificate', + 'ApplicationGatewaySslCertificate', + 'ApplicationGatewayFrontendIPConfiguration', + 'ApplicationGatewayFrontendPort', + 'ApplicationGatewayHttpListener', + 'ApplicationGatewayPathRule', + 'ApplicationGatewayProbeHealthResponseMatch', + 'ApplicationGatewayProbe', + 'ApplicationGatewayRequestRoutingRule', + 'ApplicationGatewayRedirectConfiguration', + 'ApplicationGatewayUrlPathMap', + 'ApplicationGatewayFirewallDisabledRuleGroup', + 'ApplicationGatewayWebApplicationFirewallConfiguration', + 'ApplicationGateway', + 'ApplicationGatewayFirewallRule', + 'ApplicationGatewayFirewallRuleGroup', + 'ApplicationGatewayFirewallRuleSet', + 'ApplicationGatewayAvailableWafRuleSetsResult', + 'ApplicationGatewayAvailableSslOptions', + 'ApplicationGatewaySslPredefinedPolicy', + 'Resource', + 'TagsObject', + 'DnsNameAvailabilityResult', + 'EndpointServiceResult', + 'ExpressRouteCircuitAuthorization', + 'ExpressRouteCircuitPeeringConfig', + 'RouteFilterRule', + 'ExpressRouteCircuitStats', + 'ExpressRouteCircuitPeering', + 'RouteFilter', + 'Ipv6ExpressRouteCircuitPeeringConfig', + 'ExpressRouteCircuitSku', + 'ExpressRouteCircuitServiceProviderProperties', + 'ExpressRouteCircuit', + 'ExpressRouteCircuitArpTable', + 'ExpressRouteCircuitsArpTableListResult', + 'ExpressRouteCircuitRoutesTable', + 'ExpressRouteCircuitsRoutesTableListResult', + 'ExpressRouteCircuitRoutesTableSummary', + 'ExpressRouteCircuitsRoutesTableSummaryListResult', + 'ExpressRouteServiceProviderBandwidthsOffered', + 'ExpressRouteServiceProvider', + 'LoadBalancerSku', + 'FrontendIPConfiguration', + 'LoadBalancingRule', + 'Probe', + 'InboundNatPool', + 'OutboundNatRule', + 'LoadBalancer', + 'ErrorDetails', + 'Error', + 'AzureAsyncOperationResult', + 'EffectiveNetworkSecurityGroupAssociation', + 'EffectiveNetworkSecurityRule', + 'EffectiveNetworkSecurityGroup', + 'EffectiveNetworkSecurityGroupListResult', + 'EffectiveRoute', + 'EffectiveRouteListResult', + 'NetworkWatcher', + 'TopologyParameters', + 'TopologyAssociation', + 'TopologyResource', + 'Topology', + 'VerificationIPFlowParameters', + 'VerificationIPFlowResult', + 'NextHopParameters', + 'NextHopResult', + 'SecurityGroupViewParameters', + 'NetworkInterfaceAssociation', + 'SubnetAssociation', + 'SecurityRuleAssociations', + 'SecurityGroupNetworkInterface', + 'SecurityGroupViewResult', + 'PacketCaptureStorageLocation', + 'PacketCaptureFilter', + 'PacketCaptureParameters', + 'PacketCapture', + 'PacketCaptureResult', + 'PacketCaptureQueryStatusResult', + 'TroubleshootingParameters', + 'QueryTroubleshootingParameters', + 'TroubleshootingRecommendedActions', + 'TroubleshootingDetails', + 'TroubleshootingResult', + 'RetentionPolicyParameters', + 'TrafficAnalyticsConfigurationProperties', + 'FlowLogStatusParameters', + 'FlowLogInformation', + 'ConnectivitySource', + 'ConnectivityDestination', + 'ConnectivityParameters', + 'ConnectivityIssue', + 'ConnectivityHop', + 'ConnectivityInformation', + 'AzureReachabilityReportLocation', + 'AzureReachabilityReportParameters', + 'AzureReachabilityReportLatencyInfo', + 'AzureReachabilityReportItem', + 'AzureReachabilityReport', + 'AvailableProvidersListParameters', + 'AvailableProvidersListCity', + 'AvailableProvidersListState', + 'AvailableProvidersListCountry', + 'AvailableProvidersList', + 'ConnectionMonitorSource', + 'ConnectionMonitorDestination', + 'ConnectionMonitorParameters', + 'ConnectionMonitor', + 'ConnectionMonitorResult', + 'ConnectionStateSnapshot', + 'ConnectionMonitorQueryResult', + 'OperationDisplay', + 'Availability', + 'Dimension', + 'MetricSpecification', + 'LogSpecification', + 'OperationPropertiesFormatServiceSpecification', + 'Operation', + 'PatchRouteFilterRule', + 'PatchRouteFilter', + 'BGPCommunity', + 'BgpServiceCommunity', + 'UsageName', + 'Usage', + 'AddressSpace', + 'VirtualNetworkPeering', + 'DhcpOptions', + 'VirtualNetwork', + 'IPAddressAvailabilityResult', + 'VirtualNetworkUsageName', + 'VirtualNetworkUsage', + 'VirtualNetworkGatewayIPConfiguration', + 'VirtualNetworkGatewaySku', + 'VpnClientRootCertificate', + 'VpnClientRevokedCertificate', + 'VpnClientConfiguration', + 'BgpSettings', + 'BgpPeerStatus', + 'GatewayRoute', + 'VirtualNetworkGateway', + 'VpnClientParameters', + 'BgpPeerStatusListResult', + 'GatewayRouteListResult', + 'TunnelConnectionHealth', + 'LocalNetworkGateway', + 'IpsecPolicy', + 'VirtualNetworkGatewayConnection', + 'ConnectionResetSharedKey', + 'ConnectionSharedKey', + 'VirtualNetworkConnectionGatewayReference', + 'VirtualNetworkGatewayConnectionListEntity', + 'VpnDeviceScriptParameters', + 'ApplicationGatewayPaged', + 'ApplicationGatewaySslPredefinedPolicyPaged', + 'ApplicationSecurityGroupPaged', + 'EndpointServiceResultPaged', + 'ExpressRouteCircuitAuthorizationPaged', + 'ExpressRouteCircuitPeeringPaged', + 'ExpressRouteCircuitPaged', + 'ExpressRouteServiceProviderPaged', + 'LoadBalancerPaged', + 'BackendAddressPoolPaged', + 'FrontendIPConfigurationPaged', + 'InboundNatRulePaged', + 'LoadBalancingRulePaged', + 'NetworkInterfacePaged', + 'ProbePaged', + 'NetworkInterfaceIPConfigurationPaged', + 'NetworkSecurityGroupPaged', + 'SecurityRulePaged', + 'NetworkWatcherPaged', + 'PacketCaptureResultPaged', + 'ConnectionMonitorResultPaged', + 'OperationPaged', + 'PublicIPAddressPaged', + 'RouteFilterPaged', + 'RouteFilterRulePaged', + 'RouteTablePaged', + 'RoutePaged', + 'BgpServiceCommunityPaged', + 'UsagePaged', + 'VirtualNetworkPaged', + 'VirtualNetworkUsagePaged', + 'SubnetPaged', + 'VirtualNetworkPeeringPaged', + 'VirtualNetworkGatewayPaged', + 'VirtualNetworkGatewayConnectionListEntityPaged', + 'VirtualNetworkGatewayConnectionPaged', + 'LocalNetworkGatewayPaged', + 'TransportProtocol', + 'IPAllocationMethod', + 'IPVersion', + 'SecurityRuleProtocol', + 'SecurityRuleAccess', + 'SecurityRuleDirection', + 'RouteNextHopType', + 'PublicIPAddressSkuName', + 'ApplicationGatewayProtocol', + 'ApplicationGatewayCookieBasedAffinity', + 'ApplicationGatewayBackendHealthServerHealth', + 'ApplicationGatewaySkuName', + 'ApplicationGatewayTier', + 'ApplicationGatewaySslProtocol', + 'ApplicationGatewaySslPolicyType', + 'ApplicationGatewaySslPolicyName', + 'ApplicationGatewaySslCipherSuite', + 'ApplicationGatewayRequestRoutingRuleType', + 'ApplicationGatewayRedirectType', + 'ApplicationGatewayOperationalState', + 'ApplicationGatewayFirewallMode', + 'AuthorizationUseStatus', + 'ExpressRouteCircuitPeeringAdvertisedPublicPrefixState', + 'Access', + 'ExpressRouteCircuitPeeringType', + 'ExpressRouteCircuitPeeringState', + 'ExpressRouteCircuitSkuTier', + 'ExpressRouteCircuitSkuFamily', + 'ServiceProviderProvisioningState', + 'LoadBalancerSkuName', + 'LoadDistribution', + 'ProbeProtocol', + 'NetworkOperationStatus', + 'EffectiveSecurityRuleProtocol', + 'EffectiveRouteSource', + 'EffectiveRouteState', + 'ProvisioningState', + 'AssociationType', + 'Direction', + 'Protocol', + 'NextHopType', + 'PcProtocol', + 'PcStatus', + 'PcError', + 'Origin', + 'Severity', + 'IssueType', + 'ConnectionStatus', + 'ConnectionState', + 'EvaluationState', + 'VirtualNetworkPeeringState', + 'VirtualNetworkGatewayType', + 'VpnType', + 'VirtualNetworkGatewaySkuName', + 'VirtualNetworkGatewaySkuTier', + 'VpnClientProtocol', + 'BgpPeerState', + 'ProcessorArchitecture', + 'AuthenticationMethod', + 'VirtualNetworkGatewayConnectionStatus', + 'VirtualNetworkGatewayConnectionType', + 'IpsecEncryption', + 'IpsecIntegrity', + 'IkeEncryption', + 'IkeIntegrity', + 'DhGroup', + 'PfsGroup', +] diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/address_space.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/address_space.py new file mode 100644 index 000000000000..fbf42c9e0ade --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/address_space.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AddressSpace(Model): + """AddressSpace contains an array of IP address ranges that can be used by + subnets of the virtual network. + + :param address_prefixes: A list of address blocks reserved for this + virtual network in CIDR notation. + :type address_prefixes: list[str] + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = kwargs.get('address_prefixes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/address_space_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/address_space_py3.py new file mode 100644 index 000000000000..9794cc805efa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/address_space_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AddressSpace(Model): + """AddressSpace contains an array of IP address ranges that can be used by + subnets of the virtual network. + + :param address_prefixes: A list of address blocks reserved for this + virtual network in CIDR notation. + :type address_prefixes: list[str] + """ + + _attribute_map = { + 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, + } + + def __init__(self, *, address_prefixes=None, **kwargs) -> None: + super(AddressSpace, self).__init__(**kwargs) + self.address_prefixes = address_prefixes diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway.py new file mode 100644 index 000000000000..0e7d9770be89 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway.py @@ -0,0 +1,158 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGateway(Resource): + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslPolicy + :ivar operational_state: Operational state of the application gateway + resource. Possible values include: 'Stopped', 'Starting', 'Running', + 'Stopping' + :vartype operational_state: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayOperationalState + :param gateway_ip_configurations: Subnets of application the gateway + resource. + :type gateway_ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayIPConfiguration] + :param authentication_certificates: Authentication certificates of the + application gateway resource. + :type authentication_certificates: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayAuthenticationCertificate] + :param ssl_certificates: SSL certificates of the application gateway + resource. + :type ssl_certificates: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslCertificate] + :param frontend_ip_configurations: Frontend IP addresses of the + application gateway resource. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFrontendIPConfiguration] + :param frontend_ports: Frontend ports of the application gateway resource. + :type frontend_ports: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayProbe] + :param backend_address_pools: Backend address pool of the application + gateway resource. + :type backend_address_pools: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendAddressPool] + :param backend_http_settings_collection: Backend http settings of the + application gateway resource. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHttpSettings] + :param http_listeners: Http listeners of the application gateway resource. + :type http_listeners: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayHttpListener] + :param url_path_maps: URL path map of the application gateway resource. + :type url_path_maps: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application + gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayRequestRoutingRule] + :param redirect_configurations: Redirect configurations of the application + gateway resource. + :type redirect_configurations: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayRedirectConfiguration] + :param web_application_firewall_configuration: Web application firewall + configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param enable_http2: Whether HTTP2 is enabled on the application gateway + resource. + :type enable_http2: bool + :param resource_guid: Resource GUID property of the application gateway + resource. + :type resource_guid: str + :param provisioning_state: Provisioning state of the application gateway + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operational_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, + 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, + 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, + 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, + 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, + 'redirect_configurations': {'key': 'properties.redirectConfigurations', 'type': '[ApplicationGatewayRedirectConfiguration]'}, + 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, + 'enable_http2': {'key': 'properties.enableHttp2', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGateway, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.ssl_policy = kwargs.get('ssl_policy', None) + self.operational_state = None + self.gateway_ip_configurations = kwargs.get('gateway_ip_configurations', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.ssl_certificates = kwargs.get('ssl_certificates', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.frontend_ports = kwargs.get('frontend_ports', None) + self.probes = kwargs.get('probes', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) + self.http_listeners = kwargs.get('http_listeners', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.redirect_configurations = kwargs.get('redirect_configurations', None) + self.web_application_firewall_configuration = kwargs.get('web_application_firewall_configuration', None) + self.enable_http2 = kwargs.get('enable_http2', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_authentication_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_authentication_certificate.py new file mode 100644 index 000000000000..dff594340e59 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_authentication_certificate.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayAuthenticationCertificate(SubResource): + """Authentication certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Certificate public data. + :type data: str + :param provisioning_state: Provisioning state of the authentication + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayAuthenticationCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_authentication_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_authentication_certificate_py3.py new file mode 100644 index 000000000000..f31145eb222c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_authentication_certificate_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayAuthenticationCertificate(SubResource): + """Authentication certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Certificate public data. + :type data: str + :param provisioning_state: Provisioning state of the authentication + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_available_ssl_options.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_available_ssl_options.py new file mode 100644 index 000000000000..a2fbab12ed04 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_available_ssl_options.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayAvailableSslOptions(Resource): + """Response for ApplicationGatewayAvailableSslOptions API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param predefined_policies: List of available Ssl predefined policy. + :type predefined_policies: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param default_policy: Name of the Ssl predefined policy applied by + default to application gateway. Possible values include: + 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type default_policy: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslPolicyName + :param available_cipher_suites: List of available Ssl cipher suites. + :type available_cipher_suites: list[str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslCipherSuite] + :param available_protocols: List of available Ssl protocols. + :type available_protocols: list[str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslProtocol] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'predefined_policies': {'key': 'properties.predefinedPolicies', 'type': '[SubResource]'}, + 'default_policy': {'key': 'properties.defaultPolicy', 'type': 'str'}, + 'available_cipher_suites': {'key': 'properties.availableCipherSuites', 'type': '[str]'}, + 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayAvailableSslOptions, self).__init__(**kwargs) + self.predefined_policies = kwargs.get('predefined_policies', None) + self.default_policy = kwargs.get('default_policy', None) + self.available_cipher_suites = kwargs.get('available_cipher_suites', None) + self.available_protocols = kwargs.get('available_protocols', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_available_ssl_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_available_ssl_options_py3.py new file mode 100644 index 000000000000..1e4fdabbdb6b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_available_ssl_options_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayAvailableSslOptions(Resource): + """Response for ApplicationGatewayAvailableSslOptions API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param predefined_policies: List of available Ssl predefined policy. + :type predefined_policies: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param default_policy: Name of the Ssl predefined policy applied by + default to application gateway. Possible values include: + 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type default_policy: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslPolicyName + :param available_cipher_suites: List of available Ssl cipher suites. + :type available_cipher_suites: list[str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslCipherSuite] + :param available_protocols: List of available Ssl protocols. + :type available_protocols: list[str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslProtocol] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'predefined_policies': {'key': 'properties.predefinedPolicies', 'type': '[SubResource]'}, + 'default_policy': {'key': 'properties.defaultPolicy', 'type': 'str'}, + 'available_cipher_suites': {'key': 'properties.availableCipherSuites', 'type': '[str]'}, + 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, predefined_policies=None, default_policy=None, available_cipher_suites=None, available_protocols=None, **kwargs) -> None: + super(ApplicationGatewayAvailableSslOptions, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.predefined_policies = predefined_policies + self.default_policy = default_policy + self.available_cipher_suites = available_cipher_suites + self.available_protocols = available_protocols diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_available_waf_rule_sets_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_available_waf_rule_sets_result.py new file mode 100644 index 000000000000..b91030367034 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_available_waf_rule_sets_result.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayAvailableWafRuleSetsResult(Model): + """Response for ApplicationGatewayAvailableWafRuleSets API service call. + + :param value: The list of application gateway rule sets. + :type value: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFirewallRuleSet] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_available_waf_rule_sets_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_available_waf_rule_sets_result_py3.py new file mode 100644 index 000000000000..ad794acc2a22 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_available_waf_rule_sets_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayAvailableWafRuleSetsResult(Model): + """Response for ApplicationGatewayAvailableWafRuleSets API service call. + + :param value: The list of application gateway rule sets. + :type value: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFirewallRuleSet] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address.py new file mode 100644 index 000000000000..e7a61fe1705c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendAddress(Model): + """Backend address of an application gateway. + + :param fqdn: Fully qualified domain name (FQDN). + :type fqdn: str + :param ip_address: IP address + :type ip_address: str + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = kwargs.get('fqdn', None) + self.ip_address = kwargs.get('ip_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address_pool.py new file mode 100644 index 000000000000..326d6733a370 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address_pool.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + :param id: Resource ID. + :type id: str + :param backend_ip_configurations: Collection of references to IPs defined + in network interfaces. + :type backend_ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses + :type backend_addresses: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendAddress] + :param provisioning_state: Provisioning state of the backend address pool + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Resource that is unique within a resource group. This name + can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayBackendAddressPool, self).__init__(**kwargs) + self.backend_ip_configurations = kwargs.get('backend_ip_configurations', None) + self.backend_addresses = kwargs.get('backend_addresses', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address_pool_py3.py new file mode 100644 index 000000000000..a2895d0da2a8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address_pool_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendAddressPool(SubResource): + """Backend Address Pool of an application gateway. + + :param id: Resource ID. + :type id: str + :param backend_ip_configurations: Collection of references to IPs defined + in network interfaces. + :type backend_ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration] + :param backend_addresses: Backend addresses + :type backend_addresses: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendAddress] + :param provisioning_state: Provisioning state of the backend address pool + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Resource that is unique within a resource group. This name + can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, backend_ip_configurations=None, backend_addresses=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = backend_ip_configurations + self.backend_addresses = backend_addresses + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address_py3.py new file mode 100644 index 000000000000..d18e476244d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_address_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendAddress(Model): + """Backend address of an application gateway. + + :param fqdn: Fully qualified domain name (FQDN). + :type fqdn: str + :param ip_address: IP address + :type ip_address: str + """ + + _attribute_map = { + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__(self, *, fqdn: str=None, ip_address: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) + self.fqdn = fqdn + self.ip_address = ip_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health.py new file mode 100644 index 000000000000..93bac129b781 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealth(Model): + """List of ApplicationGatewayBackendHealthPool resources. + + :param backend_address_pools: + :type backend_address_pools: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHealthPool] + """ + + _attribute_map = { + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = kwargs.get('backend_address_pools', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_http_settings.py new file mode 100644 index 000000000000..d8bb87701081 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_http_settings.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthHttpSettings(Model): + """Application gateway BackendHealthHttp settings. + + :param backend_http_settings: Reference of an + ApplicationGatewayBackendHttpSettings resource. + :type backend_http_settings: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHealthServer] + """ + + _attribute_map = { + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, + 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.servers = kwargs.get('servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_http_settings_py3.py new file mode 100644 index 000000000000..ba5c1a399530 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_http_settings_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthHttpSettings(Model): + """Application gateway BackendHealthHttp settings. + + :param backend_http_settings: Reference of an + ApplicationGatewayBackendHttpSettings resource. + :type backend_http_settings: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHttpSettings + :param servers: List of ApplicationGatewayBackendHealthServer resources. + :type servers: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHealthServer] + """ + + _attribute_map = { + 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, + 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, + } + + def __init__(self, *, backend_http_settings=None, servers=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) + self.backend_http_settings = backend_http_settings + self.servers = servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_pool.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_pool.py new file mode 100644 index 000000000000..5e85d6902e6e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_pool.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthPool(Model): + """Application gateway BackendHealth pool. + + :param backend_address_pool: Reference of an + ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of + ApplicationGatewayBackendHealthHttpSettings resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_pool_py3.py new file mode 100644 index 000000000000..5ccff553b55a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_pool_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthPool(Model): + """Application gateway BackendHealth pool. + + :param backend_address_pool: Reference of an + ApplicationGatewayBackendAddressPool resource. + :type backend_address_pool: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendAddressPool + :param backend_http_settings_collection: List of + ApplicationGatewayBackendHealthHttpSettings resources. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHealthHttpSettings] + """ + + _attribute_map = { + 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, + 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, + } + + def __init__(self, *, backend_address_pool=None, backend_http_settings_collection=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) + self.backend_address_pool = backend_address_pool + self.backend_http_settings_collection = backend_http_settings_collection diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_py3.py new file mode 100644 index 000000000000..7ffa3fb3f75c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealth(Model): + """List of ApplicationGatewayBackendHealthPool resources. + + :param backend_address_pools: + :type backend_address_pools: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHealthPool] + """ + + _attribute_map = { + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, + } + + def __init__(self, *, backend_address_pools=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) + self.backend_address_pools = backend_address_pools diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_server.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_server.py new file mode 100644 index 000000000000..327825a1de7a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_server.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthServer(Model): + """Application gateway backendhealth http settings. + + :param address: IP address or FQDN of backend server. + :type address: str + :param ip_configuration: Reference of IP configuration of backend server. + :type ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration + :param health: Health of backend server. Possible values include: + 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + :type health: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHealthServerHealth + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'health': {'key': 'health', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + self.ip_configuration = kwargs.get('ip_configuration', None) + self.health = kwargs.get('health', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_server_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_server_py3.py new file mode 100644 index 000000000000..5d961c802c45 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_health_server_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayBackendHealthServer(Model): + """Application gateway backendhealth http settings. + + :param address: IP address or FQDN of backend server. + :type address: str + :param ip_configuration: Reference of IP configuration of backend server. + :type ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration + :param health: Health of backend server. Possible values include: + 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + :type health: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHealthServerHealth + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + 'ip_configuration': {'key': 'ipConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'health': {'key': 'health', 'type': 'str'}, + } + + def __init__(self, *, address: str=None, ip_configuration=None, health=None, **kwargs) -> None: + super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) + self.address = address + self.ip_configuration = ip_configuration + self.health = health diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_http_settings.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_http_settings.py new file mode 100644 index 000000000000..1022cc7f4573 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_http_settings.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendHttpSettings(SubResource): + """Backend address pool settings of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Port + :type port: int + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayProtocol + :param cookie_based_affinity: Cookie based affinity. Possible values + include: 'Enabled', 'Disabled' + :type cookie_based_affinity: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayCookieBasedAffinity + :param request_timeout: Request timeout in seconds. Application Gateway + will fail the request if response is not received within RequestTimeout. + Acceptable values are from 1 second to 86400 seconds. + :type request_timeout: int + :param probe: Probe resource of an application gateway. + :type probe: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param authentication_certificates: Array of references to application + gateway authentication certificates. + :type authentication_certificates: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param connection_draining: Connection draining of the backend http + settings resource. + :type connection_draining: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayConnectionDraining + :param host_name: Host header to be sent to the backend servers. + :type host_name: str + :param pick_host_name_from_backend_address: Whether to pick host header + should be picked from the host name of the backend server. Default value + is false. + :type pick_host_name_from_backend_address: bool + :param affinity_cookie_name: Cookie name to use for the affinity cookie. + :type affinity_cookie_name: str + :param probe_enabled: Whether the probe is enabled. Default value is + false. + :type probe_enabled: bool + :param path: Path which should be used as a prefix for all HTTP requests. + Null means no path will be prefixed. Default value is null. + :type path: str + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, + 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, + 'connection_draining': {'key': 'properties.connectionDraining', 'type': 'ApplicationGatewayConnectionDraining'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'pick_host_name_from_backend_address': {'key': 'properties.pickHostNameFromBackendAddress', 'type': 'bool'}, + 'affinity_cookie_name': {'key': 'properties.affinityCookieName', 'type': 'str'}, + 'probe_enabled': {'key': 'properties.probeEnabled', 'type': 'bool'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayBackendHttpSettings, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.protocol = kwargs.get('protocol', None) + self.cookie_based_affinity = kwargs.get('cookie_based_affinity', None) + self.request_timeout = kwargs.get('request_timeout', None) + self.probe = kwargs.get('probe', None) + self.authentication_certificates = kwargs.get('authentication_certificates', None) + self.connection_draining = kwargs.get('connection_draining', None) + self.host_name = kwargs.get('host_name', None) + self.pick_host_name_from_backend_address = kwargs.get('pick_host_name_from_backend_address', None) + self.affinity_cookie_name = kwargs.get('affinity_cookie_name', None) + self.probe_enabled = kwargs.get('probe_enabled', None) + self.path = kwargs.get('path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_http_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_http_settings_py3.py new file mode 100644 index 000000000000..75c29b420042 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_backend_http_settings_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayBackendHttpSettings(SubResource): + """Backend address pool settings of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Port + :type port: int + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayProtocol + :param cookie_based_affinity: Cookie based affinity. Possible values + include: 'Enabled', 'Disabled' + :type cookie_based_affinity: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayCookieBasedAffinity + :param request_timeout: Request timeout in seconds. Application Gateway + will fail the request if response is not received within RequestTimeout. + Acceptable values are from 1 second to 86400 seconds. + :type request_timeout: int + :param probe: Probe resource of an application gateway. + :type probe: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param authentication_certificates: Array of references to application + gateway authentication certificates. + :type authentication_certificates: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param connection_draining: Connection draining of the backend http + settings resource. + :type connection_draining: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayConnectionDraining + :param host_name: Host header to be sent to the backend servers. + :type host_name: str + :param pick_host_name_from_backend_address: Whether to pick host header + should be picked from the host name of the backend server. Default value + is false. + :type pick_host_name_from_backend_address: bool + :param affinity_cookie_name: Cookie name to use for the affinity cookie. + :type affinity_cookie_name: str + :param probe_enabled: Whether the probe is enabled. Default value is + false. + :type probe_enabled: bool + :param path: Path which should be used as a prefix for all HTTP requests. + Null means no path will be prefixed. Default value is null. + :type path: str + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, + 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, + 'connection_draining': {'key': 'properties.connectionDraining', 'type': 'ApplicationGatewayConnectionDraining'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'pick_host_name_from_backend_address': {'key': 'properties.pickHostNameFromBackendAddress', 'type': 'bool'}, + 'affinity_cookie_name': {'key': 'properties.affinityCookieName', 'type': 'str'}, + 'probe_enabled': {'key': 'properties.probeEnabled', 'type': 'bool'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, protocol=None, cookie_based_affinity=None, request_timeout: int=None, probe=None, authentication_certificates=None, connection_draining=None, host_name: str=None, pick_host_name_from_backend_address: bool=None, affinity_cookie_name: str=None, probe_enabled: bool=None, path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id, **kwargs) + self.port = port + self.protocol = protocol + self.cookie_based_affinity = cookie_based_affinity + self.request_timeout = request_timeout + self.probe = probe + self.authentication_certificates = authentication_certificates + self.connection_draining = connection_draining + self.host_name = host_name + self.pick_host_name_from_backend_address = pick_host_name_from_backend_address + self.affinity_cookie_name = affinity_cookie_name + self.probe_enabled = probe_enabled + self.path = path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_connection_draining.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_connection_draining.py new file mode 100644 index 000000000000..531b3cb05dd3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_connection_draining.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayConnectionDraining(Model): + """Connection draining allows open connections to a backend server to be + active for a specified time after the backend server got removed from the + configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. + :type enabled: bool + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. + :type drain_timeout_in_sec: int + """ + + _validation = { + 'enabled': {'required': True}, + 'drain_timeout_in_sec': {'required': True, 'maximum': 3600, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.drain_timeout_in_sec = kwargs.get('drain_timeout_in_sec', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_connection_draining_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_connection_draining_py3.py new file mode 100644 index 000000000000..c46fb01cae72 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_connection_draining_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayConnectionDraining(Model): + """Connection draining allows open connections to a backend server to be + active for a specified time after the backend server got removed from the + configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether connection draining is enabled or not. + :type enabled: bool + :param drain_timeout_in_sec: Required. The number of seconds connection + draining is active. Acceptable values are from 1 second to 3600 seconds. + :type drain_timeout_in_sec: int + """ + + _validation = { + 'enabled': {'required': True}, + 'drain_timeout_in_sec': {'required': True, 'maximum': 3600, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool, drain_timeout_in_sec: int, **kwargs) -> None: + super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) + self.enabled = enabled + self.drain_timeout_in_sec = drain_timeout_in_sec diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_disabled_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_disabled_rule_group.py new file mode 100644 index 000000000000..085ae3d78c5c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_disabled_rule_group.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallDisabledRuleGroup(Model): + """Allows to disable rules within a rule group or an entire rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. + :type rule_group_name: str + :param rules: The list of rules that will be disabled. If null, all rules + of the rule group will be disabled. + :type rules: list[int] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[int]'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_disabled_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_disabled_rule_group_py3.py new file mode 100644 index 000000000000..44ac696b801c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_disabled_rule_group_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallDisabledRuleGroup(Model): + """Allows to disable rules within a rule group or an entire rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the rule group that will be + disabled. + :type rule_group_name: str + :param rules: The list of rules that will be disabled. If null, all rules + of the rule group will be disabled. + :type rules: list[int] + """ + + _validation = { + 'rule_group_name': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[int]'}, + } + + def __init__(self, *, rule_group_name: str, rules=None, **kwargs) -> None: + super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule.py new file mode 100644 index 000000000000..661b0d146e16 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRule(Model): + """A web application firewall rule. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. + :type rule_id: int + :param description: The description of the web application firewall rule. + :type description: str + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_group.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_group.py new file mode 100644 index 000000000000..3e64f4d7f06d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_group.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRuleGroup(Model): + """A web application firewall rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. + :type rule_group_name: str + :param description: The description of the web application firewall rule + group. + :type description: str + :param rules: Required. The rules of the web application firewall rule + group. + :type rules: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFirewallRule] + """ + + _validation = { + 'rule_group_name': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = kwargs.get('rule_group_name', None) + self.description = kwargs.get('description', None) + self.rules = kwargs.get('rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_group_py3.py new file mode 100644 index 000000000000..fc9bb34c352f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_group_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRuleGroup(Model): + """A web application firewall rule group. + + All required parameters must be populated in order to send to Azure. + + :param rule_group_name: Required. The name of the web application firewall + rule group. + :type rule_group_name: str + :param description: The description of the web application firewall rule + group. + :type description: str + :param rules: Required. The rules of the web application firewall rule + group. + :type rules: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFirewallRule] + """ + + _validation = { + 'rule_group_name': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, + } + + def __init__(self, *, rule_group_name: str, rules, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) + self.rule_group_name = rule_group_name + self.description = description + self.rules = rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_py3.py new file mode 100644 index 000000000000..e332fbd16853 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayFirewallRule(Model): + """A web application firewall rule. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Required. The identifier of the web application firewall + rule. + :type rule_id: int + :param description: The description of the web application firewall rule. + :type description: str + """ + + _validation = { + 'rule_id': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'int'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, rule_id: int, description: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) + self.rule_id = rule_id + self.description = description diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_set.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_set.py new file mode 100644 index 000000000000..421325736b5f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_set.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayFirewallRuleSet(Resource): + """A web application firewall rule set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param provisioning_state: The provisioning state of the web application + firewall rule set. + :type provisioning_state: str + :param rule_set_type: Required. The type of the web application firewall + rule set. + :type rule_set_type: str + :param rule_set_version: Required. The version of the web application + firewall rule set type. + :type rule_set_version: str + :param rule_groups: Required. The rule groups of the web application + firewall rule set. + :type rule_groups: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFirewallRuleGroup] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'rule_groups': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayFirewallRuleSet, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.rule_groups = kwargs.get('rule_groups', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_set_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_set_py3.py new file mode 100644 index 000000000000..cfd251db376e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_firewall_rule_set_py3.py @@ -0,0 +1,73 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGatewayFirewallRuleSet(Resource): + """A web application firewall rule set. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param provisioning_state: The provisioning state of the web application + firewall rule set. + :type provisioning_state: str + :param rule_set_type: Required. The type of the web application firewall + rule set. + :type rule_set_type: str + :param rule_set_version: Required. The version of the web application + firewall rule set type. + :type rule_set_version: str + :param rule_groups: Required. The rule groups of the web application + firewall rule set. + :type rule_groups: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFirewallRuleGroup] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'rule_groups': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, + 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, + } + + def __init__(self, *, rule_set_type: str, rule_set_version: str, rule_groups, id: str=None, location: str=None, tags=None, provisioning_state: str=None, **kwargs) -> None: + super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.rule_groups = rule_groups diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_frontend_ip_configuration.py new file mode 100644 index 000000000000..9cb2df4250af --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_frontend_ip_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): + """Frontend IP configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param private_ip_address: PrivateIPAddress of the network interface IP + Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: PrivateIP allocation method. Possible + values include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2018_01_01.models.IPAllocationMethod + :param subnet: Reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param provisioning_state: Provisioning state of the public IP resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..f684155a0f26 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_frontend_ip_configuration_py3.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendIPConfiguration(SubResource): + """Frontend IP configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param private_ip_address: PrivateIPAddress of the network interface IP + Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: PrivateIP allocation method. Possible + values include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2018_01_01.models.IPAllocationMethod + :param subnet: Reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. + :type public_ip_address: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param provisioning_state: Provisioning state of the public IP resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_frontend_port.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_frontend_port.py new file mode 100644 index 000000000000..318c0554db0a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_frontend_port.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Frontend port + :type port: int + :param provisioning_state: Provisioning state of the frontend port + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayFrontendPort, self).__init__(**kwargs) + self.port = kwargs.get('port', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_frontend_port_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_frontend_port_py3.py new file mode 100644 index 000000000000..03c6c0a31e9c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_frontend_port_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayFrontendPort(SubResource): + """Frontend port of an application gateway. + + :param id: Resource ID. + :type id: str + :param port: Frontend port + :type port: int + :param provisioning_state: Provisioning state of the frontend port + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, port: int=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayFrontendPort, self).__init__(id=id, **kwargs) + self.port = port + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_http_listener.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_http_listener.py new file mode 100644 index 000000000000..68c38c8d7063 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_http_listener.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayHttpListener(SubResource): + """Http listener of an application gateway. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: Frontend IP configuration resource of an + application gateway. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayProtocol + :param host_name: Host name of HTTP listener. + :type host_name: str + :param ssl_certificate: SSL certificate resource of an application + gateway. + :type ssl_certificate: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param require_server_name_indication: Applicable only if protocol is + https. Enables SNI for multi-hosting. + :type require_server_name_indication: bool + :param provisioning_state: Provisioning state of the HTTP listener + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, + 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayHttpListener, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.protocol = kwargs.get('protocol', None) + self.host_name = kwargs.get('host_name', None) + self.ssl_certificate = kwargs.get('ssl_certificate', None) + self.require_server_name_indication = kwargs.get('require_server_name_indication', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_http_listener_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_http_listener_py3.py new file mode 100644 index 000000000000..a02295facebe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_http_listener_py3.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayHttpListener(SubResource): + """Http listener of an application gateway. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: Frontend IP configuration resource of an + application gateway. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param frontend_port: Frontend port resource of an application gateway. + :type frontend_port: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayProtocol + :param host_name: Host name of HTTP listener. + :type host_name: str + :param ssl_certificate: SSL certificate resource of an application + gateway. + :type ssl_certificate: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param require_server_name_indication: Applicable only if protocol is + https. Enables SNI for multi-hosting. + :type require_server_name_indication: bool + :param provisioning_state: Provisioning state of the HTTP listener + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host_name': {'key': 'properties.hostName', 'type': 'str'}, + 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, + 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, frontend_port=None, protocol=None, host_name: str=None, ssl_certificate=None, require_server_name_indication: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayHttpListener, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.frontend_port = frontend_port + self.protocol = protocol + self.host_name = host_name + self.ssl_certificate = ssl_certificate + self.require_server_name_indication = require_server_name_indication + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ip_configuration.py new file mode 100644 index 000000000000..891a28150866 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ip_configuration.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 + private IP configuration is allowed. + + :param id: Resource ID. + :type id: str + :param subnet: Reference of the subnet resource. A subnet from where + application gateway gets its private address. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param provisioning_state: Provisioning state of the application gateway + subnet resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayIPConfiguration, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..acde49d63bb9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ip_configuration_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayIPConfiguration(SubResource): + """IP configuration of an application gateway. Currently 1 public and 1 + private IP configuration is allowed. + + :param id: Resource ID. + :type id: str + :param subnet: Reference of the subnet resource. A subnet from where + application gateway gets its private address. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param provisioning_state: Provisioning state of the application gateway + subnet resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, subnet=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.subnet = subnet + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_paged.py new file mode 100644 index 000000000000..b7734c1bdaaf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ApplicationGatewayPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApplicationGateway ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApplicationGateway]'} + } + + def __init__(self, *args, **kwargs): + + super(ApplicationGatewayPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_path_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_path_rule.py new file mode 100644 index 000000000000..09cb15056ced --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_path_rule.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayPathRule(SubResource): + """Path rule of URL path map of an application gateway. + + :param id: Resource ID. + :type id: str + :param paths: Path rules of URL path map. + :type paths: list[str] + :param backend_address_pool: Backend address pool resource of URL path map + path rule. + :type backend_address_pool: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param backend_http_settings: Backend http settings resource of URL path + map path rule. + :type backend_http_settings: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of URL path + map path rule. + :type redirect_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param provisioning_state: Path rule of URL path map resource. Possible + values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'paths': {'key': 'properties.paths', 'type': '[str]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayPathRule, self).__init__(**kwargs) + self.paths = kwargs.get('paths', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_path_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_path_rule_py3.py new file mode 100644 index 000000000000..4e9502e8baf8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_path_rule_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayPathRule(SubResource): + """Path rule of URL path map of an application gateway. + + :param id: Resource ID. + :type id: str + :param paths: Path rules of URL path map. + :type paths: list[str] + :param backend_address_pool: Backend address pool resource of URL path map + path rule. + :type backend_address_pool: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param backend_http_settings: Backend http settings resource of URL path + map path rule. + :type backend_http_settings: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of URL path + map path rule. + :type redirect_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param provisioning_state: Path rule of URL path map resource. Possible + values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'paths': {'key': 'properties.paths', 'type': '[str]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, paths=None, backend_address_pool=None, backend_http_settings=None, redirect_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayPathRule, self).__init__(id=id, **kwargs) + self.paths = paths + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.redirect_configuration = redirect_configuration + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_probe.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_probe.py new file mode 100644 index 000000000000..d88cec41461d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_probe.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayProbe(SubResource): + """Probe of the application gateway. + + :param id: Resource ID. + :type id: str + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is + sent to ://: + :type path: str + :param interval: The probing interval in seconds. This is the time + interval between two consecutive probes. Acceptable values are from 1 + second to 86400 seconds. + :type interval: int + :param timeout: the probe timeout in seconds. Probe marked as failed if + valid response is not received with this timeout period. Acceptable values + are from 1 second to 86400 seconds. + :type timeout: int + :param unhealthy_threshold: The probe retry count. Backend server is + marked down after consecutive probe failure count reaches + UnhealthyThreshold. Acceptable values are from 1 second to 20. + :type unhealthy_threshold: int + :param pick_host_name_from_backend_http_settings: Whether the host header + should be picked from the backend http settings. Default value is false. + :type pick_host_name_from_backend_http_settings: bool + :param min_servers: Minimum number of servers that are always marked + healthy. Default value is 0. + :type min_servers: int + :param match: Criterion for classifying a healthy probe response. + :type match: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayProbeHealthResponseMatch + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host': {'key': 'properties.host', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, + 'pick_host_name_from_backend_http_settings': {'key': 'properties.pickHostNameFromBackendHttpSettings', 'type': 'bool'}, + 'min_servers': {'key': 'properties.minServers', 'type': 'int'}, + 'match': {'key': 'properties.match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayProbe, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', None) + self.host = kwargs.get('host', None) + self.path = kwargs.get('path', None) + self.interval = kwargs.get('interval', None) + self.timeout = kwargs.get('timeout', None) + self.unhealthy_threshold = kwargs.get('unhealthy_threshold', None) + self.pick_host_name_from_backend_http_settings = kwargs.get('pick_host_name_from_backend_http_settings', None) + self.min_servers = kwargs.get('min_servers', None) + self.match = kwargs.get('match', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_probe_health_response_match.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_probe_health_response_match.py new file mode 100644 index 000000000000..b439b9677f8b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_probe_health_response_match.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayProbeHealthResponseMatch(Model): + """Application gateway probe health response match. + + :param body: Body that must be contained in the health response. Default + value is empty. + :type body: str + :param status_codes: Allowed ranges of healthy status codes. Default range + of healthy status codes is 200-399. + :type status_codes: list[str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'str'}, + 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = kwargs.get('body', None) + self.status_codes = kwargs.get('status_codes', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_probe_health_response_match_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_probe_health_response_match_py3.py new file mode 100644 index 000000000000..6ed2ee8c04ed --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_probe_health_response_match_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayProbeHealthResponseMatch(Model): + """Application gateway probe health response match. + + :param body: Body that must be contained in the health response. Default + value is empty. + :type body: str + :param status_codes: Allowed ranges of healthy status codes. Default range + of healthy status codes is 200-399. + :type status_codes: list[str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'str'}, + 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, + } + + def __init__(self, *, body: str=None, status_codes=None, **kwargs) -> None: + super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) + self.body = body + self.status_codes = status_codes diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_probe_py3.py new file mode 100644 index 000000000000..2b90d6724f2c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayProbe(SubResource): + """Probe of the application gateway. + + :param id: Resource ID. + :type id: str + :param protocol: Protocol. Possible values include: 'Http', 'Https' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayProtocol + :param host: Host name to send the probe to. + :type host: str + :param path: Relative path of probe. Valid path starts from '/'. Probe is + sent to ://: + :type path: str + :param interval: The probing interval in seconds. This is the time + interval between two consecutive probes. Acceptable values are from 1 + second to 86400 seconds. + :type interval: int + :param timeout: the probe timeout in seconds. Probe marked as failed if + valid response is not received with this timeout period. Acceptable values + are from 1 second to 86400 seconds. + :type timeout: int + :param unhealthy_threshold: The probe retry count. Backend server is + marked down after consecutive probe failure count reaches + UnhealthyThreshold. Acceptable values are from 1 second to 20. + :type unhealthy_threshold: int + :param pick_host_name_from_backend_http_settings: Whether the host header + should be picked from the backend http settings. Default value is false. + :type pick_host_name_from_backend_http_settings: bool + :param min_servers: Minimum number of servers that are always marked + healthy. Default value is 0. + :type min_servers: int + :param match: Criterion for classifying a healthy probe response. + :type match: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayProbeHealthResponseMatch + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'host': {'key': 'properties.host', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'interval': {'key': 'properties.interval', 'type': 'int'}, + 'timeout': {'key': 'properties.timeout', 'type': 'int'}, + 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, + 'pick_host_name_from_backend_http_settings': {'key': 'properties.pickHostNameFromBackendHttpSettings', 'type': 'bool'}, + 'min_servers': {'key': 'properties.minServers', 'type': 'int'}, + 'match': {'key': 'properties.match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, protocol=None, host: str=None, path: str=None, interval: int=None, timeout: int=None, unhealthy_threshold: int=None, pick_host_name_from_backend_http_settings: bool=None, min_servers: int=None, match=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayProbe, self).__init__(id=id, **kwargs) + self.protocol = protocol + self.host = host + self.path = path + self.interval = interval + self.timeout = timeout + self.unhealthy_threshold = unhealthy_threshold + self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings + self.min_servers = min_servers + self.match = match + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_py3.py new file mode 100644 index 000000000000..91ee74e54ff2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_py3.py @@ -0,0 +1,158 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationGateway(Resource): + """Application gateway resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: SKU of the application gateway resource. + :type sku: ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySku + :param ssl_policy: SSL policy of the application gateway resource. + :type ssl_policy: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslPolicy + :ivar operational_state: Operational state of the application gateway + resource. Possible values include: 'Stopped', 'Starting', 'Running', + 'Stopping' + :vartype operational_state: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayOperationalState + :param gateway_ip_configurations: Subnets of application the gateway + resource. + :type gateway_ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayIPConfiguration] + :param authentication_certificates: Authentication certificates of the + application gateway resource. + :type authentication_certificates: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayAuthenticationCertificate] + :param ssl_certificates: SSL certificates of the application gateway + resource. + :type ssl_certificates: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslCertificate] + :param frontend_ip_configurations: Frontend IP addresses of the + application gateway resource. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFrontendIPConfiguration] + :param frontend_ports: Frontend ports of the application gateway resource. + :type frontend_ports: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFrontendPort] + :param probes: Probes of the application gateway resource. + :type probes: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayProbe] + :param backend_address_pools: Backend address pool of the application + gateway resource. + :type backend_address_pools: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendAddressPool] + :param backend_http_settings_collection: Backend http settings of the + application gateway resource. + :type backend_http_settings_collection: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHttpSettings] + :param http_listeners: Http listeners of the application gateway resource. + :type http_listeners: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayHttpListener] + :param url_path_maps: URL path map of the application gateway resource. + :type url_path_maps: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayUrlPathMap] + :param request_routing_rules: Request routing rules of the application + gateway resource. + :type request_routing_rules: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayRequestRoutingRule] + :param redirect_configurations: Redirect configurations of the application + gateway resource. + :type redirect_configurations: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayRedirectConfiguration] + :param web_application_firewall_configuration: Web application firewall + configuration. + :type web_application_firewall_configuration: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayWebApplicationFirewallConfiguration + :param enable_http2: Whether HTTP2 is enabled on the application gateway + resource. + :type enable_http2: bool + :param resource_guid: Resource GUID property of the application gateway + resource. + :type resource_guid: str + :param provisioning_state: Provisioning state of the application gateway + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operational_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, + 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, + 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, + 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, + 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, + 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, + 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, + 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, + 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, + 'redirect_configurations': {'key': 'properties.redirectConfigurations', 'type': '[ApplicationGatewayRedirectConfiguration]'}, + 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, + 'enable_http2': {'key': 'properties.enableHttp2', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, ssl_policy=None, gateway_ip_configurations=None, authentication_certificates=None, ssl_certificates=None, frontend_ip_configurations=None, frontend_ports=None, probes=None, backend_address_pools=None, backend_http_settings_collection=None, http_listeners=None, url_path_maps=None, request_routing_rules=None, redirect_configurations=None, web_application_firewall_configuration=None, enable_http2: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.ssl_policy = ssl_policy + self.operational_state = None + self.gateway_ip_configurations = gateway_ip_configurations + self.authentication_certificates = authentication_certificates + self.ssl_certificates = ssl_certificates + self.frontend_ip_configurations = frontend_ip_configurations + self.frontend_ports = frontend_ports + self.probes = probes + self.backend_address_pools = backend_address_pools + self.backend_http_settings_collection = backend_http_settings_collection + self.http_listeners = http_listeners + self.url_path_maps = url_path_maps + self.request_routing_rules = request_routing_rules + self.redirect_configurations = redirect_configurations + self.web_application_firewall_configuration = web_application_firewall_configuration + self.enable_http2 = enable_http2 + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_redirect_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_redirect_configuration.py new file mode 100644 index 000000000000..cf7021f9e96f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_redirect_configuration.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRedirectConfiguration(SubResource): + """Redirect configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param redirect_type: Supported http redirection types - Permanent, + Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', + 'SeeOther', 'Temporary' + :type redirect_type: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayRedirectType + :param target_listener: Reference to a listener to redirect the request + to. + :type target_listener: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param target_url: Url to redirect the request to. + :type target_url: str + :param include_path: Include path in the redirected url. + :type include_path: bool + :param include_query_string: Include query string in the redirected url. + :type include_query_string: bool + :param request_routing_rules: Request routing specifying redirect + configuration. + :type request_routing_rules: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param url_path_maps: Url path maps specifying default redirect + configuration. + :type url_path_maps: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param path_rules: Path rules specifying redirect configuration. + :type path_rules: list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'redirect_type': {'key': 'properties.redirectType', 'type': 'str'}, + 'target_listener': {'key': 'properties.targetListener', 'type': 'SubResource'}, + 'target_url': {'key': 'properties.targetUrl', 'type': 'str'}, + 'include_path': {'key': 'properties.includePath', 'type': 'bool'}, + 'include_query_string': {'key': 'properties.includeQueryString', 'type': 'bool'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[SubResource]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[SubResource]'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[SubResource]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayRedirectConfiguration, self).__init__(**kwargs) + self.redirect_type = kwargs.get('redirect_type', None) + self.target_listener = kwargs.get('target_listener', None) + self.target_url = kwargs.get('target_url', None) + self.include_path = kwargs.get('include_path', None) + self.include_query_string = kwargs.get('include_query_string', None) + self.request_routing_rules = kwargs.get('request_routing_rules', None) + self.url_path_maps = kwargs.get('url_path_maps', None) + self.path_rules = kwargs.get('path_rules', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_redirect_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_redirect_configuration_py3.py new file mode 100644 index 000000000000..1498ab3ecc7f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_redirect_configuration_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRedirectConfiguration(SubResource): + """Redirect configuration of an application gateway. + + :param id: Resource ID. + :type id: str + :param redirect_type: Supported http redirection types - Permanent, + Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', + 'SeeOther', 'Temporary' + :type redirect_type: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayRedirectType + :param target_listener: Reference to a listener to redirect the request + to. + :type target_listener: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param target_url: Url to redirect the request to. + :type target_url: str + :param include_path: Include path in the redirected url. + :type include_path: bool + :param include_query_string: Include query string in the redirected url. + :type include_query_string: bool + :param request_routing_rules: Request routing specifying redirect + configuration. + :type request_routing_rules: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param url_path_maps: Url path maps specifying default redirect + configuration. + :type url_path_maps: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param path_rules: Path rules specifying redirect configuration. + :type path_rules: list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'redirect_type': {'key': 'properties.redirectType', 'type': 'str'}, + 'target_listener': {'key': 'properties.targetListener', 'type': 'SubResource'}, + 'target_url': {'key': 'properties.targetUrl', 'type': 'str'}, + 'include_path': {'key': 'properties.includePath', 'type': 'bool'}, + 'include_query_string': {'key': 'properties.includeQueryString', 'type': 'bool'}, + 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[SubResource]'}, + 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[SubResource]'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[SubResource]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, redirect_type=None, target_listener=None, target_url: str=None, include_path: bool=None, include_query_string: bool=None, request_routing_rules=None, url_path_maps=None, path_rules=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayRedirectConfiguration, self).__init__(id=id, **kwargs) + self.redirect_type = redirect_type + self.target_listener = target_listener + self.target_url = target_url + self.include_path = include_path + self.include_query_string = include_query_string + self.request_routing_rules = request_routing_rules + self.url_path_maps = url_path_maps + self.path_rules = path_rules + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_request_routing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_request_routing_rule.py new file mode 100644 index 000000000000..3fa9bbb78683 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_request_routing_rule.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRequestRoutingRule(SubResource): + """Request routing rule of an application gateway. + + :param id: Resource ID. + :type id: str + :param rule_type: Rule type. Possible values include: 'Basic', + 'PathBasedRouting' + :type rule_type: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayRequestRoutingRuleType + :param backend_address_pool: Backend address pool resource of the + application gateway. + :type backend_address_pool: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param backend_http_settings: Frontend port resource of the application + gateway. + :type backend_http_settings: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of the + application gateway. + :type redirect_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param provisioning_state: Provisioning state of the request routing rule + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, + 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayRequestRoutingRule, self).__init__(**kwargs) + self.rule_type = kwargs.get('rule_type', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.backend_http_settings = kwargs.get('backend_http_settings', None) + self.http_listener = kwargs.get('http_listener', None) + self.url_path_map = kwargs.get('url_path_map', None) + self.redirect_configuration = kwargs.get('redirect_configuration', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_request_routing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_request_routing_rule_py3.py new file mode 100644 index 000000000000..7726a687df5d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_request_routing_rule_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayRequestRoutingRule(SubResource): + """Request routing rule of an application gateway. + + :param id: Resource ID. + :type id: str + :param rule_type: Rule type. Possible values include: 'Basic', + 'PathBasedRouting' + :type rule_type: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayRequestRoutingRuleType + :param backend_address_pool: Backend address pool resource of the + application gateway. + :type backend_address_pool: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param backend_http_settings: Frontend port resource of the application + gateway. + :type backend_http_settings: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param http_listener: Http listener resource of the application gateway. + :type http_listener: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param url_path_map: URL path map resource of the application gateway. + :type url_path_map: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param redirect_configuration: Redirect configuration resource of the + application gateway. + :type redirect_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param provisioning_state: Provisioning state of the request routing rule + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, + 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, + 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, + 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, rule_type=None, backend_address_pool=None, backend_http_settings=None, http_listener=None, url_path_map=None, redirect_configuration=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id, **kwargs) + self.rule_type = rule_type + self.backend_address_pool = backend_address_pool + self.backend_http_settings = backend_http_settings + self.http_listener = http_listener + self.url_path_map = url_path_map + self.redirect_configuration = redirect_configuration + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_sku.py new file mode 100644 index 000000000000..c58fe2a3319f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_sku.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySku(Model): + """SKU of an application gateway. + + :param name: Name of an application gateway SKU. Possible values include: + 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', + 'WAF_Large' + :type name: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySkuName + :param tier: Tier of an application gateway. Possible values include: + 'Standard', 'WAF' + :type tier: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayTier + :param capacity: Capacity (instance count) of an application gateway. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_sku_py3.py new file mode 100644 index 000000000000..070f9ce595d8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_sku_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySku(Model): + """SKU of an application gateway. + + :param name: Name of an application gateway SKU. Possible values include: + 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', + 'WAF_Large' + :type name: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySkuName + :param tier: Tier of an application gateway. Possible values include: + 'Standard', 'WAF' + :type tier: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayTier + :param capacity: Capacity (instance count) of an application gateway. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(ApplicationGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_certificate.py new file mode 100644 index 000000000000..1dfedd4908df --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_certificate.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Base-64 encoded pfx certificate. Only applicable in PUT + Request. + :type data: str + :param password: Password for the pfx file specified in data. Only + applicable in PUT request. + :type password: str + :param public_cert_data: Base-64 encoded Public cert data corresponding to + pfx specified in data. Only applicable in GET request. + :type public_cert_data: str + :param provisioning_state: Provisioning state of the SSL certificate + resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewaySslCertificate, self).__init__(**kwargs) + self.data = kwargs.get('data', None) + self.password = kwargs.get('password', None) + self.public_cert_data = kwargs.get('public_cert_data', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_certificate_py3.py new file mode 100644 index 000000000000..ddb6745c9005 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_certificate_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslCertificate(SubResource): + """SSL certificates of an application gateway. + + :param id: Resource ID. + :type id: str + :param data: Base-64 encoded pfx certificate. Only applicable in PUT + Request. + :type data: str + :param password: Password for the pfx file specified in data. Only + applicable in PUT request. + :type password: str + :param public_cert_data: Base-64 encoded Public cert data corresponding to + pfx specified in data. Only applicable in GET request. + :type public_cert_data: str + :param provisioning_state: Provisioning state of the SSL certificate + resource Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'data': {'key': 'properties.data', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, data: str=None, password: str=None, public_cert_data: str=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewaySslCertificate, self).__init__(id=id, **kwargs) + self.data = data + self.password = password + self.public_cert_data = public_cert_data + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_policy.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_policy.py new file mode 100644 index 000000000000..f465e8562e30 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_policy.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySslPolicy(Model): + """Application Gateway Ssl policy. + + :param disabled_ssl_protocols: Ssl protocols to be disabled on application + gateway. + :type disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslProtocol] + :param policy_type: Type of Ssl Policy. Possible values include: + 'Predefined', 'Custom' + :type policy_type: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslPolicyType + :param policy_name: Name of Ssl predefined policy. Possible values + include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type policy_name: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslPolicyName + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order to application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, + 'policy_type': {'key': 'policyType', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'cipher_suites': {'key': 'cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = kwargs.get('disabled_ssl_protocols', None) + self.policy_type = kwargs.get('policy_type', None) + self.policy_name = kwargs.get('policy_name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_policy_py3.py new file mode 100644 index 000000000000..c4b2a76b15da --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_policy_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewaySslPolicy(Model): + """Application Gateway Ssl policy. + + :param disabled_ssl_protocols: Ssl protocols to be disabled on application + gateway. + :type disabled_ssl_protocols: list[str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslProtocol] + :param policy_type: Type of Ssl Policy. Possible values include: + 'Predefined', 'Custom' + :type policy_type: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslPolicyType + :param policy_name: Name of Ssl predefined policy. Possible values + include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', + 'AppGwSslPolicy20170401S' + :type policy_name: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslPolicyName + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order to application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, + 'policy_type': {'key': 'policyType', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'cipher_suites': {'key': 'cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, *, disabled_ssl_protocols=None, policy_type=None, policy_name=None, cipher_suites=None, min_protocol_version=None, **kwargs) -> None: + super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) + self.disabled_ssl_protocols = disabled_ssl_protocols + self.policy_type = policy_type + self.policy_name = policy_name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_predefined_policy.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_predefined_policy.py new file mode 100644 index 000000000000..f71914547488 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_predefined_policy.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslPredefinedPolicy(SubResource): + """An Ssl predefined policy. + + :param id: Resource ID. + :type id: str + :param name: Name of Ssl predefined policy. + :type name: str + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order for application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.cipher_suites = kwargs.get('cipher_suites', None) + self.min_protocol_version = kwargs.get('min_protocol_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_predefined_policy_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_predefined_policy_paged.py new file mode 100644 index 000000000000..842b5fec8475 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_predefined_policy_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ApplicationGatewaySslPredefinedPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApplicationGatewaySslPredefinedPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApplicationGatewaySslPredefinedPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(ApplicationGatewaySslPredefinedPolicyPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_predefined_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_predefined_policy_py3.py new file mode 100644 index 000000000000..71861c33092f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_ssl_predefined_policy_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewaySslPredefinedPolicy(SubResource): + """An Ssl predefined policy. + + :param id: Resource ID. + :type id: str + :param name: Name of Ssl predefined policy. + :type name: str + :param cipher_suites: Ssl cipher suites to be enabled in the specified + order for application gateway. + :type cipher_suites: list[str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslCipherSuite] + :param min_protocol_version: Minimum version of Ssl protocol to be + supported on application gateway. Possible values include: 'TLSv1_0', + 'TLSv1_1', 'TLSv1_2' + :type min_protocol_version: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslProtocol + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, + 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, name: str=None, cipher_suites=None, min_protocol_version=None, **kwargs) -> None: + super(ApplicationGatewaySslPredefinedPolicy, self).__init__(id=id, **kwargs) + self.name = name + self.cipher_suites = cipher_suites + self.min_protocol_version = min_protocol_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_url_path_map.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_url_path_map.py new file mode 100644 index 000000000000..861f74a79f31 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_url_path_map.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayUrlPathMap(SubResource): + """UrlPathMaps give a url path to the backend mapping information for + PathBasedRouting. + + :param id: Resource ID. + :type id: str + :param default_backend_address_pool: Default backend address pool resource + of URL path map. + :type default_backend_address_pool: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param default_backend_http_settings: Default backend http settings + resource of URL path map. + :type default_backend_http_settings: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param default_redirect_configuration: Default redirect configuration + resource of URL path map. + :type default_redirect_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayPathRule] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, + 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, + 'default_redirect_configuration': {'key': 'properties.defaultRedirectConfiguration', 'type': 'SubResource'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayUrlPathMap, self).__init__(**kwargs) + self.default_backend_address_pool = kwargs.get('default_backend_address_pool', None) + self.default_backend_http_settings = kwargs.get('default_backend_http_settings', None) + self.default_redirect_configuration = kwargs.get('default_redirect_configuration', None) + self.path_rules = kwargs.get('path_rules', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_url_path_map_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_url_path_map_py3.py new file mode 100644 index 000000000000..9d8765eedd4d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_url_path_map_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ApplicationGatewayUrlPathMap(SubResource): + """UrlPathMaps give a url path to the backend mapping information for + PathBasedRouting. + + :param id: Resource ID. + :type id: str + :param default_backend_address_pool: Default backend address pool resource + of URL path map. + :type default_backend_address_pool: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param default_backend_http_settings: Default backend http settings + resource of URL path map. + :type default_backend_http_settings: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param default_redirect_configuration: Default redirect configuration + resource of URL path map. + :type default_redirect_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param path_rules: Path rule of URL path map resource. + :type path_rules: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayPathRule] + :param provisioning_state: Provisioning state of the backend http settings + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param type: Type of the resource. + :type type: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, + 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, + 'default_redirect_configuration': {'key': 'properties.defaultRedirectConfiguration', 'type': 'SubResource'}, + 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, default_backend_address_pool=None, default_backend_http_settings=None, default_redirect_configuration=None, path_rules=None, provisioning_state: str=None, name: str=None, etag: str=None, type: str=None, **kwargs) -> None: + super(ApplicationGatewayUrlPathMap, self).__init__(id=id, **kwargs) + self.default_backend_address_pool = default_backend_address_pool + self.default_backend_http_settings = default_backend_http_settings + self.default_redirect_configuration = default_redirect_configuration + self.path_rules = path_rules + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_web_application_firewall_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_web_application_firewall_configuration.py new file mode 100644 index 000000000000..22d555e7b59c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_web_application_firewall_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayWebApplicationFirewallConfiguration(Model): + """Application gateway web application firewall configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. + :type enabled: bool + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' + :type firewall_mode: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFirewallMode + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. + :type rule_set_type: str + :param rule_set_version: Required. The version of the rule set type. + :type rule_set_version: str + :param disabled_rule_groups: The disabled rule groups. + :type disabled_rule_groups: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFirewallDisabledRuleGroup] + :param request_body_check: Whether allow WAF to check request Body. + :type request_body_check: bool + :param max_request_body_size: Maxium request body size for WAF. + :type max_request_body_size: int + """ + + _validation = { + 'enabled': {'required': True}, + 'firewall_mode': {'required': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'max_request_body_size': {'maximum': 128, 'minimum': 8}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, + 'request_body_check': {'key': 'requestBodyCheck', 'type': 'bool'}, + 'max_request_body_size': {'key': 'maxRequestBodySize', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.firewall_mode = kwargs.get('firewall_mode', None) + self.rule_set_type = kwargs.get('rule_set_type', None) + self.rule_set_version = kwargs.get('rule_set_version', None) + self.disabled_rule_groups = kwargs.get('disabled_rule_groups', None) + self.request_body_check = kwargs.get('request_body_check', None) + self.max_request_body_size = kwargs.get('max_request_body_size', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_web_application_firewall_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_web_application_firewall_configuration_py3.py new file mode 100644 index 000000000000..e2da8d983fff --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_gateway_web_application_firewall_configuration_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ApplicationGatewayWebApplicationFirewallConfiguration(Model): + """Application gateway web application firewall configuration. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the web application firewall is enabled + or not. + :type enabled: bool + :param firewall_mode: Required. Web application firewall mode. Possible + values include: 'Detection', 'Prevention' + :type firewall_mode: str or + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFirewallMode + :param rule_set_type: Required. The type of the web application firewall + rule set. Possible values are: 'OWASP'. + :type rule_set_type: str + :param rule_set_version: Required. The version of the rule set type. + :type rule_set_version: str + :param disabled_rule_groups: The disabled rule groups. + :type disabled_rule_groups: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayFirewallDisabledRuleGroup] + :param request_body_check: Whether allow WAF to check request Body. + :type request_body_check: bool + :param max_request_body_size: Maxium request body size for WAF. + :type max_request_body_size: int + """ + + _validation = { + 'enabled': {'required': True}, + 'firewall_mode': {'required': True}, + 'rule_set_type': {'required': True}, + 'rule_set_version': {'required': True}, + 'max_request_body_size': {'maximum': 128, 'minimum': 8}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, + 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, + 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, + 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, + 'request_body_check': {'key': 'requestBodyCheck', 'type': 'bool'}, + 'max_request_body_size': {'key': 'maxRequestBodySize', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool, firewall_mode, rule_set_type: str, rule_set_version: str, disabled_rule_groups=None, request_body_check: bool=None, max_request_body_size: int=None, **kwargs) -> None: + super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) + self.enabled = enabled + self.firewall_mode = firewall_mode + self.rule_set_type = rule_set_type + self.rule_set_version = rule_set_version + self.disabled_rule_groups = disabled_rule_groups + self.request_body_check = request_body_check + self.max_request_body_size = max_request_body_size diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_security_group.py new file mode 100644 index 000000000000..1372f778ae62 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_security_group.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationSecurityGroup(Resource): + """An application security group in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar resource_guid: The resource GUID property of the application + security group resource. It uniquely identifies a resource, even if the + user changes its name or migrate the resource across subscriptions or + resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the application + security group resource. Possible values are: 'Succeeded', 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationSecurityGroup, self).__init__(**kwargs) + self.resource_guid = None + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_security_group_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_security_group_paged.py new file mode 100644 index 000000000000..590b090a0520 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_security_group_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ApplicationSecurityGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApplicationSecurityGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApplicationSecurityGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(ApplicationSecurityGroupPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_security_group_py3.py new file mode 100644 index 000000000000..f14f84e29b86 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/application_security_group_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ApplicationSecurityGroup(Resource): + """An application security group in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar resource_guid: The resource GUID property of the application + security group resource. It uniquely identifies a resource, even if the + user changes its name or migrate the resource across subscriptions or + resource groups. + :vartype resource_guid: str + :ivar provisioning_state: The provisioning state of the application + security group resource. Possible values are: 'Succeeded', 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource_guid': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(ApplicationSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.resource_guid = None + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/availability.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/availability.py new file mode 100644 index 000000000000..16b7cfa04955 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/availability.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Availability(Model): + """Availability of the metric. + + :param time_grain: The time grain of the availability. + :type time_grain: str + :param retention: The retention of the availability. + :type retention: str + :param blob_duration: Duration of the availability blob. + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Availability, self).__init__(**kwargs) + self.time_grain = kwargs.get('time_grain', None) + self.retention = kwargs.get('retention', None) + self.blob_duration = kwargs.get('blob_duration', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/availability_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/availability_py3.py new file mode 100644 index 000000000000..874d8878184f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/availability_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Availability(Model): + """Availability of the metric. + + :param time_grain: The time grain of the availability. + :type time_grain: str + :param retention: The retention of the availability. + :type retention: str + :param blob_duration: Duration of the availability blob. + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, time_grain: str=None, retention: str=None, blob_duration: str=None, **kwargs) -> None: + super(Availability, self).__init__(**kwargs) + self.time_grain = time_grain + self.retention = retention + self.blob_duration = blob_duration diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list.py new file mode 100644 index 000000000000..422ee89043b0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersList(Model): + """List of available countries with details. + + All required parameters must be populated in order to send to Azure. + + :param countries: Required. List of available countries. + :type countries: + list[~azure.mgmt.network.v2018_01_01.models.AvailableProvidersListCountry] + """ + + _validation = { + 'countries': {'required': True}, + } + + _attribute_map = { + 'countries': {'key': 'countries', 'type': '[AvailableProvidersListCountry]'}, + } + + def __init__(self, **kwargs): + super(AvailableProvidersList, self).__init__(**kwargs) + self.countries = kwargs.get('countries', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_city.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_city.py new file mode 100644 index 000000000000..5f9aa271b981 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_city.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListCity(Model): + """City or town details. + + :param city_name: The city or town name. + :type city_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + """ + + _attribute_map = { + 'city_name': {'key': 'cityName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AvailableProvidersListCity, self).__init__(**kwargs) + self.city_name = kwargs.get('city_name', None) + self.providers = kwargs.get('providers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_city_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_city_py3.py new file mode 100644 index 000000000000..888aa46a7cfc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_city_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListCity(Model): + """City or town details. + + :param city_name: The city or town name. + :type city_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + """ + + _attribute_map = { + 'city_name': {'key': 'cityName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + } + + def __init__(self, *, city_name: str=None, providers=None, **kwargs) -> None: + super(AvailableProvidersListCity, self).__init__(**kwargs) + self.city_name = city_name + self.providers = providers diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_country.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_country.py new file mode 100644 index 000000000000..27bf8892341a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_country.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListCountry(Model): + """Country details. + + :param country_name: The country name. + :type country_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param states: List of available states in the country. + :type states: + list[~azure.mgmt.network.v2018_01_01.models.AvailableProvidersListState] + """ + + _attribute_map = { + 'country_name': {'key': 'countryName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'states': {'key': 'states', 'type': '[AvailableProvidersListState]'}, + } + + def __init__(self, **kwargs): + super(AvailableProvidersListCountry, self).__init__(**kwargs) + self.country_name = kwargs.get('country_name', None) + self.providers = kwargs.get('providers', None) + self.states = kwargs.get('states', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_country_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_country_py3.py new file mode 100644 index 000000000000..b69bc773810e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_country_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListCountry(Model): + """Country details. + + :param country_name: The country name. + :type country_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param states: List of available states in the country. + :type states: + list[~azure.mgmt.network.v2018_01_01.models.AvailableProvidersListState] + """ + + _attribute_map = { + 'country_name': {'key': 'countryName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'states': {'key': 'states', 'type': '[AvailableProvidersListState]'}, + } + + def __init__(self, *, country_name: str=None, providers=None, states=None, **kwargs) -> None: + super(AvailableProvidersListCountry, self).__init__(**kwargs) + self.country_name = country_name + self.providers = providers + self.states = states diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_parameters.py new file mode 100644 index 000000000000..152b3b787c2b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_parameters.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListParameters(Model): + """Constraints that determine the list of available Internet service + providers. + + :param azure_locations: A list of Azure regions. + :type azure_locations: list[str] + :param country: The country for available providers list. + :type country: str + :param state: The state for available providers list. + :type state: str + :param city: The city or town for available providers list. + :type city: str + """ + + _attribute_map = { + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AvailableProvidersListParameters, self).__init__(**kwargs) + self.azure_locations = kwargs.get('azure_locations', None) + self.country = kwargs.get('country', None) + self.state = kwargs.get('state', None) + self.city = kwargs.get('city', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_parameters_py3.py new file mode 100644 index 000000000000..d5c541a7fcb6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_parameters_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListParameters(Model): + """Constraints that determine the list of available Internet service + providers. + + :param azure_locations: A list of Azure regions. + :type azure_locations: list[str] + :param country: The country for available providers list. + :type country: str + :param state: The state for available providers list. + :type state: str + :param city: The city or town for available providers list. + :type city: str + """ + + _attribute_map = { + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__(self, *, azure_locations=None, country: str=None, state: str=None, city: str=None, **kwargs) -> None: + super(AvailableProvidersListParameters, self).__init__(**kwargs) + self.azure_locations = azure_locations + self.country = country + self.state = state + self.city = city diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_py3.py new file mode 100644 index 000000000000..262459a6dc48 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersList(Model): + """List of available countries with details. + + All required parameters must be populated in order to send to Azure. + + :param countries: Required. List of available countries. + :type countries: + list[~azure.mgmt.network.v2018_01_01.models.AvailableProvidersListCountry] + """ + + _validation = { + 'countries': {'required': True}, + } + + _attribute_map = { + 'countries': {'key': 'countries', 'type': '[AvailableProvidersListCountry]'}, + } + + def __init__(self, *, countries, **kwargs) -> None: + super(AvailableProvidersList, self).__init__(**kwargs) + self.countries = countries diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_state.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_state.py new file mode 100644 index 000000000000..7b642ea24d45 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_state.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListState(Model): + """State details. + + :param state_name: The state name. + :type state_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param cities: List of available cities or towns in the state. + :type cities: + list[~azure.mgmt.network.v2018_01_01.models.AvailableProvidersListCity] + """ + + _attribute_map = { + 'state_name': {'key': 'stateName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'cities': {'key': 'cities', 'type': '[AvailableProvidersListCity]'}, + } + + def __init__(self, **kwargs): + super(AvailableProvidersListState, self).__init__(**kwargs) + self.state_name = kwargs.get('state_name', None) + self.providers = kwargs.get('providers', None) + self.cities = kwargs.get('cities', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_state_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_state_py3.py new file mode 100644 index 000000000000..f4ea165929d6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/available_providers_list_state_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProvidersListState(Model): + """State details. + + :param state_name: The state name. + :type state_name: str + :param providers: A list of Internet service providers. + :type providers: list[str] + :param cities: List of available cities or towns in the state. + :type cities: + list[~azure.mgmt.network.v2018_01_01.models.AvailableProvidersListCity] + """ + + _attribute_map = { + 'state_name': {'key': 'stateName', 'type': 'str'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'cities': {'key': 'cities', 'type': '[AvailableProvidersListCity]'}, + } + + def __init__(self, *, state_name: str=None, providers=None, cities=None, **kwargs) -> None: + super(AvailableProvidersListState, self).__init__(**kwargs) + self.state_name = state_name + self.providers = providers + self.cities = cities diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_async_operation_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_async_operation_result.py new file mode 100644 index 000000000000..e355c0108595 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_async_operation_result.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureAsyncOperationResult(Model): + """The response body contains the status of the specified asynchronous + operation, indicating whether it has succeeded, is in progress, or has + failed. Note that this status is distinct from the HTTP status code + returned for the Get Operation Status operation itself. If the asynchronous + operation succeeded, the response body includes the HTTP status code for + the successful request. If the asynchronous operation failed, the response + body includes the HTTP status code for the failed request and error + information regarding the failure. + + :param status: Status of the Azure async operation. Possible values are: + 'InProgress', 'Succeeded', and 'Failed'. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or + ~azure.mgmt.network.v2018_01_01.models.NetworkOperationStatus + :param error: + :type error: ~azure.mgmt.network.v2018_01_01.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, **kwargs): + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_async_operation_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_async_operation_result_py3.py new file mode 100644 index 000000000000..1536bdd31def --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_async_operation_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureAsyncOperationResult(Model): + """The response body contains the status of the specified asynchronous + operation, indicating whether it has succeeded, is in progress, or has + failed. Note that this status is distinct from the HTTP status code + returned for the Get Operation Status operation itself. If the asynchronous + operation succeeded, the response body includes the HTTP status code for + the successful request. If the asynchronous operation failed, the response + body includes the HTTP status code for the failed request and error + information regarding the failure. + + :param status: Status of the Azure async operation. Possible values are: + 'InProgress', 'Succeeded', and 'Failed'. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or + ~azure.mgmt.network.v2018_01_01.models.NetworkOperationStatus + :param error: + :type error: ~azure.mgmt.network.v2018_01_01.models.Error + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, status=None, error=None, **kwargs) -> None: + super(AzureAsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report.py new file mode 100644 index 000000000000..5bfdb1cdbef1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReport(Model): + """Azure reachability report details. + + All required parameters must be populated in order to send to Azure. + + :param aggregation_level: Required. The aggregation level of Azure + reachability report. Can be Country, State or City. + :type aggregation_level: str + :param provider_location: Required. + :type provider_location: + ~azure.mgmt.network.v2018_01_01.models.AzureReachabilityReportLocation + :param reachability_report: Required. List of Azure reachability report + items. + :type reachability_report: + list[~azure.mgmt.network.v2018_01_01.models.AzureReachabilityReportItem] + """ + + _validation = { + 'aggregation_level': {'required': True}, + 'provider_location': {'required': True}, + 'reachability_report': {'required': True}, + } + + _attribute_map = { + 'aggregation_level': {'key': 'aggregationLevel', 'type': 'str'}, + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'reachability_report': {'key': 'reachabilityReport', 'type': '[AzureReachabilityReportItem]'}, + } + + def __init__(self, **kwargs): + super(AzureReachabilityReport, self).__init__(**kwargs) + self.aggregation_level = kwargs.get('aggregation_level', None) + self.provider_location = kwargs.get('provider_location', None) + self.reachability_report = kwargs.get('reachability_report', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_item.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_item.py new file mode 100644 index 000000000000..9e0b0dcfd66c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_item.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportItem(Model): + """Azure reachability report details for a given provider location. + + :param provider: The Internet service provider. + :type provider: str + :param azure_location: The Azure region. + :type azure_location: str + :param latencies: List of latency details for each of the time series. + :type latencies: + list[~azure.mgmt.network.v2018_01_01.models.AzureReachabilityReportLatencyInfo] + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'azure_location': {'key': 'azureLocation', 'type': 'str'}, + 'latencies': {'key': 'latencies', 'type': '[AzureReachabilityReportLatencyInfo]'}, + } + + def __init__(self, **kwargs): + super(AzureReachabilityReportItem, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.azure_location = kwargs.get('azure_location', None) + self.latencies = kwargs.get('latencies', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_item_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_item_py3.py new file mode 100644 index 000000000000..2979ca767369 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_item_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportItem(Model): + """Azure reachability report details for a given provider location. + + :param provider: The Internet service provider. + :type provider: str + :param azure_location: The Azure region. + :type azure_location: str + :param latencies: List of latency details for each of the time series. + :type latencies: + list[~azure.mgmt.network.v2018_01_01.models.AzureReachabilityReportLatencyInfo] + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'azure_location': {'key': 'azureLocation', 'type': 'str'}, + 'latencies': {'key': 'latencies', 'type': '[AzureReachabilityReportLatencyInfo]'}, + } + + def __init__(self, *, provider: str=None, azure_location: str=None, latencies=None, **kwargs) -> None: + super(AzureReachabilityReportItem, self).__init__(**kwargs) + self.provider = provider + self.azure_location = azure_location + self.latencies = latencies diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_latency_info.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_latency_info.py new file mode 100644 index 000000000000..e5f77641a138 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_latency_info.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportLatencyInfo(Model): + """Details on latency for a time series. + + :param time_stamp: The time stamp. + :type time_stamp: datetime + :param score: The relative latency score between 1 and 100, higher values + indicating a faster connection. + :type score: int + """ + + _validation = { + 'score': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, + 'score': {'key': 'score', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AzureReachabilityReportLatencyInfo, self).__init__(**kwargs) + self.time_stamp = kwargs.get('time_stamp', None) + self.score = kwargs.get('score', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_latency_info_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_latency_info_py3.py new file mode 100644 index 000000000000..dd9d8fda369c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_latency_info_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportLatencyInfo(Model): + """Details on latency for a time series. + + :param time_stamp: The time stamp. + :type time_stamp: datetime + :param score: The relative latency score between 1 and 100, higher values + indicating a faster connection. + :type score: int + """ + + _validation = { + 'score': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, + 'score': {'key': 'score', 'type': 'int'}, + } + + def __init__(self, *, time_stamp=None, score: int=None, **kwargs) -> None: + super(AzureReachabilityReportLatencyInfo, self).__init__(**kwargs) + self.time_stamp = time_stamp + self.score = score diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_location.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_location.py new file mode 100644 index 000000000000..76c132e89575 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_location.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportLocation(Model): + """Parameters that define a geographic location. + + All required parameters must be populated in order to send to Azure. + + :param country: Required. The name of the country. + :type country: str + :param state: The name of the state. + :type state: str + :param city: The name of the city or town. + :type city: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureReachabilityReportLocation, self).__init__(**kwargs) + self.country = kwargs.get('country', None) + self.state = kwargs.get('state', None) + self.city = kwargs.get('city', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_location_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_location_py3.py new file mode 100644 index 000000000000..1db868eab46f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_location_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportLocation(Model): + """Parameters that define a geographic location. + + All required parameters must be populated in order to send to Azure. + + :param country: Required. The name of the country. + :type country: str + :param state: The name of the state. + :type state: str + :param city: The name of the city or town. + :type city: str + """ + + _validation = { + 'country': {'required': True}, + } + + _attribute_map = { + 'country': {'key': 'country', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + } + + def __init__(self, *, country: str, state: str=None, city: str=None, **kwargs) -> None: + super(AzureReachabilityReportLocation, self).__init__(**kwargs) + self.country = country + self.state = state + self.city = city diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_parameters.py new file mode 100644 index 000000000000..e0d1253d3a35 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_parameters.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportParameters(Model): + """Geographic and time constraints for Azure reachability report. + + All required parameters must be populated in order to send to Azure. + + :param provider_location: Required. + :type provider_location: + ~azure.mgmt.network.v2018_01_01.models.AzureReachabilityReportLocation + :param providers: List of Internet service providers. + :type providers: list[str] + :param azure_locations: Optional Azure regions to scope the query to. + :type azure_locations: list[str] + :param start_time: Required. The start time for the Azure reachability + report. + :type start_time: datetime + :param end_time: Required. The end time for the Azure reachability report. + :type end_time: datetime + """ + + _validation = { + 'provider_location': {'required': True}, + 'start_time': {'required': True}, + 'end_time': {'required': True}, + } + + _attribute_map = { + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(AzureReachabilityReportParameters, self).__init__(**kwargs) + self.provider_location = kwargs.get('provider_location', None) + self.providers = kwargs.get('providers', None) + self.azure_locations = kwargs.get('azure_locations', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_parameters_py3.py new file mode 100644 index 000000000000..7f224e91e594 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_parameters_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReportParameters(Model): + """Geographic and time constraints for Azure reachability report. + + All required parameters must be populated in order to send to Azure. + + :param provider_location: Required. + :type provider_location: + ~azure.mgmt.network.v2018_01_01.models.AzureReachabilityReportLocation + :param providers: List of Internet service providers. + :type providers: list[str] + :param azure_locations: Optional Azure regions to scope the query to. + :type azure_locations: list[str] + :param start_time: Required. The start time for the Azure reachability + report. + :type start_time: datetime + :param end_time: Required. The end time for the Azure reachability report. + :type end_time: datetime + """ + + _validation = { + 'provider_location': {'required': True}, + 'start_time': {'required': True}, + 'end_time': {'required': True}, + } + + _attribute_map = { + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'providers': {'key': 'providers', 'type': '[str]'}, + 'azure_locations': {'key': 'azureLocations', 'type': '[str]'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, provider_location, start_time, end_time, providers=None, azure_locations=None, **kwargs) -> None: + super(AzureReachabilityReportParameters, self).__init__(**kwargs) + self.provider_location = provider_location + self.providers = providers + self.azure_locations = azure_locations + self.start_time = start_time + self.end_time = end_time diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_py3.py new file mode 100644 index 000000000000..b1ef9d36e6ca --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/azure_reachability_report_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AzureReachabilityReport(Model): + """Azure reachability report details. + + All required parameters must be populated in order to send to Azure. + + :param aggregation_level: Required. The aggregation level of Azure + reachability report. Can be Country, State or City. + :type aggregation_level: str + :param provider_location: Required. + :type provider_location: + ~azure.mgmt.network.v2018_01_01.models.AzureReachabilityReportLocation + :param reachability_report: Required. List of Azure reachability report + items. + :type reachability_report: + list[~azure.mgmt.network.v2018_01_01.models.AzureReachabilityReportItem] + """ + + _validation = { + 'aggregation_level': {'required': True}, + 'provider_location': {'required': True}, + 'reachability_report': {'required': True}, + } + + _attribute_map = { + 'aggregation_level': {'key': 'aggregationLevel', 'type': 'str'}, + 'provider_location': {'key': 'providerLocation', 'type': 'AzureReachabilityReportLocation'}, + 'reachability_report': {'key': 'reachabilityReport', 'type': '[AzureReachabilityReportItem]'}, + } + + def __init__(self, *, aggregation_level: str, provider_location, reachability_report, **kwargs) -> None: + super(AzureReachabilityReport, self).__init__(**kwargs) + self.aggregation_level = aggregation_level + self.provider_location = provider_location + self.reachability_report = reachability_report diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/backend_address_pool.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/backend_address_pool.py new file mode 100644 index 000000000000..2e65a16d07d5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/backend_address_pool.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class BackendAddressPool(SubResource): + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar backend_ip_configurations: Gets collection of references to IP + addresses defined in network interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: Gets load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :ivar outbound_nat_rule: Gets outbound rules that use this backend address + pool. + :vartype outbound_nat_rule: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param provisioning_state: Get provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configurations': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'outbound_nat_rule': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'outbound_nat_rule': {'key': 'properties.outboundNatRule', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BackendAddressPool, self).__init__(**kwargs) + self.backend_ip_configurations = None + self.load_balancing_rules = None + self.outbound_nat_rule = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/backend_address_pool_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/backend_address_pool_paged.py new file mode 100644 index 000000000000..53205d241d8f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/backend_address_pool_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class BackendAddressPoolPaged(Paged): + """ + A paging container for iterating over a list of :class:`BackendAddressPool ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BackendAddressPool]'} + } + + def __init__(self, *args, **kwargs): + + super(BackendAddressPoolPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/backend_address_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/backend_address_pool_py3.py new file mode 100644 index 000000000000..42184e8b8f1d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/backend_address_pool_py3.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class BackendAddressPool(SubResource): + """Pool of backend IP addresses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar backend_ip_configurations: Gets collection of references to IP + addresses defined in network interfaces. + :vartype backend_ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration] + :ivar load_balancing_rules: Gets load balancing rules that use this + backend address pool. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :ivar outbound_nat_rule: Gets outbound rules that use this backend address + pool. + :vartype outbound_nat_rule: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param provisioning_state: Get provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configurations': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + 'outbound_nat_rule': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'outbound_nat_rule': {'key': 'properties.outboundNatRule', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(BackendAddressPool, self).__init__(id=id, **kwargs) + self.backend_ip_configurations = None + self.load_balancing_rules = None + self.outbound_nat_rule = None + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_community.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_community.py new file mode 100644 index 000000000000..472a170e9ceb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_community.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BGPCommunity(Model): + """Contains bgp community information offered in Service Community resources. + + :param service_supported_region: The region which the service support. + e.g. For O365, region is Global. + :type service_supported_region: str + :param community_name: The name of the bgp community. e.g. Skype. + :type community_name: str + :param community_value: The value of the bgp community. For more + information: + https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + :type community_value: str + :param community_prefixes: The prefixes that the bgp community contains. + :type community_prefixes: list[str] + :param is_authorized_to_use: Customer is authorized to use bgp community + or not. + :type is_authorized_to_use: bool + :param service_group: The service group of the bgp community contains. + :type service_group: str + """ + + _attribute_map = { + 'service_supported_region': {'key': 'serviceSupportedRegion', 'type': 'str'}, + 'community_name': {'key': 'communityName', 'type': 'str'}, + 'community_value': {'key': 'communityValue', 'type': 'str'}, + 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, + 'is_authorized_to_use': {'key': 'isAuthorizedToUse', 'type': 'bool'}, + 'service_group': {'key': 'serviceGroup', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = kwargs.get('service_supported_region', None) + self.community_name = kwargs.get('community_name', None) + self.community_value = kwargs.get('community_value', None) + self.community_prefixes = kwargs.get('community_prefixes', None) + self.is_authorized_to_use = kwargs.get('is_authorized_to_use', None) + self.service_group = kwargs.get('service_group', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_community_py3.py new file mode 100644 index 000000000000..86b740c84404 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_community_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BGPCommunity(Model): + """Contains bgp community information offered in Service Community resources. + + :param service_supported_region: The region which the service support. + e.g. For O365, region is Global. + :type service_supported_region: str + :param community_name: The name of the bgp community. e.g. Skype. + :type community_name: str + :param community_value: The value of the bgp community. For more + information: + https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + :type community_value: str + :param community_prefixes: The prefixes that the bgp community contains. + :type community_prefixes: list[str] + :param is_authorized_to_use: Customer is authorized to use bgp community + or not. + :type is_authorized_to_use: bool + :param service_group: The service group of the bgp community contains. + :type service_group: str + """ + + _attribute_map = { + 'service_supported_region': {'key': 'serviceSupportedRegion', 'type': 'str'}, + 'community_name': {'key': 'communityName', 'type': 'str'}, + 'community_value': {'key': 'communityValue', 'type': 'str'}, + 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, + 'is_authorized_to_use': {'key': 'isAuthorizedToUse', 'type': 'bool'}, + 'service_group': {'key': 'serviceGroup', 'type': 'str'}, + } + + def __init__(self, *, service_supported_region: str=None, community_name: str=None, community_value: str=None, community_prefixes=None, is_authorized_to_use: bool=None, service_group: str=None, **kwargs) -> None: + super(BGPCommunity, self).__init__(**kwargs) + self.service_supported_region = service_supported_region + self.community_name = community_name + self.community_value = community_value + self.community_prefixes = community_prefixes + self.is_authorized_to_use = is_authorized_to_use + self.service_group = service_group diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_peer_status.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_peer_status.py new file mode 100644 index 000000000000..0030c5c8a148 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_peer_status.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatus(Model): + """BGP peer status details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The virtual network gateway's local address + :vartype local_address: str + :ivar neighbor: The remote BGP peer + :vartype neighbor: str + :ivar asn: The autonomous system number of the remote BGP peer + :vartype asn: int + :ivar state: The BGP peer state. Possible values include: 'Unknown', + 'Stopped', 'Idle', 'Connecting', 'Connected' + :vartype state: str or ~azure.mgmt.network.v2018_01_01.models.BgpPeerState + :ivar connected_duration: For how long the peering has been up + :vartype connected_duration: str + :ivar routes_received: The number of routes learned from this peer + :vartype routes_received: long + :ivar messages_sent: The number of BGP messages sent + :vartype messages_sent: long + :ivar messages_received: The number of BGP messages received + :vartype messages_received: long + """ + + _validation = { + 'local_address': {'readonly': True}, + 'neighbor': {'readonly': True}, + 'asn': {'readonly': True}, + 'state': {'readonly': True}, + 'connected_duration': {'readonly': True}, + 'routes_received': {'readonly': True}, + 'messages_sent': {'readonly': True}, + 'messages_received': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'str'}, + 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, + 'routes_received': {'key': 'routesReceived', 'type': 'long'}, + 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, + 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(BgpPeerStatus, self).__init__(**kwargs) + self.local_address = None + self.neighbor = None + self.asn = None + self.state = None + self.connected_duration = None + self.routes_received = None + self.messages_sent = None + self.messages_received = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_peer_status_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_peer_status_list_result.py new file mode 100644 index 000000000000..58d03b36a8dc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_peer_status_list_result.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatusListResult(Model): + """Response for list BGP peer status API service call. + + :param value: List of BGP peers + :type value: list[~azure.mgmt.network.v2018_01_01.models.BgpPeerStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, + } + + def __init__(self, **kwargs): + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_peer_status_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_peer_status_list_result_py3.py new file mode 100644 index 000000000000..51322d2e2283 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_peer_status_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatusListResult(Model): + """Response for list BGP peer status API service call. + + :param value: List of BGP peers + :type value: list[~azure.mgmt.network.v2018_01_01.models.BgpPeerStatus] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(BgpPeerStatusListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_peer_status_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_peer_status_py3.py new file mode 100644 index 000000000000..1a46c0e2df15 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_peer_status_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpPeerStatus(Model): + """BGP peer status details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The virtual network gateway's local address + :vartype local_address: str + :ivar neighbor: The remote BGP peer + :vartype neighbor: str + :ivar asn: The autonomous system number of the remote BGP peer + :vartype asn: int + :ivar state: The BGP peer state. Possible values include: 'Unknown', + 'Stopped', 'Idle', 'Connecting', 'Connected' + :vartype state: str or ~azure.mgmt.network.v2018_01_01.models.BgpPeerState + :ivar connected_duration: For how long the peering has been up + :vartype connected_duration: str + :ivar routes_received: The number of routes learned from this peer + :vartype routes_received: long + :ivar messages_sent: The number of BGP messages sent + :vartype messages_sent: long + :ivar messages_received: The number of BGP messages received + :vartype messages_received: long + """ + + _validation = { + 'local_address': {'readonly': True}, + 'neighbor': {'readonly': True}, + 'asn': {'readonly': True}, + 'state': {'readonly': True}, + 'connected_duration': {'readonly': True}, + 'routes_received': {'readonly': True}, + 'messages_sent': {'readonly': True}, + 'messages_received': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'asn': {'key': 'asn', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'str'}, + 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, + 'routes_received': {'key': 'routesReceived', 'type': 'long'}, + 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, + 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, + } + + def __init__(self, **kwargs) -> None: + super(BgpPeerStatus, self).__init__(**kwargs) + self.local_address = None + self.neighbor = None + self.asn = None + self.state = None + self.connected_duration = None + self.routes_received = None + self.messages_sent = None + self.messages_received = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_service_community.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_service_community.py new file mode 100644 index 000000000000..ad907e6104dc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_service_community.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BgpServiceCommunity(Resource): + """Service Community Properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param service_name: The name of the bgp community. e.g. Skype. + :type service_name: str + :param bgp_communities: Get a list of bgp communities. + :type bgp_communities: + list[~azure.mgmt.network.v2018_01_01.models.BGPCommunity] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, + 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, + } + + def __init__(self, **kwargs): + super(BgpServiceCommunity, self).__init__(**kwargs) + self.service_name = kwargs.get('service_name', None) + self.bgp_communities = kwargs.get('bgp_communities', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_service_community_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_service_community_paged.py new file mode 100644 index 000000000000..de71f1b52a24 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_service_community_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class BgpServiceCommunityPaged(Paged): + """ + A paging container for iterating over a list of :class:`BgpServiceCommunity ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BgpServiceCommunity]'} + } + + def __init__(self, *args, **kwargs): + + super(BgpServiceCommunityPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_service_community_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_service_community_py3.py new file mode 100644 index 000000000000..b78f7c27d345 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_service_community_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class BgpServiceCommunity(Resource): + """Service Community Properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param service_name: The name of the bgp community. e.g. Skype. + :type service_name: str + :param bgp_communities: Get a list of bgp communities. + :type bgp_communities: + list[~azure.mgmt.network.v2018_01_01.models.BGPCommunity] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, + 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, service_name: str=None, bgp_communities=None, **kwargs) -> None: + super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.service_name = service_name + self.bgp_communities = bgp_communities diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_settings.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_settings.py new file mode 100644 index 000000000000..e6e8d1b90aa6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_settings.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpSettings(Model): + """BGP settings details. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of + this BGP speaker. + :type bgp_peering_address: str + :param peer_weight: The weight added to routes learned from this BGP + speaker. + :type peer_weight: int + """ + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(BgpSettings, self).__init__(**kwargs) + self.asn = kwargs.get('asn', None) + self.bgp_peering_address = kwargs.get('bgp_peering_address', None) + self.peer_weight = kwargs.get('peer_weight', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_settings_py3.py new file mode 100644 index 000000000000..cb3b3e6795f7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/bgp_settings_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BgpSettings(Model): + """BGP settings details. + + :param asn: The BGP speaker's ASN. + :type asn: long + :param bgp_peering_address: The BGP peering address and BGP identifier of + this BGP speaker. + :type bgp_peering_address: str + :param peer_weight: The weight added to routes learned from this BGP + speaker. + :type peer_weight: int + """ + + _attribute_map = { + 'asn': {'key': 'asn', 'type': 'long'}, + 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, + 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, + } + + def __init__(self, *, asn: int=None, bgp_peering_address: str=None, peer_weight: int=None, **kwargs) -> None: + super(BgpSettings, self).__init__(**kwargs) + self.asn = asn + self.bgp_peering_address = bgp_peering_address + self.peer_weight = peer_weight diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor.py new file mode 100644 index 000000000000..d1adc5502c60 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitor(Model): + """Parameters that define the operation to create a connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param location: Connection monitor location. + :type location: str + :param tags: Connection monitor tags. + :type tags: dict[str, str] + :param source: Required. + :type source: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorSource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start + automatically once created. Default value: True . + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + Default value: 60 . + :type monitoring_interval_in_seconds: int + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'properties.destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'properties.autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ConnectionMonitor, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.auto_start = kwargs.get('auto_start', True) + self.monitoring_interval_in_seconds = kwargs.get('monitoring_interval_in_seconds', 60) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_destination.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_destination.py new file mode 100644 index 000000000000..9d1e3885cb38 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_destination.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorDestination(Model): + """Describes the destination of connection monitor. + + :param resource_id: The ID of the resource used as the destination by + connection monitor. + :type resource_id: str + :param address: Address of the connection monitor destination (IP or + domain name). + :type address: str + :param port: The destination port used by connection monitor. + :type port: int + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ConnectionMonitorDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_destination_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_destination_py3.py new file mode 100644 index 000000000000..59e7465804ce --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_destination_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorDestination(Model): + """Describes the destination of connection monitor. + + :param resource_id: The ID of the resource used as the destination by + connection monitor. + :type resource_id: str + :param address: Address of the connection monitor destination (IP or + domain name). + :type address: str + :param port: The destination port used by connection monitor. + :type port: int + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str=None, address: str=None, port: int=None, **kwargs) -> None: + super(ConnectionMonitorDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_parameters.py new file mode 100644 index 000000000000..feda29f52a4c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_parameters.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorParameters(Model): + """Parameters that define the operation to create a connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. + :type source: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorSource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start + automatically once created. Default value: True . + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + Default value: 60 . + :type monitoring_interval_in_seconds: int + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'monitoringIntervalInSeconds', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ConnectionMonitorParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.auto_start = kwargs.get('auto_start', True) + self.monitoring_interval_in_seconds = kwargs.get('monitoring_interval_in_seconds', 60) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_parameters_py3.py new file mode 100644 index 000000000000..b051de8dd6a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_parameters_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorParameters(Model): + """Parameters that define the operation to create a connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. + :type source: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorSource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start + automatically once created. Default value: True . + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + Default value: 60 . + :type monitoring_interval_in_seconds: int + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'monitoringIntervalInSeconds', 'type': 'int'}, + } + + def __init__(self, *, source, destination, auto_start: bool=True, monitoring_interval_in_seconds: int=60, **kwargs) -> None: + super(ConnectionMonitorParameters, self).__init__(**kwargs) + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_py3.py new file mode 100644 index 000000000000..6513df4822f6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitor(Model): + """Parameters that define the operation to create a connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param location: Connection monitor location. + :type location: str + :param tags: Connection monitor tags. + :type tags: dict[str, str] + :param source: Required. + :type source: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorSource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start + automatically once created. Default value: True . + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + Default value: 60 . + :type monitoring_interval_in_seconds: int + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'properties.destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'properties.autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, + } + + def __init__(self, *, source, destination, location: str=None, tags=None, auto_start: bool=True, monitoring_interval_in_seconds: int=60, **kwargs) -> None: + super(ConnectionMonitor, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_query_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_query_result.py new file mode 100644 index 000000000000..5b0b1e486946 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_query_result.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorQueryResult(Model): + """List of connection states snaphots. + + :param states: Information about connection states. + :type states: + list[~azure.mgmt.network.v2018_01_01.models.ConnectionStateSnapshot] + """ + + _attribute_map = { + 'states': {'key': 'states', 'type': '[ConnectionStateSnapshot]'}, + } + + def __init__(self, **kwargs): + super(ConnectionMonitorQueryResult, self).__init__(**kwargs) + self.states = kwargs.get('states', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_query_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_query_result_py3.py new file mode 100644 index 000000000000..bd37a5bab604 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_query_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorQueryResult(Model): + """List of connection states snaphots. + + :param states: Information about connection states. + :type states: + list[~azure.mgmt.network.v2018_01_01.models.ConnectionStateSnapshot] + """ + + _attribute_map = { + 'states': {'key': 'states', 'type': '[ConnectionStateSnapshot]'}, + } + + def __init__(self, *, states=None, **kwargs) -> None: + super(ConnectionMonitorQueryResult, self).__init__(**kwargs) + self.states = states diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_result.py new file mode 100644 index 000000000000..e86462442308 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_result.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorResult(Model): + """Information about the connection monitor. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the connection monitor. + :vartype name: str + :ivar id: ID of the connection monitor. + :vartype id: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :ivar type: Connection monitor type. + :vartype type: str + :param location: Connection monitor location. + :type location: str + :param tags: Connection monitor tags. + :type tags: dict[str, str] + :param source: Required. + :type source: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorSource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start + automatically once created. Default value: True . + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + Default value: 60 . + :type monitoring_interval_in_seconds: int + :param provisioning_state: The provisioning state of the connection + monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2018_01_01.models.ProvisioningState + :param start_time: The date and time when the connection monitor was + started. + :type start_time: datetime + :param monitoring_status: The monitoring status of the connection monitor. + :type monitoring_status: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'properties.destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'properties.autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConnectionMonitorResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.auto_start = kwargs.get('auto_start', True) + self.monitoring_interval_in_seconds = kwargs.get('monitoring_interval_in_seconds', 60) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.start_time = kwargs.get('start_time', None) + self.monitoring_status = kwargs.get('monitoring_status', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_result_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_result_paged.py new file mode 100644 index 000000000000..27da8f0a2c74 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_result_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ConnectionMonitorResultPaged(Paged): + """ + A paging container for iterating over a list of :class:`ConnectionMonitorResult ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ConnectionMonitorResult]'} + } + + def __init__(self, *args, **kwargs): + + super(ConnectionMonitorResultPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_result_py3.py new file mode 100644 index 000000000000..a63c14cdb35d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_result_py3.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorResult(Model): + """Information about the connection monitor. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the connection monitor. + :vartype name: str + :ivar id: ID of the connection monitor. + :vartype id: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :ivar type: Connection monitor type. + :vartype type: str + :param location: Connection monitor location. + :type location: str + :param tags: Connection monitor tags. + :type tags: dict[str, str] + :param source: Required. + :type source: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorSource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorDestination + :param auto_start: Determines if the connection monitor will start + automatically once created. Default value: True . + :type auto_start: bool + :param monitoring_interval_in_seconds: Monitoring interval in seconds. + Default value: 60 . + :type monitoring_interval_in_seconds: int + :param provisioning_state: The provisioning state of the connection + monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2018_01_01.models.ProvisioningState + :param start_time: The date and time when the connection monitor was + started. + :type start_time: datetime + :param monitoring_status: The monitoring status of the connection monitor. + :type monitoring_status: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source': {'key': 'properties.source', 'type': 'ConnectionMonitorSource'}, + 'destination': {'key': 'properties.destination', 'type': 'ConnectionMonitorDestination'}, + 'auto_start': {'key': 'properties.autoStart', 'type': 'bool'}, + 'monitoring_interval_in_seconds': {'key': 'properties.monitoringIntervalInSeconds', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'monitoring_status': {'key': 'properties.monitoringStatus', 'type': 'str'}, + } + + def __init__(self, *, source, destination, etag: str="A unique read-only string that changes whenever the resource is updated.", location: str=None, tags=None, auto_start: bool=True, monitoring_interval_in_seconds: int=60, provisioning_state=None, start_time=None, monitoring_status: str=None, **kwargs) -> None: + super(ConnectionMonitorResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.etag = etag + self.type = None + self.location = location + self.tags = tags + self.source = source + self.destination = destination + self.auto_start = auto_start + self.monitoring_interval_in_seconds = monitoring_interval_in_seconds + self.provisioning_state = provisioning_state + self.start_time = start_time + self.monitoring_status = monitoring_status diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_source.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_source.py new file mode 100644 index 000000000000..1425fa613ce5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_source.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorSource(Model): + """Describes the source of connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource used as the source by + connection monitor. + :type resource_id: str + :param port: The source port used by connection monitor. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ConnectionMonitorSource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_source_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_source_py3.py new file mode 100644 index 000000000000..4d44fcaf8bf0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_monitor_source_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionMonitorSource(Model): + """Describes the source of connection monitor. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource used as the source by + connection monitor. + :type resource_id: str + :param port: The source port used by connection monitor. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str, port: int=None, **kwargs) -> None: + super(ConnectionMonitorSource, self).__init__(**kwargs) + self.resource_id = resource_id + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_reset_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_reset_shared_key.py new file mode 100644 index 000000000000..1ade077795ed --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_reset_shared_key.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionResetSharedKey(Model): + """The virtual network connection reset shared key. + + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. + :type key_length: int + """ + + _validation = { + 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, + } + + _attribute_map = { + 'key_length': {'key': 'keyLength', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = kwargs.get('key_length', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_reset_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_reset_shared_key_py3.py new file mode 100644 index 000000000000..47326d4c2082 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_reset_shared_key_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionResetSharedKey(Model): + """The virtual network connection reset shared key. + + All required parameters must be populated in order to send to Azure. + + :param key_length: Required. The virtual network connection reset shared + key length, should between 1 and 128. + :type key_length: int + """ + + _validation = { + 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, + } + + _attribute_map = { + 'key_length': {'key': 'keyLength', 'type': 'int'}, + } + + def __init__(self, *, key_length: int, **kwargs) -> None: + super(ConnectionResetSharedKey, self).__init__(**kwargs) + self.key_length = key_length diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_shared_key.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_shared_key.py new file mode 100644 index 000000000000..742f1cb15126 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_shared_key.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionSharedKey(Model): + """Response for GetConnectionSharedKey API service call. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_shared_key_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_shared_key_py3.py new file mode 100644 index 000000000000..11b88da35e17 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_shared_key_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionSharedKey(Model): + """Response for GetConnectionSharedKey API service call. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The virtual network connection shared key value. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, **kwargs) -> None: + super(ConnectionSharedKey, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_state_snapshot.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_state_snapshot.py new file mode 100644 index 000000000000..1d6d52026d98 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_state_snapshot.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionStateSnapshot(Model): + """Connection state snapshot. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param connection_state: The connection state. Possible values include: + 'Reachable', 'Unreachable', 'Unknown' + :type connection_state: str or + ~azure.mgmt.network.v2018_01_01.models.ConnectionState + :param start_time: The start time of the connection snapshot. + :type start_time: datetime + :param end_time: The end time of the connection snapshot. + :type end_time: datetime + :param evaluation_state: Connectivity analysis evaluation state. Possible + values include: 'NotStarted', 'InProgress', 'Completed' + :type evaluation_state: str or + ~azure.mgmt.network.v2018_01_01.models.EvaluationState + :ivar hops: List of hops between the source and the destination. + :vartype hops: + list[~azure.mgmt.network.v2018_01_01.models.ConnectivityHop] + """ + + _validation = { + 'hops': {'readonly': True}, + } + + _attribute_map = { + 'connection_state': {'key': 'connectionState', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'evaluation_state': {'key': 'evaluationState', 'type': 'str'}, + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + } + + def __init__(self, **kwargs): + super(ConnectionStateSnapshot, self).__init__(**kwargs) + self.connection_state = kwargs.get('connection_state', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.evaluation_state = kwargs.get('evaluation_state', None) + self.hops = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_state_snapshot_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_state_snapshot_py3.py new file mode 100644 index 000000000000..9b878b066117 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connection_state_snapshot_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectionStateSnapshot(Model): + """Connection state snapshot. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param connection_state: The connection state. Possible values include: + 'Reachable', 'Unreachable', 'Unknown' + :type connection_state: str or + ~azure.mgmt.network.v2018_01_01.models.ConnectionState + :param start_time: The start time of the connection snapshot. + :type start_time: datetime + :param end_time: The end time of the connection snapshot. + :type end_time: datetime + :param evaluation_state: Connectivity analysis evaluation state. Possible + values include: 'NotStarted', 'InProgress', 'Completed' + :type evaluation_state: str or + ~azure.mgmt.network.v2018_01_01.models.EvaluationState + :ivar hops: List of hops between the source and the destination. + :vartype hops: + list[~azure.mgmt.network.v2018_01_01.models.ConnectivityHop] + """ + + _validation = { + 'hops': {'readonly': True}, + } + + _attribute_map = { + 'connection_state': {'key': 'connectionState', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'evaluation_state': {'key': 'evaluationState', 'type': 'str'}, + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + } + + def __init__(self, *, connection_state=None, start_time=None, end_time=None, evaluation_state=None, **kwargs) -> None: + super(ConnectionStateSnapshot, self).__init__(**kwargs) + self.connection_state = connection_state + self.start_time = start_time + self.end_time = end_time + self.evaluation_state = evaluation_state + self.hops = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_destination.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_destination.py new file mode 100644 index 000000000000..964c425a29d3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_destination.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityDestination(Model): + """Parameters that define destination of connection. + + :param resource_id: The ID of the resource to which a connection attempt + will be made. + :type resource_id: str + :param address: The IP address or URI the resource to which a connection + attempt will be made. + :type address: str + :param port: Port on which check connectivity will be performed. + :type port: int + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.address = kwargs.get('address', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_destination_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_destination_py3.py new file mode 100644 index 000000000000..c51619081ed6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_destination_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityDestination(Model): + """Parameters that define destination of connection. + + :param resource_id: The ID of the resource to which a connection attempt + will be made. + :type resource_id: str + :param address: The IP address or URI the resource to which a connection + attempt will be made. + :type address: str + :param port: Port on which check connectivity will be performed. + :type port: int + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str=None, address: str=None, port: int=None, **kwargs) -> None: + super(ConnectivityDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.address = address + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_hop.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_hop.py new file mode 100644 index 000000000000..00519c9cb7f0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_hop.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityHop(Model): + """Information about a hop between the source and the destination. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the hop. + :vartype type: str + :ivar id: The ID of the hop. + :vartype id: str + :ivar address: The IP address of the hop. + :vartype address: str + :ivar resource_id: The ID of the resource corresponding to this hop. + :vartype resource_id: str + :ivar next_hop_ids: List of next hop identifiers. + :vartype next_hop_ids: list[str] + :ivar issues: List of issues. + :vartype issues: + list[~azure.mgmt.network.v2018_01_01.models.ConnectivityIssue] + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'address': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'next_hop_ids': {'readonly': True}, + 'issues': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'next_hop_ids': {'key': 'nextHopIds', 'type': '[str]'}, + 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, + } + + def __init__(self, **kwargs): + super(ConnectivityHop, self).__init__(**kwargs) + self.type = None + self.id = None + self.address = None + self.resource_id = None + self.next_hop_ids = None + self.issues = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_hop_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_hop_py3.py new file mode 100644 index 000000000000..072ecb971cdf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_hop_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityHop(Model): + """Information about a hop between the source and the destination. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the hop. + :vartype type: str + :ivar id: The ID of the hop. + :vartype id: str + :ivar address: The IP address of the hop. + :vartype address: str + :ivar resource_id: The ID of the resource corresponding to this hop. + :vartype resource_id: str + :ivar next_hop_ids: List of next hop identifiers. + :vartype next_hop_ids: list[str] + :ivar issues: List of issues. + :vartype issues: + list[~azure.mgmt.network.v2018_01_01.models.ConnectivityIssue] + """ + + _validation = { + 'type': {'readonly': True}, + 'id': {'readonly': True}, + 'address': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'next_hop_ids': {'readonly': True}, + 'issues': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'next_hop_ids': {'key': 'nextHopIds', 'type': '[str]'}, + 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityHop, self).__init__(**kwargs) + self.type = None + self.id = None + self.address = None + self.resource_id = None + self.next_hop_ids = None + self.issues = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_information.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_information.py new file mode 100644 index 000000000000..682c255595f2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_information.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityInformation(Model): + """Information on the connectivity status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar hops: List of hops between the source and the destination. + :vartype hops: + list[~azure.mgmt.network.v2018_01_01.models.ConnectivityHop] + :ivar connection_status: The connection status. Possible values include: + 'Unknown', 'Connected', 'Disconnected', 'Degraded' + :vartype connection_status: str or + ~azure.mgmt.network.v2018_01_01.models.ConnectionStatus + :ivar avg_latency_in_ms: Average latency in milliseconds. + :vartype avg_latency_in_ms: int + :ivar min_latency_in_ms: Minimum latency in milliseconds. + :vartype min_latency_in_ms: int + :ivar max_latency_in_ms: Maximum latency in milliseconds. + :vartype max_latency_in_ms: int + :ivar probes_sent: Total number of probes sent. + :vartype probes_sent: int + :ivar probes_failed: Number of failed probes. + :vartype probes_failed: int + """ + + _validation = { + 'hops': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'avg_latency_in_ms': {'readonly': True}, + 'min_latency_in_ms': {'readonly': True}, + 'max_latency_in_ms': {'readonly': True}, + 'probes_sent': {'readonly': True}, + 'probes_failed': {'readonly': True}, + } + + _attribute_map = { + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, + 'probes_sent': {'key': 'probesSent', 'type': 'int'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ConnectivityInformation, self).__init__(**kwargs) + self.hops = None + self.connection_status = None + self.avg_latency_in_ms = None + self.min_latency_in_ms = None + self.max_latency_in_ms = None + self.probes_sent = None + self.probes_failed = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_information_py3.py new file mode 100644 index 000000000000..34bd894b406f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_information_py3.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityInformation(Model): + """Information on the connectivity status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar hops: List of hops between the source and the destination. + :vartype hops: + list[~azure.mgmt.network.v2018_01_01.models.ConnectivityHop] + :ivar connection_status: The connection status. Possible values include: + 'Unknown', 'Connected', 'Disconnected', 'Degraded' + :vartype connection_status: str or + ~azure.mgmt.network.v2018_01_01.models.ConnectionStatus + :ivar avg_latency_in_ms: Average latency in milliseconds. + :vartype avg_latency_in_ms: int + :ivar min_latency_in_ms: Minimum latency in milliseconds. + :vartype min_latency_in_ms: int + :ivar max_latency_in_ms: Maximum latency in milliseconds. + :vartype max_latency_in_ms: int + :ivar probes_sent: Total number of probes sent. + :vartype probes_sent: int + :ivar probes_failed: Number of failed probes. + :vartype probes_failed: int + """ + + _validation = { + 'hops': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'avg_latency_in_ms': {'readonly': True}, + 'min_latency_in_ms': {'readonly': True}, + 'max_latency_in_ms': {'readonly': True}, + 'probes_sent': {'readonly': True}, + 'probes_failed': {'readonly': True}, + } + + _attribute_map = { + 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, + 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, + 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, + 'probes_sent': {'key': 'probesSent', 'type': 'int'}, + 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityInformation, self).__init__(**kwargs) + self.hops = None + self.connection_status = None + self.avg_latency_in_ms = None + self.min_latency_in_ms = None + self.max_latency_in_ms = None + self.probes_sent = None + self.probes_failed = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_issue.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_issue.py new file mode 100644 index 000000000000..e00fe9504a14 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_issue.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityIssue(Model): + """Information about an issue encountered in the process of checking for + connectivity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar origin: The origin of the issue. Possible values include: 'Local', + 'Inbound', 'Outbound' + :vartype origin: str or ~azure.mgmt.network.v2018_01_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: + 'Error', 'Warning' + :vartype severity: str or ~azure.mgmt.network.v2018_01_01.models.Severity + :ivar type: The type of issue. Possible values include: 'Unknown', + 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', + 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform' + :vartype type: str or ~azure.mgmt.network.v2018_01_01.models.IssueType + :ivar context: Provides additional context on the issue. + :vartype context: list[dict[str, str]] + """ + + _validation = { + 'origin': {'readonly': True}, + 'severity': {'readonly': True}, + 'type': {'readonly': True}, + 'context': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'context': {'key': 'context', 'type': '[{str}]'}, + } + + def __init__(self, **kwargs): + super(ConnectivityIssue, self).__init__(**kwargs) + self.origin = None + self.severity = None + self.type = None + self.context = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_issue_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_issue_py3.py new file mode 100644 index 000000000000..a8dd10e39e72 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_issue_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityIssue(Model): + """Information about an issue encountered in the process of checking for + connectivity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar origin: The origin of the issue. Possible values include: 'Local', + 'Inbound', 'Outbound' + :vartype origin: str or ~azure.mgmt.network.v2018_01_01.models.Origin + :ivar severity: The severity of the issue. Possible values include: + 'Error', 'Warning' + :vartype severity: str or ~azure.mgmt.network.v2018_01_01.models.Severity + :ivar type: The type of issue. Possible values include: 'Unknown', + 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', + 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform' + :vartype type: str or ~azure.mgmt.network.v2018_01_01.models.IssueType + :ivar context: Provides additional context on the issue. + :vartype context: list[dict[str, str]] + """ + + _validation = { + 'origin': {'readonly': True}, + 'severity': {'readonly': True}, + 'type': {'readonly': True}, + 'context': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'severity': {'key': 'severity', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'context': {'key': 'context', 'type': '[{str}]'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectivityIssue, self).__init__(**kwargs) + self.origin = None + self.severity = None + self.type = None + self.context = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_parameters.py new file mode 100644 index 000000000000..44ec57151280 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_parameters.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityParameters(Model): + """Parameters that determine how the connectivity check will be performed. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. + :type source: ~azure.mgmt.network.v2018_01_01.models.ConnectivitySource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2018_01_01.models.ConnectivityDestination + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectivitySource'}, + 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, + } + + def __init__(self, **kwargs): + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_parameters_py3.py new file mode 100644 index 000000000000..744e7c094839 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_parameters_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivityParameters(Model): + """Parameters that determine how the connectivity check will be performed. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. + :type source: ~azure.mgmt.network.v2018_01_01.models.ConnectivitySource + :param destination: Required. + :type destination: + ~azure.mgmt.network.v2018_01_01.models.ConnectivityDestination + """ + + _validation = { + 'source': {'required': True}, + 'destination': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'ConnectivitySource'}, + 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, + } + + def __init__(self, *, source, destination, **kwargs) -> None: + super(ConnectivityParameters, self).__init__(**kwargs) + self.source = source + self.destination = destination diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_source.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_source.py new file mode 100644 index 000000000000..3fd82793f8d7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_source.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivitySource(Model): + """Parameters that define the source of the connection. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. + :type resource_id: str + :param port: The source port from which a connectivity check will be + performed. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_source_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_source_py3.py new file mode 100644 index 000000000000..f7833d1bef76 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/connectivity_source_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ConnectivitySource(Model): + """Parameters that define the source of the connection. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. The ID of the resource from which a + connectivity check will be initiated. + :type resource_id: str + :param port: The source port from which a connectivity check will be + performed. + :type port: int + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, resource_id: str, port: int=None, **kwargs) -> None: + super(ConnectivitySource, self).__init__(**kwargs) + self.resource_id = resource_id + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dhcp_options.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dhcp_options.py new file mode 100644 index 000000000000..93b68a7f037c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dhcp_options.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DhcpOptions(Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in + the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + options. + + :param dns_servers: The list of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dhcp_options_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dhcp_options_py3.py new file mode 100644 index 000000000000..7dc4651973a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dhcp_options_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DhcpOptions(Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in + the virtual network. Standard DHCP option for a subnet overrides VNET DHCP + options. + + :param dns_servers: The list of DNS servers IP addresses. + :type dns_servers: list[str] + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + } + + def __init__(self, *, dns_servers=None, **kwargs) -> None: + super(DhcpOptions, self).__init__(**kwargs) + self.dns_servers = dns_servers diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dimension.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dimension.py new file mode 100644 index 000000000000..e9c8cd977a54 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dimension.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dimension(Model): + """Dimension of the metric. + + :param name: The name of the dimension. + :type name: str + :param display_name: The display name of the dimension. + :type display_name: str + :param internal_name: The internal name of the dimension. + :type internal_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.internal_name = kwargs.get('internal_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dimension_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dimension_py3.py new file mode 100644 index 000000000000..20743b6424c1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dimension_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Dimension(Model): + """Dimension of the metric. + + :param name: The name of the dimension. + :type name: str + :param display_name: The display name of the dimension. + :type display_name: str + :param internal_name: The internal name of the dimension. + :type internal_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, internal_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dns_name_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dns_name_availability_result.py new file mode 100644 index 000000000000..86ba19eb407b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dns_name_availability_result.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DnsNameAvailabilityResult(Model): + """Response for the CheckDnsNameAvailability API service call. + + :param available: Domain availability (True/False). + :type available: bool + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dns_name_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dns_name_availability_result_py3.py new file mode 100644 index 000000000000..de0117c27715 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/dns_name_availability_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DnsNameAvailabilityResult(Model): + """Response for the CheckDnsNameAvailability API service call. + + :param available: Domain availability (True/False). + :type available: bool + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + } + + def __init__(self, *, available: bool=None, **kwargs) -> None: + super(DnsNameAvailabilityResult, self).__init__(**kwargs) + self.available = available diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group.py new file mode 100644 index 000000000000..08ac7658cecf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroup(Model): + """Effective network security group. + + :param network_security_group: The ID of network security group that is + applied. + :type network_security_group: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param association: Associated resources. + :type association: + ~azure.mgmt.network.v2018_01_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2018_01_01.models.EffectiveNetworkSecurityRule] + :param tag_map: Mapping of tags to list of IP Addresses included within + the tag. + :type tag_map: dict[str, list[str]] + """ + + _attribute_map = { + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, + 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + 'tag_map': {'key': 'tagMap', 'type': '{[str]}'}, + } + + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = kwargs.get('network_security_group', None) + self.association = kwargs.get('association', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) + self.tag_map = kwargs.get('tag_map', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_association.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_association.py new file mode 100644 index 000000000000..5d981b059a96 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_association.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupAssociation(Model): + """The effective network security group association. + + :param subnet: The ID of the subnet if assigned. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: + ~azure.mgmt.network.v2018_01_01.models.SubResource + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, + } + + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.network_interface = kwargs.get('network_interface', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_association_py3.py new file mode 100644 index 000000000000..effa3d478fd4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_association_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupAssociation(Model): + """The effective network security group association. + + :param subnet: The ID of the subnet if assigned. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param network_interface: The ID of the network interface if assigned. + :type network_interface: + ~azure.mgmt.network.v2018_01_01.models.SubResource + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'SubResource'}, + 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, + } + + def __init__(self, *, subnet=None, network_interface=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) + self.subnet = subnet + self.network_interface = network_interface diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_list_result.py new file mode 100644 index 000000000000..b80851c56e6c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_list_result.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupListResult(Model): + """Response for list effective network security groups API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective network security groups. + :type value: + list[~azure.mgmt.network.v2018_01_01.models.EffectiveNetworkSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_list_result_py3.py new file mode 100644 index 000000000000..c06e1c1c0b87 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_list_result_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroupListResult(Model): + """Response for list effective network security groups API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective network security groups. + :type value: + list[~azure.mgmt.network.v2018_01_01.models.EffectiveNetworkSecurityGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_py3.py new file mode 100644 index 000000000000..af67cd7fbc6e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityGroup(Model): + """Effective network security group. + + :param network_security_group: The ID of network security group that is + applied. + :type network_security_group: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param association: Associated resources. + :type association: + ~azure.mgmt.network.v2018_01_01.models.EffectiveNetworkSecurityGroupAssociation + :param effective_security_rules: A collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2018_01_01.models.EffectiveNetworkSecurityRule] + :param tag_map: Mapping of tags to list of IP Addresses included within + the tag. + :type tag_map: dict[str, list[str]] + """ + + _attribute_map = { + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, + 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + 'tag_map': {'key': 'tagMap', 'type': '{[str]}'}, + } + + def __init__(self, *, network_security_group=None, association=None, effective_security_rules=None, tag_map=None, **kwargs) -> None: + super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) + self.network_security_group = network_security_group + self.association = association + self.effective_security_rules = effective_security_rules + self.tag_map = tag_map diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_rule.py new file mode 100644 index 000000000000..b58103a6cbe3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_rule.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityRule(Model): + """Effective network security rules. + + :param name: The name of the security rule specified by the user (if + created by the user). + :type name: str + :param protocol: The network protocol this rule applies to. Possible + values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', + 'Udp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.EffectiveSecurityRuleProtocol + :param source_port_range: The source port or range. + :type source_port_range: str + :param destination_port_range: The destination port or range. + :type destination_port_range: str + :param source_port_ranges: The source port ranges. Expected values include + a single integer between 0 and 65535, a range using '-' as seperator (e.g. + 100-400), or an asterix (*) + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. Expected + values include a single integer between 0 and 65535, a range using '-' as + seperator (e.g. 100-400), or an asterix (*) + :type destination_port_ranges: list[str] + :param source_address_prefix: The source address prefix. + :type source_address_prefix: str + :param destination_address_prefix: The destination address prefix. + :type destination_address_prefix: str + :param source_address_prefixes: The source address prefixes. Expected + values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type source_address_prefixes: list[str] + :param destination_address_prefixes: The destination address prefixes. + Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type destination_address_prefixes: list[str] + :param expanded_source_address_prefix: The expanded source address prefix. + :type expanded_source_address_prefix: list[str] + :param expanded_destination_address_prefix: Expanded destination address + prefix. + :type expanded_destination_address_prefix: list[str] + :param access: Whether network traffic is allowed or denied. Possible + values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or + ~azure.mgmt.network.v2018_01_01.models.SecurityRuleAccess + :param priority: The priority of the rule. + :type priority: int + :param direction: The direction of the rule. Possible values are: 'Inbound + and Outbound'. Possible values include: 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2018_01_01.models.SecurityRuleDirection + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'source_port_ranges': {'key': 'sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'destinationPortRanges', 'type': '[str]'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'sourceAddressPrefixes', 'type': '[str]'}, + 'destination_address_prefixes': {'key': 'destinationAddressPrefixes', 'type': '[str]'}, + 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, + 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, + 'access': {'key': 'access', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.expanded_source_address_prefix = kwargs.get('expanded_source_address_prefix', None) + self.expanded_destination_address_prefix = kwargs.get('expanded_destination_address_prefix', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_rule_py3.py new file mode 100644 index 000000000000..2818dbb510de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_rule_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveNetworkSecurityRule(Model): + """Effective network security rules. + + :param name: The name of the security rule specified by the user (if + created by the user). + :type name: str + :param protocol: The network protocol this rule applies to. Possible + values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'Tcp', + 'Udp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.EffectiveSecurityRuleProtocol + :param source_port_range: The source port or range. + :type source_port_range: str + :param destination_port_range: The destination port or range. + :type destination_port_range: str + :param source_port_ranges: The source port ranges. Expected values include + a single integer between 0 and 65535, a range using '-' as seperator (e.g. + 100-400), or an asterix (*) + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. Expected + values include a single integer between 0 and 65535, a range using '-' as + seperator (e.g. 100-400), or an asterix (*) + :type destination_port_ranges: list[str] + :param source_address_prefix: The source address prefix. + :type source_address_prefix: str + :param destination_address_prefix: The destination address prefix. + :type destination_address_prefix: str + :param source_address_prefixes: The source address prefixes. Expected + values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type source_address_prefixes: list[str] + :param destination_address_prefixes: The destination address prefixes. + Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, + AureLoadBalancer, Internet), System Tags, and the asterix (*). + :type destination_address_prefixes: list[str] + :param expanded_source_address_prefix: The expanded source address prefix. + :type expanded_source_address_prefix: list[str] + :param expanded_destination_address_prefix: Expanded destination address + prefix. + :type expanded_destination_address_prefix: list[str] + :param access: Whether network traffic is allowed or denied. Possible + values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or + ~azure.mgmt.network.v2018_01_01.models.SecurityRuleAccess + :param priority: The priority of the rule. + :type priority: int + :param direction: The direction of the rule. Possible values are: 'Inbound + and Outbound'. Possible values include: 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2018_01_01.models.SecurityRuleDirection + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'source_port_ranges': {'key': 'sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'destinationPortRanges', 'type': '[str]'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'sourceAddressPrefixes', 'type': '[str]'}, + 'destination_address_prefixes': {'key': 'destinationAddressPrefixes', 'type': '[str]'}, + 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, + 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, + 'access': {'key': 'access', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, protocol=None, source_port_range: str=None, destination_port_range: str=None, source_port_ranges=None, destination_port_ranges=None, source_address_prefix: str=None, destination_address_prefix: str=None, source_address_prefixes=None, destination_address_prefixes=None, expanded_source_address_prefix=None, expanded_destination_address_prefix=None, access=None, priority: int=None, direction=None, **kwargs) -> None: + super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) + self.name = name + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.source_address_prefix = source_address_prefix + self.destination_address_prefix = destination_address_prefix + self.source_address_prefixes = source_address_prefixes + self.destination_address_prefixes = destination_address_prefixes + self.expanded_source_address_prefix = expanded_source_address_prefix + self.expanded_destination_address_prefix = expanded_destination_address_prefix + self.access = access + self.priority = priority + self.direction = direction diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_route.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_route.py new file mode 100644 index 000000000000..4e3c9b5a081d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_route.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRoute(Model): + """Effective Route. + + :param name: The name of the user defined route. This is optional. + :type name: str + :param source: Who created the route. Possible values are: 'Unknown', + 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: + 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' + :type source: str or + ~azure.mgmt.network.v2018_01_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values are: 'Active' + and 'Invalid'. Possible values include: 'Active', 'Invalid' + :type state: str or + ~azure.mgmt.network.v2018_01_01.models.EffectiveRouteState + :param address_prefix: The address prefixes of the effective routes in + CIDR notation. + :type address_prefix: list[str] + :param next_hop_ip_address: The IP address of the next hop of the + effective route. + :type next_hop_ip_address: list[str] + :param next_hop_type: The type of Azure hop the packet should be sent to. + Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2018_01_01.models.RouteNextHopType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EffectiveRoute, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.next_hop_type = kwargs.get('next_hop_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_route_list_result.py new file mode 100644 index 000000000000..bb563c9dd7cc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_route_list_result.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRouteListResult(Model): + """Response for list effective route API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective routes. + :type value: list[~azure.mgmt.network.v2018_01_01.models.EffectiveRoute] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_route_list_result_py3.py new file mode 100644 index 000000000000..517acc71f899 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_route_list_result_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRouteListResult(Model): + """Response for list effective route API service call. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: A list of effective routes. + :type value: list[~azure.mgmt.network.v2018_01_01.models.EffectiveRoute] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EffectiveRouteListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_route_py3.py new file mode 100644 index 000000000000..b1b760124ee5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_route_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EffectiveRoute(Model): + """Effective Route. + + :param name: The name of the user defined route. This is optional. + :type name: str + :param source: Who created the route. Possible values are: 'Unknown', + 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: + 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' + :type source: str or + ~azure.mgmt.network.v2018_01_01.models.EffectiveRouteSource + :param state: The value of effective route. Possible values are: 'Active' + and 'Invalid'. Possible values include: 'Active', 'Invalid' + :type state: str or + ~azure.mgmt.network.v2018_01_01.models.EffectiveRouteState + :param address_prefix: The address prefixes of the effective routes in + CIDR notation. + :type address_prefix: list[str] + :param next_hop_ip_address: The IP address of the next hop of the + effective route. + :type next_hop_ip_address: list[str] + :param next_hop_type: The type of Azure hop the packet should be sent to. + Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', + 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2018_01_01.models.RouteNextHopType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, source=None, state=None, address_prefix=None, next_hop_ip_address=None, next_hop_type=None, **kwargs) -> None: + super(EffectiveRoute, self).__init__(**kwargs) + self.name = name + self.source = source + self.state = state + self.address_prefix = address_prefix + self.next_hop_ip_address = next_hop_ip_address + self.next_hop_type = next_hop_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/endpoint_service_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/endpoint_service_result.py new file mode 100644 index 000000000000..9ca0e203a834 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/endpoint_service_result.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class EndpointServiceResult(SubResource): + """Endpoint service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Name of the endpoint service. + :vartype name: str + :ivar type: Type of the endpoint service. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EndpointServiceResult, self).__init__(**kwargs) + self.name = None + self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/endpoint_service_result_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/endpoint_service_result_paged.py new file mode 100644 index 000000000000..b6ff30f69246 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/endpoint_service_result_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class EndpointServiceResultPaged(Paged): + """ + A paging container for iterating over a list of :class:`EndpointServiceResult ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EndpointServiceResult]'} + } + + def __init__(self, *args, **kwargs): + + super(EndpointServiceResultPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/endpoint_service_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/endpoint_service_result_py3.py new file mode 100644 index 000000000000..c45df94a6533 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/endpoint_service_result_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class EndpointServiceResult(SubResource): + """Endpoint service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Name of the endpoint service. + :vartype name: str + :ivar type: Type of the endpoint service. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(EndpointServiceResult, self).__init__(id=id, **kwargs) + self.name = None + self.type = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/error.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/error.py new file mode 100644 index 000000000000..baa94d450910 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/error.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(Model): + """Error. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.network.v2018_01_01.models.ErrorDetails] + :param inner_error: + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/error_details.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/error_details.py new file mode 100644 index 000000000000..a8c4da6ba955 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/error_details.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """ErrorDetails. + + :param code: + :type code: str + :param target: + :type target: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/error_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/error_details_py3.py new file mode 100644 index 000000000000..d791f0895345 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/error_details_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ErrorDetails(Model): + """ErrorDetails. + + :param code: + :type code: str + :param target: + :type target: str + :param message: + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/error_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/error_py3.py new file mode 100644 index 000000000000..0af8841b3e0b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/error_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(Model): + """Error. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.network.v2018_01_01.models.ErrorDetails] + :param inner_error: + :type inner_error: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'inner_error': {'key': 'innerError', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, inner_error: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.inner_error = inner_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit.py new file mode 100644 index 000000000000..a9e2d562d75b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteCircuit(Resource): + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The SKU. + :type sku: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitSku + :param allow_classic_operations: Allow classic operations + :type allow_classic_operations: bool + :param circuit_provisioning_state: The CircuitProvisioningState state of + the resource. + :type circuit_provisioning_state: str + :param service_provider_provisioning_state: The + ServiceProviderProvisioningState state of the resource. Possible values + are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + 'Deprovisioning' + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2018_01_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering] + :param service_key: The ServiceKey. + :type service_key: str + :param service_provider_notes: The ServiceProviderNotes. + :type service_provider_notes: str + :param service_provider_properties: The ServiceProviderProperties. + :type service_provider_properties: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitServiceProviderProperties + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, + 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, + 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteCircuit, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.allow_classic_operations = kwargs.get('allow_classic_operations', None) + self.circuit_provisioning_state = kwargs.get('circuit_provisioning_state', None) + self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) + self.authorizations = kwargs.get('authorizations', None) + self.peerings = kwargs.get('peerings', None) + self.service_key = kwargs.get('service_key', None) + self.service_provider_notes = kwargs.get('service_provider_notes', None) + self.service_provider_properties = kwargs.get('service_provider_properties', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_arp_table.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_arp_table.py new file mode 100644 index 000000000000..826796619769 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_arp_table.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitArpTable(Model): + """The ARP table associated with the ExpressRouteCircuit. + + :param age: Age + :type age: int + :param interface: Interface + :type interface: str + :param ip_address: The IP address. + :type ip_address: str + :param mac_address: The MAC address. + :type mac_address: str + """ + + _attribute_map = { + 'age': {'key': 'age', 'type': 'int'}, + 'interface': {'key': 'interface', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = kwargs.get('age', None) + self.interface = kwargs.get('interface', None) + self.ip_address = kwargs.get('ip_address', None) + self.mac_address = kwargs.get('mac_address', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_arp_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_arp_table_py3.py new file mode 100644 index 000000000000..4401108c6001 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_arp_table_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitArpTable(Model): + """The ARP table associated with the ExpressRouteCircuit. + + :param age: Age + :type age: int + :param interface: Interface + :type interface: str + :param ip_address: The IP address. + :type ip_address: str + :param mac_address: The MAC address. + :type mac_address: str + """ + + _attribute_map = { + 'age': {'key': 'age', 'type': 'int'}, + 'interface': {'key': 'interface', 'type': 'str'}, + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + } + + def __init__(self, *, age: int=None, interface: str=None, ip_address: str=None, mac_address: str=None, **kwargs) -> None: + super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) + self.age = age + self.interface = interface + self.ip_address = ip_address + self.mac_address = mac_address diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_authorization.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_authorization.py new file mode 100644 index 000000000000..045fa0ecb4bb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_authorization.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param authorization_use_status: AuthorizationUseStatus. Possible values + are: 'Available' and 'InUse'. Possible values include: 'Available', + 'InUse' + :type authorization_use_status: str or + ~azure.mgmt.network.v2018_01_01.models.AuthorizationUseStatus + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteCircuitAuthorization, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.authorization_use_status = kwargs.get('authorization_use_status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_authorization_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_authorization_paged.py new file mode 100644 index 000000000000..d87f7eb53400 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_authorization_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ExpressRouteCircuitAuthorizationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ExpressRouteCircuitAuthorization ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ExpressRouteCircuitAuthorization]'} + } + + def __init__(self, *args, **kwargs): + + super(ExpressRouteCircuitAuthorizationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_authorization_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_authorization_py3.py new file mode 100644 index 000000000000..d1e540be03a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_authorization_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitAuthorization(SubResource): + """Authorization in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param authorization_key: The authorization key. + :type authorization_key: str + :param authorization_use_status: AuthorizationUseStatus. Possible values + are: 'Available' and 'InUse'. Possible values include: 'Available', + 'InUse' + :type authorization_use_status: str or + ~azure.mgmt.network.v2018_01_01.models.AuthorizationUseStatus + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, authorization_key: str=None, authorization_use_status=None, provisioning_state: str=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitAuthorization, self).__init__(id=id, **kwargs) + self.authorization_key = authorization_key + self.authorization_use_status = authorization_use_status + self.provisioning_state = provisioning_state + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_paged.py new file mode 100644 index 000000000000..e8c580f9077d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ExpressRouteCircuitPaged(Paged): + """ + A paging container for iterating over a list of :class:`ExpressRouteCircuit ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ExpressRouteCircuit]'} + } + + def __init__(self, *args, **kwargs): + + super(ExpressRouteCircuitPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering.py new file mode 100644 index 000000000000..1e6df6ac9a33 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering.py @@ -0,0 +1,124 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitPeering(SubResource): + """Peering in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param peering_type: The PeeringType. Possible values are: + 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. + Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + 'MicrosoftPeering' + :type peering_type: str or + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringType + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringState + :param azure_asn: The Azure ASN. + :type azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: long + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param primary_azure_port: The primary port. + :type primary_azure_port: str + :param secondary_azure_port: The secondary port. + :type secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringConfig + :param stats: Gets peering stats. + :type stats: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitStats + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :param last_modified_by: Gets whether the provider or the customer last + modified the peering. + :type last_modified_by: str + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2018_01_01.models.RouteFilter + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2018_01_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'peer_asn': {'maximum': 4294967295, 'minimum': 1}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'long'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'route_filter': {'key': 'properties.routeFilter', 'type': 'RouteFilter'}, + 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeering, self).__init__(**kwargs) + self.peering_type = kwargs.get('peering_type', None) + self.state = kwargs.get('state', None) + self.azure_asn = kwargs.get('azure_asn', None) + self.peer_asn = kwargs.get('peer_asn', None) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.primary_azure_port = kwargs.get('primary_azure_port', None) + self.secondary_azure_port = kwargs.get('secondary_azure_port', None) + self.shared_key = kwargs.get('shared_key', None) + self.vlan_id = kwargs.get('vlan_id', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.stats = kwargs.get('stats', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.route_filter = kwargs.get('route_filter', None) + self.ipv6_peering_config = kwargs.get('ipv6_peering_config', None) + self.name = kwargs.get('name', None) + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering_config.py new file mode 100644 index 000000000000..f5b1e35d1e17 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering_config.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitPeeringConfig(Model): + """Specifies the peering configuration. + + :param advertised_public_prefixes: The reference of + AdvertisedPublicPrefixes. + :type advertised_public_prefixes: list[str] + :param advertised_communities: The communities of bgp peering. Spepcified + for microsoft peering + :type advertised_communities: list[str] + :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of + the Peering resource. Possible values are 'NotConfigured', 'Configuring', + 'Configured', and 'ValidationNeeded'. Possible values include: + 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' + :type advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :param legacy_mode: The legacy mode of the peering. + :type legacy_mode: int + :param customer_asn: The CustomerASN of the peering. + :type customer_asn: int + :param routing_registry_name: The RoutingRegistryName of the + configuration. + :type routing_registry_name: str + """ + + _attribute_map = { + 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, + 'advertised_communities': {'key': 'advertisedCommunities', 'type': '[str]'}, + 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, + 'legacy_mode': {'key': 'legacyMode', 'type': 'int'}, + 'customer_asn': {'key': 'customerASN', 'type': 'int'}, + 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = kwargs.get('advertised_public_prefixes', None) + self.advertised_communities = kwargs.get('advertised_communities', None) + self.advertised_public_prefixes_state = kwargs.get('advertised_public_prefixes_state', None) + self.legacy_mode = kwargs.get('legacy_mode', None) + self.customer_asn = kwargs.get('customer_asn', None) + self.routing_registry_name = kwargs.get('routing_registry_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..35d68b4512ac --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering_config_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitPeeringConfig(Model): + """Specifies the peering configuration. + + :param advertised_public_prefixes: The reference of + AdvertisedPublicPrefixes. + :type advertised_public_prefixes: list[str] + :param advertised_communities: The communities of bgp peering. Spepcified + for microsoft peering + :type advertised_communities: list[str] + :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of + the Peering resource. Possible values are 'NotConfigured', 'Configuring', + 'Configured', and 'ValidationNeeded'. Possible values include: + 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' + :type advertised_public_prefixes_state: str or + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState + :param legacy_mode: The legacy mode of the peering. + :type legacy_mode: int + :param customer_asn: The CustomerASN of the peering. + :type customer_asn: int + :param routing_registry_name: The RoutingRegistryName of the + configuration. + :type routing_registry_name: str + """ + + _attribute_map = { + 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, + 'advertised_communities': {'key': 'advertisedCommunities', 'type': '[str]'}, + 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, + 'legacy_mode': {'key': 'legacyMode', 'type': 'int'}, + 'customer_asn': {'key': 'customerASN', 'type': 'int'}, + 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, + } + + def __init__(self, *, advertised_public_prefixes=None, advertised_communities=None, advertised_public_prefixes_state=None, legacy_mode: int=None, customer_asn: int=None, routing_registry_name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.advertised_public_prefixes = advertised_public_prefixes + self.advertised_communities = advertised_communities + self.advertised_public_prefixes_state = advertised_public_prefixes_state + self.legacy_mode = legacy_mode + self.customer_asn = customer_asn + self.routing_registry_name = routing_registry_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering_paged.py new file mode 100644 index 000000000000..312c80dc981e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ExpressRouteCircuitPeeringPaged(Paged): + """ + A paging container for iterating over a list of :class:`ExpressRouteCircuitPeering ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ExpressRouteCircuitPeering]'} + } + + def __init__(self, *args, **kwargs): + + super(ExpressRouteCircuitPeeringPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering_py3.py new file mode 100644 index 000000000000..c451b2d111fd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_peering_py3.py @@ -0,0 +1,124 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ExpressRouteCircuitPeering(SubResource): + """Peering in an ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param peering_type: The PeeringType. Possible values are: + 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. + Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', + 'MicrosoftPeering' + :type peering_type: str or + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringType + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringState + :param azure_asn: The Azure ASN. + :type azure_asn: int + :param peer_asn: The peer ASN. + :type peer_asn: long + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param primary_azure_port: The primary port. + :type primary_azure_port: str + :param secondary_azure_port: The secondary port. + :type secondary_azure_port: str + :param shared_key: The shared key. + :type shared_key: str + :param vlan_id: The VLAN ID. + :type vlan_id: int + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringConfig + :param stats: Gets peering stats. + :type stats: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitStats + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :param last_modified_by: Gets whether the provider or the customer last + modified the peering. + :type last_modified_by: str + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2018_01_01.models.RouteFilter + :param ipv6_peering_config: The IPv6 peering configuration. + :type ipv6_peering_config: + ~azure.mgmt.network.v2018_01_01.models.Ipv6ExpressRouteCircuitPeeringConfig + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'peer_asn': {'maximum': 4294967295, 'minimum': 1}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, + 'peer_asn': {'key': 'properties.peerASN', 'type': 'long'}, + 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, + 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, + 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, + 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, + 'route_filter': {'key': 'properties.routeFilter', 'type': 'RouteFilter'}, + 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, peering_type=None, state=None, azure_asn: int=None, peer_asn: int=None, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, primary_azure_port: str=None, secondary_azure_port: str=None, shared_key: str=None, vlan_id: int=None, microsoft_peering_config=None, stats=None, provisioning_state: str=None, gateway_manager_etag: str=None, last_modified_by: str=None, route_filter=None, ipv6_peering_config=None, name: str=None, **kwargs) -> None: + super(ExpressRouteCircuitPeering, self).__init__(id=id, **kwargs) + self.peering_type = peering_type + self.state = state + self.azure_asn = azure_asn + self.peer_asn = peer_asn + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.primary_azure_port = primary_azure_port + self.secondary_azure_port = secondary_azure_port + self.shared_key = shared_key + self.vlan_id = vlan_id + self.microsoft_peering_config = microsoft_peering_config + self.stats = stats + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.last_modified_by = last_modified_by + self.route_filter = route_filter + self.ipv6_peering_config = ipv6_peering_config + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_py3.py new file mode 100644 index 000000000000..b0a46bd250e6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_py3.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteCircuit(Resource): + """ExpressRouteCircuit resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The SKU. + :type sku: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitSku + :param allow_classic_operations: Allow classic operations + :type allow_classic_operations: bool + :param circuit_provisioning_state: The CircuitProvisioningState state of + the resource. + :type circuit_provisioning_state: str + :param service_provider_provisioning_state: The + ServiceProviderProvisioningState state of the resource. Possible values + are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. + Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', + 'Deprovisioning' + :type service_provider_provisioning_state: str or + ~azure.mgmt.network.v2018_01_01.models.ServiceProviderProvisioningState + :param authorizations: The list of authorizations. + :type authorizations: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitAuthorization] + :param peerings: The list of peerings. + :type peerings: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering] + :param service_key: The ServiceKey. + :type service_key: str + :param service_provider_notes: The ServiceProviderNotes. + :type service_provider_notes: str + :param service_provider_properties: The ServiceProviderProperties. + :type service_provider_properties: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitServiceProviderProperties + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param gateway_manager_etag: The GatewayManager Etag. + :type gateway_manager_etag: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, + 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, + 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, + 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, + 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, + 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, allow_classic_operations: bool=None, circuit_provisioning_state: str=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key: str=None, service_provider_notes: str=None, service_provider_properties=None, provisioning_state: str=None, gateway_manager_etag: str=None, **kwargs) -> None: + super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.allow_classic_operations = allow_classic_operations + self.circuit_provisioning_state = circuit_provisioning_state + self.service_provider_provisioning_state = service_provider_provisioning_state + self.authorizations = authorizations + self.peerings = peerings + self.service_key = service_key + self.service_provider_notes = service_provider_notes + self.service_provider_properties = service_provider_properties + self.provisioning_state = provisioning_state + self.gateway_manager_etag = gateway_manager_etag + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_routes_table.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_routes_table.py new file mode 100644 index 000000000000..7517e9867cfb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_routes_table.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTable(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param network: network + :type network: str + :param next_hop: nextHop + :type next_hop: str + :param loc_prf: locPrf + :type loc_prf: str + :param weight: weight. + :type weight: int + :param path: path + :type path: str + """ + + _attribute_map = { + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'loc_prf': {'key': 'locPrf', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = kwargs.get('network', None) + self.next_hop = kwargs.get('next_hop', None) + self.loc_prf = kwargs.get('loc_prf', None) + self.weight = kwargs.get('weight', None) + self.path = kwargs.get('path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_routes_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_routes_table_py3.py new file mode 100644 index 000000000000..38ea85cf642d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_routes_table_py3.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTable(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param network: network + :type network: str + :param next_hop: nextHop + :type next_hop: str + :param loc_prf: locPrf + :type loc_prf: str + :param weight: weight. + :type weight: int + :param path: path + :type path: str + """ + + _attribute_map = { + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'loc_prf': {'key': 'locPrf', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, *, network: str=None, next_hop: str=None, loc_prf: str=None, weight: int=None, path: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) + self.network = network + self.next_hop = next_hop + self.loc_prf = loc_prf + self.weight = weight + self.path = path diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_routes_table_summary.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_routes_table_summary.py new file mode 100644 index 000000000000..577c3c2edd45 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_routes_table_summary.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTableSummary(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: Neighbor + :type neighbor: str + :param v: BGP version number spoken to the neighbor. + :type v: int + :param as_property: Autonomous system number. + :type as_property: int + :param up_down: The length of time that the BGP session has been in the + Established state, or the current status if not in the Established state. + :type up_down: str + :param state_pfx_rcd: Current state of the BGP session, and the number of + prefixes that have been received from a neighbor or peer group. + :type state_pfx_rcd: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'v': {'key': 'v', 'type': 'int'}, + 'as_property': {'key': 'as', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = kwargs.get('neighbor', None) + self.v = kwargs.get('v', None) + self.as_property = kwargs.get('as_property', None) + self.up_down = kwargs.get('up_down', None) + self.state_pfx_rcd = kwargs.get('state_pfx_rcd', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_routes_table_summary_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_routes_table_summary_py3.py new file mode 100644 index 000000000000..e18d0051d218 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_routes_table_summary_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitRoutesTableSummary(Model): + """The routes table associated with the ExpressRouteCircuit. + + :param neighbor: Neighbor + :type neighbor: str + :param v: BGP version number spoken to the neighbor. + :type v: int + :param as_property: Autonomous system number. + :type as_property: int + :param up_down: The length of time that the BGP session has been in the + Established state, or the current status if not in the Established state. + :type up_down: str + :param state_pfx_rcd: Current state of the BGP session, and the number of + prefixes that have been received from a neighbor or peer group. + :type state_pfx_rcd: str + """ + + _attribute_map = { + 'neighbor': {'key': 'neighbor', 'type': 'str'}, + 'v': {'key': 'v', 'type': 'int'}, + 'as_property': {'key': 'as', 'type': 'int'}, + 'up_down': {'key': 'upDown', 'type': 'str'}, + 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, + } + + def __init__(self, *, neighbor: str=None, v: int=None, as_property: int=None, up_down: str=None, state_pfx_rcd: str=None, **kwargs) -> None: + super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) + self.neighbor = neighbor + self.v = v + self.as_property = as_property + self.up_down = up_down + self.state_pfx_rcd = state_pfx_rcd diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_service_provider_properties.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_service_provider_properties.py new file mode 100644 index 000000000000..c51e6d8d653b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_service_provider_properties.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitServiceProviderProperties(Model): + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :param service_provider_name: The serviceProviderName. + :type service_provider_name: str + :param peering_location: The peering location. + :type peering_location: str + :param bandwidth_in_mbps: The BandwidthInMbps. + :type bandwidth_in_mbps: int + """ + + _attribute_map = { + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = kwargs.get('service_provider_name', None) + self.peering_location = kwargs.get('peering_location', None) + self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_service_provider_properties_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_service_provider_properties_py3.py new file mode 100644 index 000000000000..ea701a54c3fe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_service_provider_properties_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitServiceProviderProperties(Model): + """Contains ServiceProviderProperties in an ExpressRouteCircuit. + + :param service_provider_name: The serviceProviderName. + :type service_provider_name: str + :param peering_location: The peering location. + :type peering_location: str + :param bandwidth_in_mbps: The BandwidthInMbps. + :type bandwidth_in_mbps: int + """ + + _attribute_map = { + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + } + + def __init__(self, *, service_provider_name: str=None, peering_location: str=None, bandwidth_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) + self.service_provider_name = service_provider_name + self.peering_location = peering_location + self.bandwidth_in_mbps = bandwidth_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_sku.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_sku.py new file mode 100644 index 000000000000..329b3ee5fcbf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_sku.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitSku(Model): + """Contains SKU in an ExpressRouteCircuit. + + :param name: The name of the SKU. + :type name: str + :param tier: The tier of the SKU. Possible values are 'Standard' and + 'Premium'. Possible values include: 'Standard', 'Premium' + :type tier: str or + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values are: 'UnlimitedData' + and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' + :type family: str or + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.family = kwargs.get('family', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_sku_py3.py new file mode 100644 index 000000000000..535fe040c902 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_sku_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitSku(Model): + """Contains SKU in an ExpressRouteCircuit. + + :param name: The name of the SKU. + :type name: str + :param tier: The tier of the SKU. Possible values are 'Standard' and + 'Premium'. Possible values include: 'Standard', 'Premium' + :type tier: str or + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitSkuTier + :param family: The family of the SKU. Possible values are: 'UnlimitedData' + and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' + :type family: str or + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitSkuFamily + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, tier=None, family=None, **kwargs) -> None: + super(ExpressRouteCircuitSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.family = family diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_stats.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_stats.py new file mode 100644 index 000000000000..41c45ae2b19a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_stats.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitStats(Model): + """Contains stats associated with the peering. + + :param primarybytes_in: Gets BytesIn of the peering. + :type primarybytes_in: long + :param primarybytes_out: Gets BytesOut of the peering. + :type primarybytes_out: long + :param secondarybytes_in: Gets BytesIn of the peering. + :type secondarybytes_in: long + :param secondarybytes_out: Gets BytesOut of the peering. + :type secondarybytes_out: long + """ + + _attribute_map = { + 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, + 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, + 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, + 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = kwargs.get('primarybytes_in', None) + self.primarybytes_out = kwargs.get('primarybytes_out', None) + self.secondarybytes_in = kwargs.get('secondarybytes_in', None) + self.secondarybytes_out = kwargs.get('secondarybytes_out', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_stats_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_stats_py3.py new file mode 100644 index 000000000000..f78335343544 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuit_stats_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitStats(Model): + """Contains stats associated with the peering. + + :param primarybytes_in: Gets BytesIn of the peering. + :type primarybytes_in: long + :param primarybytes_out: Gets BytesOut of the peering. + :type primarybytes_out: long + :param secondarybytes_in: Gets BytesIn of the peering. + :type secondarybytes_in: long + :param secondarybytes_out: Gets BytesOut of the peering. + :type secondarybytes_out: long + """ + + _attribute_map = { + 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, + 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, + 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, + 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, + } + + def __init__(self, *, primarybytes_in: int=None, primarybytes_out: int=None, secondarybytes_in: int=None, secondarybytes_out: int=None, **kwargs) -> None: + super(ExpressRouteCircuitStats, self).__init__(**kwargs) + self.primarybytes_in = primarybytes_in + self.primarybytes_out = primarybytes_out + self.secondarybytes_in = secondarybytes_in + self.secondarybytes_out = secondarybytes_out diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_arp_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_arp_table_list_result.py new file mode 100644 index 000000000000..01988dc9e6c5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_arp_table_list_result.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsArpTableListResult(Model): + """Response for ListArpTable associated with the Express Route Circuits API. + + :param value: Gets list of the ARP table. + :type value: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitArpTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_arp_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_arp_table_list_result_py3.py new file mode 100644 index 000000000000..340710bedd60 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_arp_table_list_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsArpTableListResult(Model): + """Response for ListArpTable associated with the Express Route Circuits API. + + :param value: Gets list of the ARP table. + :type value: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitArpTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_routes_table_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_routes_table_list_result.py new file mode 100644 index 000000000000..2e5ccc86d843 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_routes_table_list_result.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: The list of routes table. + :type value: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitRoutesTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_routes_table_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_routes_table_list_result_py3.py new file mode 100644 index 000000000000..bf24bb65fbda --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_routes_table_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: The list of routes table. + :type value: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitRoutesTable] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_routes_table_summary_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_routes_table_summary_list_result.py new file mode 100644 index 000000000000..73561b282c25 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_routes_table_summary_list_result.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: A list of the routes table. + :type value: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitRoutesTableSummary] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_routes_table_summary_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_routes_table_summary_list_result_py3.py new file mode 100644 index 000000000000..6d6f48ff2031 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_circuits_routes_table_summary_list_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteCircuitsRoutesTableSummaryListResult(Model): + """Response for ListRoutesTable associated with the Express Route Circuits + API. + + :param value: A list of the routes table. + :type value: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitRoutesTableSummary] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider.py new file mode 100644 index 000000000000..e2ad95f1a94a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param peering_locations: Get a list of peering locations. + :type peering_locations: list[str] + :param bandwidths_offered: Gets bandwidths offered. + :type bandwidths_offered: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteServiceProviderBandwidthsOffered] + :param provisioning_state: Gets the provisioning state of the resource. + :type provisioning_state: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, + 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteServiceProvider, self).__init__(**kwargs) + self.peering_locations = kwargs.get('peering_locations', None) + self.bandwidths_offered = kwargs.get('bandwidths_offered', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider_bandwidths_offered.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider_bandwidths_offered.py new file mode 100644 index 000000000000..b27622af42d1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider_bandwidths_offered.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteServiceProviderBandwidthsOffered(Model): + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :param offer_name: The OfferName. + :type offer_name: str + :param value_in_mbps: The ValueInMbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = kwargs.get('offer_name', None) + self.value_in_mbps = kwargs.get('value_in_mbps', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider_bandwidths_offered_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider_bandwidths_offered_py3.py new file mode 100644 index 000000000000..88516a0dfcf8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider_bandwidths_offered_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ExpressRouteServiceProviderBandwidthsOffered(Model): + """Contains bandwidths offered in ExpressRouteServiceProvider resources. + + :param offer_name: The OfferName. + :type offer_name: str + :param value_in_mbps: The ValueInMbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__(self, *, offer_name: str=None, value_in_mbps: int=None, **kwargs) -> None: + super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) + self.offer_name = offer_name + self.value_in_mbps = value_in_mbps diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider_paged.py new file mode 100644 index 000000000000..fe41e448b2f6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ExpressRouteServiceProviderPaged(Paged): + """ + A paging container for iterating over a list of :class:`ExpressRouteServiceProvider ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ExpressRouteServiceProvider]'} + } + + def __init__(self, *args, **kwargs): + + super(ExpressRouteServiceProviderPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider_py3.py new file mode 100644 index 000000000000..c5e5b0a84414 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/express_route_service_provider_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ExpressRouteServiceProvider(Resource): + """A ExpressRouteResourceProvider object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param peering_locations: Get a list of peering locations. + :type peering_locations: list[str] + :param bandwidths_offered: Gets bandwidths offered. + :type bandwidths_offered: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteServiceProviderBandwidthsOffered] + :param provisioning_state: Gets the provisioning state of the resource. + :type provisioning_state: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, + 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, peering_locations=None, bandwidths_offered=None, provisioning_state: str=None, **kwargs) -> None: + super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.peering_locations = peering_locations + self.bandwidths_offered = bandwidths_offered + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/flow_log_information.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/flow_log_information.py new file mode 100644 index 000000000000..5ed5055c3b7d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/flow_log_information.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogInformation(Model): + """Information on the configuration of flow log and traffic analytics + (optional). + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. + :type target_resource_id: str + :param storage_id: Required. ID of the storage account which is used to + store the flow log. + :type storage_id: str + :param enabled: Required. Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: + :type retention_policy: + ~azure.mgmt.network.v2018_01_01.models.RetentionPolicyParameters + :param network_watcher_flow_analytics_configuration: Required. + :type network_watcher_flow_analytics_configuration: + ~azure.mgmt.network.v2018_01_01.models.TrafficAnalyticsConfigurationProperties + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'enabled': {'required': True}, + 'network_watcher_flow_analytics_configuration': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + 'network_watcher_flow_analytics_configuration': {'key': 'flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration', 'type': 'TrafficAnalyticsConfigurationProperties'}, + } + + def __init__(self, **kwargs): + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.enabled = kwargs.get('enabled', None) + self.retention_policy = kwargs.get('retention_policy', None) + self.network_watcher_flow_analytics_configuration = kwargs.get('network_watcher_flow_analytics_configuration', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/flow_log_information_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/flow_log_information_py3.py new file mode 100644 index 000000000000..bec01d35bcc9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/flow_log_information_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogInformation(Model): + """Information on the configuration of flow log and traffic analytics + (optional). + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the resource to configure + for flow logging. + :type target_resource_id: str + :param storage_id: Required. ID of the storage account which is used to + store the flow log. + :type storage_id: str + :param enabled: Required. Flag to enable/disable flow logging. + :type enabled: bool + :param retention_policy: + :type retention_policy: + ~azure.mgmt.network.v2018_01_01.models.RetentionPolicyParameters + :param network_watcher_flow_analytics_configuration: Required. + :type network_watcher_flow_analytics_configuration: + ~azure.mgmt.network.v2018_01_01.models.TrafficAnalyticsConfigurationProperties + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'enabled': {'required': True}, + 'network_watcher_flow_analytics_configuration': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, + 'network_watcher_flow_analytics_configuration': {'key': 'flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration', 'type': 'TrafficAnalyticsConfigurationProperties'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, enabled: bool, network_watcher_flow_analytics_configuration, retention_policy=None, **kwargs) -> None: + super(FlowLogInformation, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.enabled = enabled + self.retention_policy = retention_policy + self.network_watcher_flow_analytics_configuration = network_watcher_flow_analytics_configuration diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/flow_log_status_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/flow_log_status_parameters.py new file mode 100644 index 000000000000..9848496b9fe6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/flow_log_status_parameters.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogStatusParameters(Model): + """Parameters that define a resource to query flow log and traffic analytics + (optional) status. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging and traffic analytics (optional) status. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/flow_log_status_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/flow_log_status_parameters_py3.py new file mode 100644 index 000000000000..9fbadc1113ea --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/flow_log_status_parameters_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class FlowLogStatusParameters(Model): + """Parameters that define a resource to query flow log and traffic analytics + (optional) status. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource where getting the + flow logging and traffic analytics (optional) status. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(FlowLogStatusParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/frontend_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/frontend_ip_configuration.py new file mode 100644 index 000000000000..a52e4e4b9f21 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/frontend_ip_configuration.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class FrontendIPConfiguration(SubResource): + """Frontend IP address of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar inbound_nat_rules: Read only. Inbound rules URIs that use this + frontend IP. + :vartype inbound_nat_rules: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :ivar inbound_nat_pools: Read only. Inbound pools URIs that use this + frontend IP. + :vartype inbound_nat_pools: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :ivar outbound_nat_rules: Read only. Outbound rules URIs that use this + frontend IP. + :vartype outbound_nat_rules: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :ivar load_balancing_rules: Gets load balancing rules URIs that use this + frontend IP. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The Private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2018_01_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.Subnet + :param public_ip_address: The reference of the Public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'inbound_nat_rules': {'readonly': True}, + 'inbound_nat_pools': {'readonly': True}, + 'outbound_nat_rules': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[SubResource]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(FrontendIPConfiguration, self).__init__(**kwargs) + self.inbound_nat_rules = None + self.inbound_nat_pools = None + self.outbound_nat_rules = None + self.load_balancing_rules = None + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/frontend_ip_configuration_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/frontend_ip_configuration_paged.py new file mode 100644 index 000000000000..25b0319d05d2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/frontend_ip_configuration_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class FrontendIPConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`FrontendIPConfiguration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[FrontendIPConfiguration]'} + } + + def __init__(self, *args, **kwargs): + + super(FrontendIPConfigurationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/frontend_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/frontend_ip_configuration_py3.py new file mode 100644 index 000000000000..eb3f8e00b2e3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/frontend_ip_configuration_py3.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class FrontendIPConfiguration(SubResource): + """Frontend IP address of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar inbound_nat_rules: Read only. Inbound rules URIs that use this + frontend IP. + :vartype inbound_nat_rules: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :ivar inbound_nat_pools: Read only. Inbound pools URIs that use this + frontend IP. + :vartype inbound_nat_pools: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :ivar outbound_nat_rules: Read only. Outbound rules URIs that use this + frontend IP. + :vartype outbound_nat_rules: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :ivar load_balancing_rules: Gets load balancing rules URIs that use this + frontend IP. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The Private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2018_01_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.Subnet + :param public_ip_address: The reference of the Public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'inbound_nat_rules': {'readonly': True}, + 'inbound_nat_pools': {'readonly': True}, + 'outbound_nat_rules': {'readonly': True}, + 'load_balancing_rules': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[SubResource]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, zones=None, **kwargs) -> None: + super(FrontendIPConfiguration, self).__init__(id=id, **kwargs) + self.inbound_nat_rules = None + self.inbound_nat_pools = None + self.outbound_nat_rules = None + self.load_balancing_rules = None + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag + self.zones = zones diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/gateway_route.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/gateway_route.py new file mode 100644 index 000000000000..0b96cb661e70 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/gateway_route.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRoute(Model): + """Gateway routing details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The gateway's local address + :vartype local_address: str + :ivar network: The route's network prefix + :vartype network: str + :ivar next_hop: The route's next hop + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from + :vartype source_peer: str + :ivar origin: The source this route was learned from + :vartype origin: str + :ivar as_path: The route's AS path sequence + :vartype as_path: str + :ivar weight: The route's weight + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(GatewayRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/gateway_route_list_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/gateway_route_list_result.py new file mode 100644 index 000000000000..bb4452aab659 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/gateway_route_list_result.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRouteListResult(Model): + """List of virtual network gateway routes. + + :param value: List of gateway routes + :type value: list[~azure.mgmt.network.v2018_01_01.models.GatewayRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayRoute]'}, + } + + def __init__(self, **kwargs): + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/gateway_route_list_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/gateway_route_list_result_py3.py new file mode 100644 index 000000000000..1e871a47e3b7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/gateway_route_list_result_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRouteListResult(Model): + """List of virtual network gateway routes. + + :param value: List of gateway routes + :type value: list[~azure.mgmt.network.v2018_01_01.models.GatewayRoute] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayRoute]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(GatewayRouteListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/gateway_route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/gateway_route_py3.py new file mode 100644 index 000000000000..1aa3ba60605f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/gateway_route_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class GatewayRoute(Model): + """Gateway routing details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar local_address: The gateway's local address + :vartype local_address: str + :ivar network: The route's network prefix + :vartype network: str + :ivar next_hop: The route's next hop + :vartype next_hop: str + :ivar source_peer: The peer this route was learned from + :vartype source_peer: str + :ivar origin: The source this route was learned from + :vartype origin: str + :ivar as_path: The route's AS path sequence + :vartype as_path: str + :ivar weight: The route's weight + :vartype weight: int + """ + + _validation = { + 'local_address': {'readonly': True}, + 'network': {'readonly': True}, + 'next_hop': {'readonly': True}, + 'source_peer': {'readonly': True}, + 'origin': {'readonly': True}, + 'as_path': {'readonly': True}, + 'weight': {'readonly': True}, + } + + _attribute_map = { + 'local_address': {'key': 'localAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'str'}, + 'next_hop': {'key': 'nextHop', 'type': 'str'}, + 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'as_path': {'key': 'asPath', 'type': 'str'}, + 'weight': {'key': 'weight', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(GatewayRoute, self).__init__(**kwargs) + self.local_address = None + self.network = None + self.next_hop = None + self.source_peer = None + self.origin = None + self.as_path = None + self.weight = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_pool.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_pool.py new file mode 100644 index 000000000000..a9e3f8c32c33 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_pool.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatPool(SubResource): + """Inbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.TransportProtocol + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. + :type frontend_port_range_start: int + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. + :type frontend_port_range_end: int + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port_range_start': {'required': True}, + 'frontend_port_range_end': {'required': True}, + 'backend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, + 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InboundNatPool, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.protocol = kwargs.get('protocol', None) + self.frontend_port_range_start = kwargs.get('frontend_port_range_start', None) + self.frontend_port_range_end = kwargs.get('frontend_port_range_end', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_pool_py3.py new file mode 100644 index 000000000000..14dfb221ab1a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_pool_py3.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatPool(SubResource): + """Inbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.TransportProtocol + :param frontend_port_range_start: Required. The first port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65534. + :type frontend_port_range_start: int + :param frontend_port_range_end: Required. The last port number in the + range of external ports that will be used to provide Inbound Nat to NICs + associated with a load balancer. Acceptable values range between 1 and + 65535. + :type frontend_port_range_end: int + :param backend_port: Required. The port used for internal connections on + the endpoint. Acceptable values are between 1 and 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port_range_start': {'required': True}, + 'frontend_port_range_end': {'required': True}, + 'backend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, + 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port_range_start: int, frontend_port_range_end: int, backend_port: int, id: str=None, frontend_ip_configuration=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatPool, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.protocol = protocol + self.frontend_port_range_start = frontend_port_range_start + self.frontend_port_range_end = frontend_port_range_end + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_rule.py new file mode 100644 index 000000000000..55c0396b7b2a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_rule.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatRule(SubResource): + """Inbound NAT rule of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :ivar backend_ip_configuration: A reference to a private IP address + defined on a network interface of a VM. Traffic sent to the frontend port + of each of the frontend IP configurations is forwarded to the backend IP. + :vartype backend_ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration + :param protocol: Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.TransportProtocol + :param frontend_port: The port for the external endpoint. Port numbers for + each rule must be unique within the Load Balancer. Acceptable values range + from 1 to 65534. + :type frontend_port: int + :param backend_port: The port used for the internal endpoint. Acceptable + values range from 1 to 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InboundNatRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_ip_configuration = None + self.protocol = kwargs.get('protocol', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_rule_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_rule_paged.py new file mode 100644 index 000000000000..e530f95109a2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_rule_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class InboundNatRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`InboundNatRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[InboundNatRule]'} + } + + def __init__(self, *args, **kwargs): + + super(InboundNatRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_rule_py3.py new file mode 100644 index 000000000000..c5c9b3eb38c0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/inbound_nat_rule_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class InboundNatRule(SubResource): + """Inbound NAT rule of the load balancer. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :ivar backend_ip_configuration: A reference to a private IP address + defined on a network interface of a VM. Traffic sent to the frontend port + of each of the frontend IP configurations is forwarded to the backend IP. + :vartype backend_ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration + :param protocol: Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.TransportProtocol + :param frontend_port: The port for the external endpoint. Port numbers for + each rule must be unique within the Load Balancer. Acceptable values range + from 1 to 65534. + :type frontend_port: int + :param backend_port: The port used for the internal endpoint. Acceptable + values range from 1 to 65535. + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, frontend_ip_configuration=None, protocol=None, frontend_port: int=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(InboundNatRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_ip_configuration = None + self.protocol = protocol + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_address_availability_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_address_availability_result.py new file mode 100644 index 000000000000..6bcf52275711 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_address_availability_result.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPAddressAvailabilityResult(Model): + """Response for CheckIPAddressAvailability API service call. + + :param available: Private IP address availability. + :type available: bool + :param available_ip_addresses: Contains other available private IP + addresses if the asked for address is taken. + :type available_ip_addresses: list[str] + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = kwargs.get('available', None) + self.available_ip_addresses = kwargs.get('available_ip_addresses', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_address_availability_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_address_availability_result_py3.py new file mode 100644 index 000000000000..e5fc4340d370 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_address_availability_result_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPAddressAvailabilityResult(Model): + """Response for CheckIPAddressAvailability API service call. + + :param available: Private IP address availability. + :type available: bool + :param available_ip_addresses: Contains other available private IP + addresses if the asked for address is taken. + :type available_ip_addresses: list[str] + """ + + _attribute_map = { + 'available': {'key': 'available', 'type': 'bool'}, + 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, + } + + def __init__(self, *, available: bool=None, available_ip_addresses=None, **kwargs) -> None: + super(IPAddressAvailabilityResult, self).__init__(**kwargs) + self.available = available + self.available_ip_addresses = available_ip_addresses diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_configuration.py new file mode 100644 index 000000000000..b6240c772b28 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_configuration.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class IPConfiguration(SubResource): + """IP configuration. + + :param id: Resource ID. + :type id: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2018_01_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.Subnet + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_configuration_py3.py new file mode 100644 index 000000000000..bec8b1936d0f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_configuration_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class IPConfiguration(SubResource): + """IP configuration. + + :param id: Resource ID. + :type id: str + :param private_ip_address: The private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2018_01_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.Subnet + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(IPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_tag.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_tag.py new file mode 100644 index 000000000000..b8690371226d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_tag.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IpTag(Model): + """Contains the IpTag associated with the public IP address. + + :param ip_tag_type: Gets or sets the ipTag type: Example FirstPartyUsage. + :type ip_tag_type: str + :param tag: Gets or sets value of the IpTag associated with the public IP. + Example SQL, Storage etc + :type tag: str + """ + + _attribute_map = { + 'ip_tag_type': {'key': 'ipTagType', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IpTag, self).__init__(**kwargs) + self.ip_tag_type = kwargs.get('ip_tag_type', None) + self.tag = kwargs.get('tag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_tag_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_tag_py3.py new file mode 100644 index 000000000000..fbb5338ff30e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ip_tag_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IpTag(Model): + """Contains the IpTag associated with the public IP address. + + :param ip_tag_type: Gets or sets the ipTag type: Example FirstPartyUsage. + :type ip_tag_type: str + :param tag: Gets or sets value of the IpTag associated with the public IP. + Example SQL, Storage etc + :type tag: str + """ + + _attribute_map = { + 'ip_tag_type': {'key': 'ipTagType', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + } + + def __init__(self, *, ip_tag_type: str=None, tag: str=None, **kwargs) -> None: + super(IpTag, self).__init__(**kwargs) + self.ip_tag_type = ip_tag_type + self.tag = tag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ipsec_policy.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ipsec_policy.py new file mode 100644 index 000000000000..b087a99b6ca5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ipsec_policy.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IpsecPolicy(Model): + """An IPSec Policy configuration for a virtual network gateway connection. + + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. + :type sa_life_time_seconds: int + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. + :type sa_data_size_kilobytes: int + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :type ipsec_encryption: str or + ~azure.mgmt.network.v2018_01_01.models.IpsecEncryption + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + 'GCMAES192', 'GCMAES256' + :type ipsec_integrity: str or + ~azure.mgmt.network.v2018_01_01.models.IpsecIntegrity + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :type ike_encryption: str or + ~azure.mgmt.network.v2018_01_01.models.IkeEncryption + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :type ike_integrity: str or + ~azure.mgmt.network.v2018_01_01.models.IkeIntegrity + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + :type dh_group: str or ~azure.mgmt.network.v2018_01_01.models.DhGroup + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' + :type pfs_group: str or ~azure.mgmt.network.v2018_01_01.models.PfsGroup + """ + + _validation = { + 'sa_life_time_seconds': {'required': True}, + 'sa_data_size_kilobytes': {'required': True}, + 'ipsec_encryption': {'required': True}, + 'ipsec_integrity': {'required': True}, + 'ike_encryption': {'required': True}, + 'ike_integrity': {'required': True}, + 'dh_group': {'required': True}, + 'pfs_group': {'required': True}, + } + + _attribute_map = { + 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, + 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, + 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, + 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, + 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, + 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, + 'dh_group': {'key': 'dhGroup', 'type': 'str'}, + 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = kwargs.get('sa_life_time_seconds', None) + self.sa_data_size_kilobytes = kwargs.get('sa_data_size_kilobytes', None) + self.ipsec_encryption = kwargs.get('ipsec_encryption', None) + self.ipsec_integrity = kwargs.get('ipsec_integrity', None) + self.ike_encryption = kwargs.get('ike_encryption', None) + self.ike_integrity = kwargs.get('ike_integrity', None) + self.dh_group = kwargs.get('dh_group', None) + self.pfs_group = kwargs.get('pfs_group', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ipsec_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ipsec_policy_py3.py new file mode 100644 index 000000000000..10c91a853150 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ipsec_policy_py3.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IpsecPolicy(Model): + """An IPSec Policy configuration for a virtual network gateway connection. + + All required parameters must be populated in order to send to Azure. + + :param sa_life_time_seconds: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to + site VPN tunnel. + :type sa_life_time_seconds: int + :param sa_data_size_kilobytes: Required. The IPSec Security Association + (also called Quick Mode or Phase 2 SA) payload size in KB for a site to + site VPN tunnel. + :type sa_data_size_kilobytes: int + :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE + phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', + 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' + :type ipsec_encryption: str or + ~azure.mgmt.network.v2018_01_01.models.IpsecEncryption + :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase + 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', + 'GCMAES192', 'GCMAES256' + :type ipsec_integrity: str or + ~azure.mgmt.network.v2018_01_01.models.IpsecIntegrity + :param ike_encryption: Required. The IKE encryption algorithm (IKE phase + 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' + :type ike_encryption: str or + ~azure.mgmt.network.v2018_01_01.models.IkeEncryption + :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). + Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' + :type ike_integrity: str or + ~azure.mgmt.network.v2018_01_01.models.IkeIntegrity + :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial + SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', + 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' + :type dh_group: str or ~azure.mgmt.network.v2018_01_01.models.DhGroup + :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new + child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', + 'ECP256', 'ECP384', 'PFS24' + :type pfs_group: str or ~azure.mgmt.network.v2018_01_01.models.PfsGroup + """ + + _validation = { + 'sa_life_time_seconds': {'required': True}, + 'sa_data_size_kilobytes': {'required': True}, + 'ipsec_encryption': {'required': True}, + 'ipsec_integrity': {'required': True}, + 'ike_encryption': {'required': True}, + 'ike_integrity': {'required': True}, + 'dh_group': {'required': True}, + 'pfs_group': {'required': True}, + } + + _attribute_map = { + 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, + 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, + 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, + 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, + 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, + 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, + 'dh_group': {'key': 'dhGroup', 'type': 'str'}, + 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, + } + + def __init__(self, *, sa_life_time_seconds: int, sa_data_size_kilobytes: int, ipsec_encryption, ipsec_integrity, ike_encryption, ike_integrity, dh_group, pfs_group, **kwargs) -> None: + super(IpsecPolicy, self).__init__(**kwargs) + self.sa_life_time_seconds = sa_life_time_seconds + self.sa_data_size_kilobytes = sa_data_size_kilobytes + self.ipsec_encryption = ipsec_encryption + self.ipsec_integrity = ipsec_integrity + self.ike_encryption = ike_encryption + self.ike_integrity = ike_integrity + self.dh_group = dh_group + self.pfs_group = pfs_group diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ipv6_express_route_circuit_peering_config.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ipv6_express_route_circuit_peering_config.py new file mode 100644 index 000000000000..0943c60e7f88 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ipv6_express_route_circuit_peering_config.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv6ExpressRouteCircuitPeeringConfig(Model): + """Contains IPv6 peering config. + + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2018_01_01.models.RouteFilter + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringState + """ + + _attribute_map = { + 'primary_peer_address_prefix': {'key': 'primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'secondaryPeerAddressPrefix', 'type': 'str'}, + 'microsoft_peering_config': {'key': 'microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'route_filter': {'key': 'routeFilter', 'type': 'RouteFilter'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) + self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) + self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) + self.route_filter = kwargs.get('route_filter', None) + self.state = kwargs.get('state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ipv6_express_route_circuit_peering_config_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ipv6_express_route_circuit_peering_config_py3.py new file mode 100644 index 000000000000..4269c6187225 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/ipv6_express_route_circuit_peering_config_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Ipv6ExpressRouteCircuitPeeringConfig(Model): + """Contains IPv6 peering config. + + :param primary_peer_address_prefix: The primary address prefix. + :type primary_peer_address_prefix: str + :param secondary_peer_address_prefix: The secondary address prefix. + :type secondary_peer_address_prefix: str + :param microsoft_peering_config: The Microsoft peering configuration. + :type microsoft_peering_config: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringConfig + :param route_filter: The reference of the RouteFilter resource. + :type route_filter: ~azure.mgmt.network.v2018_01_01.models.RouteFilter + :param state: The state of peering. Possible values are: 'Disabled' and + 'Enabled'. Possible values include: 'Disabled', 'Enabled' + :type state: str or + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringState + """ + + _attribute_map = { + 'primary_peer_address_prefix': {'key': 'primaryPeerAddressPrefix', 'type': 'str'}, + 'secondary_peer_address_prefix': {'key': 'secondaryPeerAddressPrefix', 'type': 'str'}, + 'microsoft_peering_config': {'key': 'microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, + 'route_filter': {'key': 'routeFilter', 'type': 'RouteFilter'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__(self, *, primary_peer_address_prefix: str=None, secondary_peer_address_prefix: str=None, microsoft_peering_config=None, route_filter=None, state=None, **kwargs) -> None: + super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) + self.primary_peer_address_prefix = primary_peer_address_prefix + self.secondary_peer_address_prefix = secondary_peer_address_prefix + self.microsoft_peering_config = microsoft_peering_config + self.route_filter = route_filter + self.state = state diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer.py new file mode 100644 index 000000000000..8b96572bd188 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LoadBalancer(Resource): + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The load balancer SKU. + :type sku: ~azure.mgmt.network.v2018_01_01.models.LoadBalancerSku + :param frontend_ip_configurations: Object representing the frontend IPs to + be used for the load balancer + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.FrontendIPConfiguration] + :param backend_address_pools: Collection of backend address pools used by + a load balancer + :type backend_address_pools: + list[~azure.mgmt.network.v2018_01_01.models.BackendAddressPool] + :param load_balancing_rules: Object collection representing the load + balancing rules Gets the provisioning + :type load_balancing_rules: + list[~azure.mgmt.network.v2018_01_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer + :type probes: list[~azure.mgmt.network.v2018_01_01.models.Probe] + :param inbound_nat_rules: Collection of inbound NAT Rules used by a load + balancer. Defining inbound NAT rules on your load balancer is mutually + exclusive with defining an inbound NAT pool. Inbound NAT pools are + referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an Inbound NAT pool. They + have to reference individual inbound NAT rules. + :type inbound_nat_rules: + list[~azure.mgmt.network.v2018_01_01.models.InboundNatRule] + :param inbound_nat_pools: Defines an external port range for inbound NAT + to a single backend port on NICs associated with a load balancer. Inbound + NAT rules are created automatically for each NIC associated with the Load + Balancer using an external port from this range. Defining an Inbound NAT + pool on your Load Balancer is mutually exclusive with defining inbound Nat + rules. Inbound NAT pools are referenced from virtual machine scale sets. + NICs that are associated with individual virtual machines cannot reference + an inbound NAT pool. They have to reference individual inbound NAT rules. + :type inbound_nat_pools: + list[~azure.mgmt.network.v2018_01_01.models.InboundNatPool] + :param outbound_nat_rules: The outbound NAT rules. + :type outbound_nat_rules: + list[~azure.mgmt.network.v2018_01_01.models.OutboundNatRule] + :param resource_guid: The resource GUID property of the load balancer + resource. + :type resource_guid: str + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'LoadBalancerSku'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, + 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[OutboundNatRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LoadBalancer, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.load_balancing_rules = kwargs.get('load_balancing_rules', None) + self.probes = kwargs.get('probes', None) + self.inbound_nat_rules = kwargs.get('inbound_nat_rules', None) + self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) + self.outbound_nat_rules = kwargs.get('outbound_nat_rules', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer_paged.py new file mode 100644 index 000000000000..c0a086214a7e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class LoadBalancerPaged(Paged): + """ + A paging container for iterating over a list of :class:`LoadBalancer ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LoadBalancer]'} + } + + def __init__(self, *args, **kwargs): + + super(LoadBalancerPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer_py3.py new file mode 100644 index 000000000000..87ed247d6937 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer_py3.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LoadBalancer(Resource): + """LoadBalancer resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The load balancer SKU. + :type sku: ~azure.mgmt.network.v2018_01_01.models.LoadBalancerSku + :param frontend_ip_configurations: Object representing the frontend IPs to + be used for the load balancer + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.FrontendIPConfiguration] + :param backend_address_pools: Collection of backend address pools used by + a load balancer + :type backend_address_pools: + list[~azure.mgmt.network.v2018_01_01.models.BackendAddressPool] + :param load_balancing_rules: Object collection representing the load + balancing rules Gets the provisioning + :type load_balancing_rules: + list[~azure.mgmt.network.v2018_01_01.models.LoadBalancingRule] + :param probes: Collection of probe objects used in the load balancer + :type probes: list[~azure.mgmt.network.v2018_01_01.models.Probe] + :param inbound_nat_rules: Collection of inbound NAT Rules used by a load + balancer. Defining inbound NAT rules on your load balancer is mutually + exclusive with defining an inbound NAT pool. Inbound NAT pools are + referenced from virtual machine scale sets. NICs that are associated with + individual virtual machines cannot reference an Inbound NAT pool. They + have to reference individual inbound NAT rules. + :type inbound_nat_rules: + list[~azure.mgmt.network.v2018_01_01.models.InboundNatRule] + :param inbound_nat_pools: Defines an external port range for inbound NAT + to a single backend port on NICs associated with a load balancer. Inbound + NAT rules are created automatically for each NIC associated with the Load + Balancer using an external port from this range. Defining an Inbound NAT + pool on your Load Balancer is mutually exclusive with defining inbound Nat + rules. Inbound NAT pools are referenced from virtual machine scale sets. + NICs that are associated with individual virtual machines cannot reference + an inbound NAT pool. They have to reference individual inbound NAT rules. + :type inbound_nat_pools: + list[~azure.mgmt.network.v2018_01_01.models.InboundNatPool] + :param outbound_nat_rules: The outbound NAT rules. + :type outbound_nat_rules: + list[~azure.mgmt.network.v2018_01_01.models.OutboundNatRule] + :param resource_guid: The resource GUID property of the load balancer + resource. + :type resource_guid: str + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'LoadBalancerSku'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, + 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, + 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, + 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, + 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, + 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[OutboundNatRule]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, frontend_ip_configurations=None, backend_address_pools=None, load_balancing_rules=None, probes=None, inbound_nat_rules=None, inbound_nat_pools=None, outbound_nat_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancer, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pools = backend_address_pools + self.load_balancing_rules = load_balancing_rules + self.probes = probes + self.inbound_nat_rules = inbound_nat_rules + self.inbound_nat_pools = inbound_nat_pools + self.outbound_nat_rules = outbound_nat_rules + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer_sku.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer_sku.py new file mode 100644 index 000000000000..208942981db2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer_sku.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LoadBalancerSku(Model): + """SKU of a load balancer. + + :param name: Name of a load balancer SKU. Possible values include: + 'Basic', 'Standard' + :type name: str or + ~azure.mgmt.network.v2018_01_01.models.LoadBalancerSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer_sku_py3.py new file mode 100644 index 000000000000..488d10148bde --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancer_sku_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LoadBalancerSku(Model): + """SKU of a load balancer. + + :param name: Name of a load balancer SKU. Possible values include: + 'Basic', 'Standard' + :type name: str or + ~azure.mgmt.network.v2018_01_01.models.LoadBalancerSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(LoadBalancerSku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancing_rule.py new file mode 100644 index 000000000000..de0277e5139b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancing_rule.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class LoadBalancingRule(SubResource): + """A load balancing rule for a load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param backend_address_pool: A reference to a pool of DIPs. Inbound + traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param probe: The reference of the load balancer probe used by the load + balancing rule. + :type probe: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.TransportProtocol + :param load_distribution: The load distribution policy for this rule. + Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + :type load_distribution: str or + ~azure.mgmt.network.v2018_01_01.models.LoadDistribution + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 0 and 65534. Note that value 0 enables "Any Port" + :type frontend_port: int + :param backend_port: The port used for internal connections on the + endpoint. Acceptable values are between 0 and 65535. Note that value 0 + enables "Any Port" + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param disable_outbound_snat: Configures SNAT for the VMs in the backend + pool to use the publicIP address specified in the frontend of the load + balancing rule. + :type disable_outbound_snat: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'disable_outbound_snat': {'key': 'properties.disableOutboundSnat', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LoadBalancingRule, self).__init__(**kwargs) + self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.probe = kwargs.get('probe', None) + self.protocol = kwargs.get('protocol', None) + self.load_distribution = kwargs.get('load_distribution', None) + self.frontend_port = kwargs.get('frontend_port', None) + self.backend_port = kwargs.get('backend_port', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.enable_floating_ip = kwargs.get('enable_floating_ip', None) + self.disable_outbound_snat = kwargs.get('disable_outbound_snat', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancing_rule_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancing_rule_paged.py new file mode 100644 index 000000000000..ea440d5b927d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancing_rule_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class LoadBalancingRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`LoadBalancingRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LoadBalancingRule]'} + } + + def __init__(self, *args, **kwargs): + + super(LoadBalancingRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancing_rule_py3.py new file mode 100644 index 000000000000..528f55651b15 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/load_balancing_rule_py3.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class LoadBalancingRule(SubResource): + """A load balancing rule for a load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param frontend_ip_configuration: A reference to frontend IP addresses. + :type frontend_ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param backend_address_pool: A reference to a pool of DIPs. Inbound + traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param probe: The reference of the load balancer probe used by the load + balancing rule. + :type probe: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param protocol: Required. Possible values include: 'Udp', 'Tcp', 'All' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.TransportProtocol + :param load_distribution: The load distribution policy for this rule. + Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. + Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' + :type load_distribution: str or + ~azure.mgmt.network.v2018_01_01.models.LoadDistribution + :param frontend_port: Required. The port for the external endpoint. Port + numbers for each rule must be unique within the Load Balancer. Acceptable + values are between 0 and 65534. Note that value 0 enables "Any Port" + :type frontend_port: int + :param backend_port: The port used for internal connections on the + endpoint. Acceptable values are between 0 and 65535. Note that value 0 + enables "Any Port" + :type backend_port: int + :param idle_timeout_in_minutes: The timeout for the TCP idle connection. + The value can be set between 4 and 30 minutes. The default value is 4 + minutes. This element is only used when the protocol is set to TCP. + :type idle_timeout_in_minutes: int + :param enable_floating_ip: Configures a virtual machine's endpoint for the + floating IP capability required to configure a SQL AlwaysOn Availability + Group. This setting is required when using the SQL AlwaysOn Availability + Groups in SQL server. This setting can't be changed after you create the + endpoint. + :type enable_floating_ip: bool + :param disable_outbound_snat: Configures SNAT for the VMs in the backend + pool to use the publicIP address specified in the frontend of the load + balancing rule. + :type disable_outbound_snat: bool + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'frontend_port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, + 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, + 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'disable_outbound_snat': {'key': 'properties.disableOutboundSnat', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, frontend_port: int, id: str=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, disable_outbound_snat: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(LoadBalancingRule, self).__init__(id=id, **kwargs) + self.frontend_ip_configuration = frontend_ip_configuration + self.backend_address_pool = backend_address_pool + self.probe = probe + self.protocol = protocol + self.load_distribution = load_distribution + self.frontend_port = frontend_port + self.backend_port = backend_port + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_floating_ip = enable_floating_ip + self.disable_outbound_snat = disable_outbound_snat + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/local_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/local_network_gateway.py new file mode 100644 index 000000000000..2f21c2e4828e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/local_network_gateway.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LocalNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param local_network_address_space: Local network site address space. + :type local_network_address_space: + ~azure.mgmt.network.v2018_01_01.models.AddressSpace + :param gateway_ip_address: IP address of local network gateway. + :type gateway_ip_address: str + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2018_01_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + LocalNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', + and 'Failed'. + :vartype provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, + 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LocalNetworkGateway, self).__init__(**kwargs) + self.local_network_address_space = kwargs.get('local_network_address_space', None) + self.gateway_ip_address = kwargs.get('gateway_ip_address', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = None + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/local_network_gateway_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/local_network_gateway_paged.py new file mode 100644 index 000000000000..a587818a80ca --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/local_network_gateway_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class LocalNetworkGatewayPaged(Paged): + """ + A paging container for iterating over a list of :class:`LocalNetworkGateway ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LocalNetworkGateway]'} + } + + def __init__(self, *args, **kwargs): + + super(LocalNetworkGatewayPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/local_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/local_network_gateway_py3.py new file mode 100644 index 000000000000..5ca47b12cb69 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/local_network_gateway_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class LocalNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param local_network_address_space: Local network site address space. + :type local_network_address_space: + ~azure.mgmt.network.v2018_01_01.models.AddressSpace + :param gateway_ip_address: IP address of local network gateway. + :type gateway_ip_address: str + :param bgp_settings: Local network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2018_01_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + LocalNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', + and 'Failed'. + :vartype provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, + 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, local_network_address_space=None, gateway_ip_address: str=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.local_network_address_space = local_network_address_space + self.gateway_ip_address = gateway_ip_address + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/log_specification.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/log_specification.py new file mode 100644 index 000000000000..ab592992d904 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/log_specification.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LogSpecification(Model): + """Description of logging specification. + + :param name: The name of the specification. + :type name: str + :param display_name: The display name of the specification. + :type display_name: str + :param blob_duration: Duration of the blob. + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/log_specification_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/log_specification_py3.py new file mode 100644 index 000000000000..6184811d393e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/log_specification_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LogSpecification(Model): + """Description of logging specification. + + :param name: The name of the specification. + :type name: str + :param display_name: The display name of the specification. + :type display_name: str + :param blob_duration: Duration of the blob. + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str=None, **kwargs) -> None: + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/metric_specification.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/metric_specification.py new file mode 100644 index 000000000000..1b5c65005e03 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/metric_specification.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricSpecification(Model): + """Description of metrics specification. + + :param name: The name of the metric. + :type name: str + :param display_name: The display name of the metric. + :type display_name: str + :param display_description: The description of the metric. + :type display_description: str + :param unit: Units the metric to be displayed in. + :type unit: str + :param aggregation_type: The aggregation type. + :type aggregation_type: str + :param availabilities: List of availability. + :type availabilities: + list[~azure.mgmt.network.v2018_01_01.models.Availability] + :param enable_regional_mdm_account: Whether regional MDM account enabled. + :type enable_regional_mdm_account: bool + :param fill_gap_with_zero: Whether gaps would be filled with zeros. + :type fill_gap_with_zero: bool + :param metric_filter_pattern: Pattern for the filter of the metric. + :type metric_filter_pattern: str + :param dimensions: List of dimensions. + :type dimensions: list[~azure.mgmt.network.v2018_01_01.models.Dimension] + :param is_internal: Whether the metric is internal. + :type is_internal: bool + :param source_mdm_account: The source MDM account. + :type source_mdm_account: str + :param source_mdm_namespace: The source MDM namespace. + :type source_mdm_namespace: str + :param resource_id_dimension_name_override: The resource Id dimension name + override. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[Availability]'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.availabilities = kwargs.get('availabilities', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.metric_filter_pattern = kwargs.get('metric_filter_pattern', None) + self.dimensions = kwargs.get('dimensions', None) + self.is_internal = kwargs.get('is_internal', None) + self.source_mdm_account = kwargs.get('source_mdm_account', None) + self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/metric_specification_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/metric_specification_py3.py new file mode 100644 index 000000000000..16c347f3635e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/metric_specification_py3.py @@ -0,0 +1,82 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MetricSpecification(Model): + """Description of metrics specification. + + :param name: The name of the metric. + :type name: str + :param display_name: The display name of the metric. + :type display_name: str + :param display_description: The description of the metric. + :type display_description: str + :param unit: Units the metric to be displayed in. + :type unit: str + :param aggregation_type: The aggregation type. + :type aggregation_type: str + :param availabilities: List of availability. + :type availabilities: + list[~azure.mgmt.network.v2018_01_01.models.Availability] + :param enable_regional_mdm_account: Whether regional MDM account enabled. + :type enable_regional_mdm_account: bool + :param fill_gap_with_zero: Whether gaps would be filled with zeros. + :type fill_gap_with_zero: bool + :param metric_filter_pattern: Pattern for the filter of the metric. + :type metric_filter_pattern: str + :param dimensions: List of dimensions. + :type dimensions: list[~azure.mgmt.network.v2018_01_01.models.Dimension] + :param is_internal: Whether the metric is internal. + :type is_internal: bool + :param source_mdm_account: The source MDM account. + :type source_mdm_account: str + :param source_mdm_namespace: The source MDM namespace. + :type source_mdm_namespace: str + :param resource_id_dimension_name_override: The resource Id dimension name + override. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[Availability]'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, availabilities=None, enable_regional_mdm_account: bool=None, fill_gap_with_zero: bool=None, metric_filter_pattern: str=None, dimensions=None, is_internal: bool=None, source_mdm_account: str=None, source_mdm_namespace: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.availabilities = availabilities + self.enable_regional_mdm_account = enable_regional_mdm_account + self.fill_gap_with_zero = fill_gap_with_zero + self.metric_filter_pattern = metric_filter_pattern + self.dimensions = dimensions + self.is_internal = is_internal + self.source_mdm_account = source_mdm_account + self.source_mdm_namespace = source_mdm_namespace + self.resource_id_dimension_name_override = resource_id_dimension_name_override diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface.py new file mode 100644 index 000000000000..67faaff15365 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkInterface(Resource): + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param virtual_machine: The reference of a virtual machine. + :type virtual_machine: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup + :param ip_configurations: A list of IPConfigurations of the network + interface. + :type ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceDnsSettings + :param mac_address: The MAC address of the network interface. + :type mac_address: str + :param primary: Gets whether this is a primary network interface on a + virtual machine. + :type primary: bool + :param enable_accelerated_networking: If the network interface is + accelerated networking enabled. + :type enable_accelerated_networking: bool + :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on + this network interface. + :type enable_ip_forwarding: bool + :param resource_guid: The resource GUID property of the network interface + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, + 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkInterface, self).__init__(**kwargs) + self.virtual_machine = kwargs.get('virtual_machine', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.dns_settings = kwargs.get('dns_settings', None) + self.mac_address = kwargs.get('mac_address', None) + self.primary = kwargs.get('primary', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_association.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_association.py new file mode 100644 index 000000000000..20f197794f56 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_association.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Network interface ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2018_01_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, **kwargs): + super(NetworkInterfaceAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_association_py3.py new file mode 100644 index 000000000000..1089bcf20191 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Network interface ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2018_01_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(NetworkInterfaceAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_dns_settings.py new file mode 100644 index 000000000000..b6ee0ff40d51 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_dns_settings.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceDnsSettings(Model): + """DNS settings of a network interface. + + :param dns_servers: List of DNS servers IP addresses. Use + 'AzureProvidedDNS' to switch to azure provided DNS resolution. + 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + only value in dnsServers collection. + :type dns_servers: list[str] + :param applied_dns_servers: If the VM that uses this NIC is part of an + Availability Set, then this list will have the union of all DNS servers + from all NICs that are part of the Availability Set. This property is what + is configured on each of those VMs. + :type applied_dns_servers: list[str] + :param internal_dns_name_label: Relative DNS name for this NIC used for + internal communications between VMs in the same virtual network. + :type internal_dns_name_label: str + :param internal_fqdn: Fully qualified DNS name supporting internal + communications between VMs in the same virtual network. + :type internal_fqdn: str + :param internal_domain_name_suffix: Even if internalDnsNameLabel is not + specified, a DNS entry is created for the primary NIC of the VM. This DNS + name can be constructed by concatenating the VM name with the value of + internalDomainNameSuffix. + :type internal_domain_name_suffix: str + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, + 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = kwargs.get('dns_servers', None) + self.applied_dns_servers = kwargs.get('applied_dns_servers', None) + self.internal_dns_name_label = kwargs.get('internal_dns_name_label', None) + self.internal_fqdn = kwargs.get('internal_fqdn', None) + self.internal_domain_name_suffix = kwargs.get('internal_domain_name_suffix', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_dns_settings_py3.py new file mode 100644 index 000000000000..ccdcc937def8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_dns_settings_py3.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkInterfaceDnsSettings(Model): + """DNS settings of a network interface. + + :param dns_servers: List of DNS servers IP addresses. Use + 'AzureProvidedDNS' to switch to azure provided DNS resolution. + 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the + only value in dnsServers collection. + :type dns_servers: list[str] + :param applied_dns_servers: If the VM that uses this NIC is part of an + Availability Set, then this list will have the union of all DNS servers + from all NICs that are part of the Availability Set. This property is what + is configured on each of those VMs. + :type applied_dns_servers: list[str] + :param internal_dns_name_label: Relative DNS name for this NIC used for + internal communications between VMs in the same virtual network. + :type internal_dns_name_label: str + :param internal_fqdn: Fully qualified DNS name supporting internal + communications between VMs in the same virtual network. + :type internal_fqdn: str + :param internal_domain_name_suffix: Even if internalDnsNameLabel is not + specified, a DNS entry is created for the primary NIC of the VM. This DNS + name can be constructed by concatenating the VM name with the value of + internalDomainNameSuffix. + :type internal_domain_name_suffix: str + """ + + _attribute_map = { + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, + 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, + 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, + 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, + } + + def __init__(self, *, dns_servers=None, applied_dns_servers=None, internal_dns_name_label: str=None, internal_fqdn: str=None, internal_domain_name_suffix: str=None, **kwargs) -> None: + super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) + self.dns_servers = dns_servers + self.applied_dns_servers = applied_dns_servers + self.internal_dns_name_label = internal_dns_name_label + self.internal_fqdn = internal_fqdn + self.internal_domain_name_suffix = internal_domain_name_suffix diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_ip_configuration.py new file mode 100644 index 000000000000..1ae93ac01bda --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_ip_configuration.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class NetworkInterfaceIPConfiguration(SubResource): + """IPConfiguration in a network interface. + + :param id: Resource ID. + :type id: str + :param application_gateway_backend_address_pools: The reference of + ApplicationGatewayBackendAddressPool resource. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendAddressPool] + :param load_balancer_backend_address_pools: The reference of + LoadBalancerBackendAddressPool resource. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2018_01_01.models.BackendAddressPool] + :param load_balancer_inbound_nat_rules: A list of references of + LoadBalancerInboundNatRules. + :type load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2018_01_01.models.InboundNatRule] + :param private_ip_address: Private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: Defines how a private IP address is + assigned. Possible values are: 'Static' and 'Dynamic'. Possible values + include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2018_01_01.models.IPAllocationMethod + :param private_ip_address_version: Available from Api-Version 2016-03-30 + onwards, it represents whether the specific ipconfiguration is IPv4 or + IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.network.v2018_01_01.models.IPVersion + :param subnet: Subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.Subnet + :param primary: Gets whether this is a primary customer address on the + network interface. + :type primary: bool + :param public_ip_address: Public IP address bound to the IP configuration. + :type public_ip_address: + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress + :param application_security_groups: Application security groups in which + the IP configuration is included. + :type application_security_groups: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup] + :param provisioning_state: The provisioning state of the network interface + IP configuration. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'application_security_groups': {'key': 'properties.applicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkInterfaceIPConfiguration, self).__init__(**kwargs) + self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_inbound_nat_rules = kwargs.get('load_balancer_inbound_nat_rules', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.private_ip_address_version = kwargs.get('private_ip_address_version', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.application_security_groups = kwargs.get('application_security_groups', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_ip_configuration_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_ip_configuration_paged.py new file mode 100644 index 000000000000..689a5b8cb597 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_ip_configuration_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class NetworkInterfaceIPConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`NetworkInterfaceIPConfiguration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[NetworkInterfaceIPConfiguration]'} + } + + def __init__(self, *args, **kwargs): + + super(NetworkInterfaceIPConfigurationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_ip_configuration_py3.py new file mode 100644 index 000000000000..62620a633aca --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_ip_configuration_py3.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class NetworkInterfaceIPConfiguration(SubResource): + """IPConfiguration in a network interface. + + :param id: Resource ID. + :type id: str + :param application_gateway_backend_address_pools: The reference of + ApplicationGatewayBackendAddressPool resource. + :type application_gateway_backend_address_pools: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendAddressPool] + :param load_balancer_backend_address_pools: The reference of + LoadBalancerBackendAddressPool resource. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.network.v2018_01_01.models.BackendAddressPool] + :param load_balancer_inbound_nat_rules: A list of references of + LoadBalancerInboundNatRules. + :type load_balancer_inbound_nat_rules: + list[~azure.mgmt.network.v2018_01_01.models.InboundNatRule] + :param private_ip_address: Private IP address of the IP configuration. + :type private_ip_address: str + :param private_ip_allocation_method: Defines how a private IP address is + assigned. Possible values are: 'Static' and 'Dynamic'. Possible values + include: 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2018_01_01.models.IPAllocationMethod + :param private_ip_address_version: Available from Api-Version 2016-03-30 + onwards, it represents whether the specific ipconfiguration is IPv4 or + IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. + Possible values include: 'IPv4', 'IPv6' + :type private_ip_address_version: str or + ~azure.mgmt.network.v2018_01_01.models.IPVersion + :param subnet: Subnet bound to the IP configuration. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.Subnet + :param primary: Gets whether this is a primary customer address on the + network interface. + :type primary: bool + :param public_ip_address: Public IP address bound to the IP configuration. + :type public_ip_address: + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress + :param application_security_groups: Application security groups in which + the IP configuration is included. + :type application_security_groups: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup] + :param provisioning_state: The provisioning state of the network interface + IP configuration. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, + 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, + 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, + 'application_security_groups': {'key': 'properties.applicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, application_gateway_backend_address_pools=None, load_balancer_backend_address_pools=None, load_balancer_inbound_nat_rules=None, private_ip_address: str=None, private_ip_allocation_method=None, private_ip_address_version=None, subnet=None, primary: bool=None, public_ip_address=None, application_security_groups=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterfaceIPConfiguration, self).__init__(id=id, **kwargs) + self.application_gateway_backend_address_pools = application_gateway_backend_address_pools + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.private_ip_address_version = private_ip_address_version + self.subnet = subnet + self.primary = primary + self.public_ip_address = public_ip_address + self.application_security_groups = application_security_groups + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_paged.py new file mode 100644 index 000000000000..95ae864e2c84 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class NetworkInterfacePaged(Paged): + """ + A paging container for iterating over a list of :class:`NetworkInterface ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[NetworkInterface]'} + } + + def __init__(self, *args, **kwargs): + + super(NetworkInterfacePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_py3.py new file mode 100644 index 000000000000..190450071f7d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_interface_py3.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkInterface(Resource): + """A network interface in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param virtual_machine: The reference of a virtual machine. + :type virtual_machine: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup + :param ip_configurations: A list of IPConfigurations of the network + interface. + :type ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration] + :param dns_settings: The DNS settings in network interface. + :type dns_settings: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceDnsSettings + :param mac_address: The MAC address of the network interface. + :type mac_address: str + :param primary: Gets whether this is a primary network interface on a + virtual machine. + :type primary: bool + :param enable_accelerated_networking: If the network interface is + accelerated networking enabled. + :type enable_accelerated_networking: bool + :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on + this network interface. + :type enable_ip_forwarding: bool + :param resource_guid: The resource GUID property of the network interface + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, + 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, + 'primary': {'key': 'properties.primary', 'type': 'bool'}, + 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, virtual_machine=None, network_security_group=None, ip_configurations=None, dns_settings=None, mac_address: str=None, primary: bool=None, enable_accelerated_networking: bool=None, enable_ip_forwarding: bool=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkInterface, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.virtual_machine = virtual_machine + self.network_security_group = network_security_group + self.ip_configurations = ip_configurations + self.dns_settings = dns_settings + self.mac_address = mac_address + self.primary = primary + self.enable_accelerated_networking = enable_accelerated_networking + self.enable_ip_forwarding = enable_ip_forwarding + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_management_client_enums.py new file mode 100644 index 000000000000..80779ff26b9f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_management_client_enums.py @@ -0,0 +1,534 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class TransportProtocol(str, Enum): + + udp = "Udp" + tcp = "Tcp" + all = "All" + + +class IPAllocationMethod(str, Enum): + + static = "Static" + dynamic = "Dynamic" + + +class IPVersion(str, Enum): + + ipv4 = "IPv4" + ipv6 = "IPv6" + + +class SecurityRuleProtocol(str, Enum): + + tcp = "Tcp" + udp = "Udp" + asterisk = "*" + + +class SecurityRuleAccess(str, Enum): + + allow = "Allow" + deny = "Deny" + + +class SecurityRuleDirection(str, Enum): + + inbound = "Inbound" + outbound = "Outbound" + + +class RouteNextHopType(str, Enum): + + virtual_network_gateway = "VirtualNetworkGateway" + vnet_local = "VnetLocal" + internet = "Internet" + virtual_appliance = "VirtualAppliance" + none = "None" + + +class PublicIPAddressSkuName(str, Enum): + + basic = "Basic" + standard = "Standard" + + +class ApplicationGatewayProtocol(str, Enum): + + http = "Http" + https = "Https" + + +class ApplicationGatewayCookieBasedAffinity(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class ApplicationGatewayBackendHealthServerHealth(str, Enum): + + unknown = "Unknown" + up = "Up" + down = "Down" + partial = "Partial" + draining = "Draining" + + +class ApplicationGatewaySkuName(str, Enum): + + standard_small = "Standard_Small" + standard_medium = "Standard_Medium" + standard_large = "Standard_Large" + waf_medium = "WAF_Medium" + waf_large = "WAF_Large" + + +class ApplicationGatewayTier(str, Enum): + + standard = "Standard" + waf = "WAF" + + +class ApplicationGatewaySslProtocol(str, Enum): + + tl_sv1_0 = "TLSv1_0" + tl_sv1_1 = "TLSv1_1" + tl_sv1_2 = "TLSv1_2" + + +class ApplicationGatewaySslPolicyType(str, Enum): + + predefined = "Predefined" + custom = "Custom" + + +class ApplicationGatewaySslPolicyName(str, Enum): + + app_gw_ssl_policy20150501 = "AppGwSslPolicy20150501" + app_gw_ssl_policy20170401 = "AppGwSslPolicy20170401" + app_gw_ssl_policy20170401_s = "AppGwSslPolicy20170401S" + + +class ApplicationGatewaySslCipherSuite(str, Enum): + + tls_ecdhe_rsa_with_aes_256_cbc_sha384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" + tls_ecdhe_rsa_with_aes_128_cbc_sha256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + tls_ecdhe_rsa_with_aes_256_cbc_sha = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" + tls_ecdhe_rsa_with_aes_128_cbc_sha = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" + tls_dhe_rsa_with_aes_256_gcm_sha384 = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" + tls_dhe_rsa_with_aes_128_gcm_sha256 = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" + tls_dhe_rsa_with_aes_256_cbc_sha = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" + tls_dhe_rsa_with_aes_128_cbc_sha = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" + tls_rsa_with_aes_256_gcm_sha384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" + tls_rsa_with_aes_128_gcm_sha256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" + tls_rsa_with_aes_256_cbc_sha256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" + tls_rsa_with_aes_128_cbc_sha256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" + tls_rsa_with_aes_256_cbc_sha = "TLS_RSA_WITH_AES_256_CBC_SHA" + tls_rsa_with_aes_128_cbc_sha = "TLS_RSA_WITH_AES_128_CBC_SHA" + tls_ecdhe_ecdsa_with_aes_256_gcm_sha384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" + tls_ecdhe_ecdsa_with_aes_128_gcm_sha256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" + tls_ecdhe_ecdsa_with_aes_256_cbc_sha384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" + tls_ecdhe_ecdsa_with_aes_128_cbc_sha256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" + tls_ecdhe_ecdsa_with_aes_256_cbc_sha = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" + tls_ecdhe_ecdsa_with_aes_128_cbc_sha = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" + tls_dhe_dss_with_aes_256_cbc_sha256 = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" + tls_dhe_dss_with_aes_128_cbc_sha256 = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" + tls_dhe_dss_with_aes_256_cbc_sha = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" + tls_dhe_dss_with_aes_128_cbc_sha = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" + tls_rsa_with_3_des_ede_cbc_sha = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" + + +class ApplicationGatewayRequestRoutingRuleType(str, Enum): + + basic = "Basic" + path_based_routing = "PathBasedRouting" + + +class ApplicationGatewayRedirectType(str, Enum): + + permanent = "Permanent" + found = "Found" + see_other = "SeeOther" + temporary = "Temporary" + + +class ApplicationGatewayOperationalState(str, Enum): + + stopped = "Stopped" + starting = "Starting" + running = "Running" + stopping = "Stopping" + + +class ApplicationGatewayFirewallMode(str, Enum): + + detection = "Detection" + prevention = "Prevention" + + +class AuthorizationUseStatus(str, Enum): + + available = "Available" + in_use = "InUse" + + +class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(str, Enum): + + not_configured = "NotConfigured" + configuring = "Configuring" + configured = "Configured" + validation_needed = "ValidationNeeded" + + +class Access(str, Enum): + + allow = "Allow" + deny = "Deny" + + +class ExpressRouteCircuitPeeringType(str, Enum): + + azure_public_peering = "AzurePublicPeering" + azure_private_peering = "AzurePrivatePeering" + microsoft_peering = "MicrosoftPeering" + + +class ExpressRouteCircuitPeeringState(str, Enum): + + disabled = "Disabled" + enabled = "Enabled" + + +class ExpressRouteCircuitSkuTier(str, Enum): + + standard = "Standard" + premium = "Premium" + + +class ExpressRouteCircuitSkuFamily(str, Enum): + + unlimited_data = "UnlimitedData" + metered_data = "MeteredData" + + +class ServiceProviderProvisioningState(str, Enum): + + not_provisioned = "NotProvisioned" + provisioning = "Provisioning" + provisioned = "Provisioned" + deprovisioning = "Deprovisioning" + + +class LoadBalancerSkuName(str, Enum): + + basic = "Basic" + standard = "Standard" + + +class LoadDistribution(str, Enum): + + default = "Default" + source_ip = "SourceIP" + source_ip_protocol = "SourceIPProtocol" + + +class ProbeProtocol(str, Enum): + + http = "Http" + tcp = "Tcp" + + +class NetworkOperationStatus(str, Enum): + + in_progress = "InProgress" + succeeded = "Succeeded" + failed = "Failed" + + +class EffectiveSecurityRuleProtocol(str, Enum): + + tcp = "Tcp" + udp = "Udp" + all = "All" + + +class EffectiveRouteSource(str, Enum): + + unknown = "Unknown" + user = "User" + virtual_network_gateway = "VirtualNetworkGateway" + default = "Default" + + +class EffectiveRouteState(str, Enum): + + active = "Active" + invalid = "Invalid" + + +class ProvisioningState(str, Enum): + + succeeded = "Succeeded" + updating = "Updating" + deleting = "Deleting" + failed = "Failed" + + +class AssociationType(str, Enum): + + associated = "Associated" + contains = "Contains" + + +class Direction(str, Enum): + + inbound = "Inbound" + outbound = "Outbound" + + +class Protocol(str, Enum): + + tcp = "TCP" + udp = "UDP" + + +class NextHopType(str, Enum): + + internet = "Internet" + virtual_appliance = "VirtualAppliance" + virtual_network_gateway = "VirtualNetworkGateway" + vnet_local = "VnetLocal" + hyper_net_gateway = "HyperNetGateway" + none = "None" + + +class PcProtocol(str, Enum): + + tcp = "TCP" + udp = "UDP" + any = "Any" + + +class PcStatus(str, Enum): + + not_started = "NotStarted" + running = "Running" + stopped = "Stopped" + error = "Error" + unknown = "Unknown" + + +class PcError(str, Enum): + + internal_error = "InternalError" + agent_stopped = "AgentStopped" + capture_failed = "CaptureFailed" + local_file_failed = "LocalFileFailed" + storage_failed = "StorageFailed" + + +class Origin(str, Enum): + + local = "Local" + inbound = "Inbound" + outbound = "Outbound" + + +class Severity(str, Enum): + + error = "Error" + warning = "Warning" + + +class IssueType(str, Enum): + + unknown = "Unknown" + agent_stopped = "AgentStopped" + guest_firewall = "GuestFirewall" + dns_resolution = "DnsResolution" + socket_bind = "SocketBind" + network_security_rule = "NetworkSecurityRule" + user_defined_route = "UserDefinedRoute" + port_throttled = "PortThrottled" + platform = "Platform" + + +class ConnectionStatus(str, Enum): + + unknown = "Unknown" + connected = "Connected" + disconnected = "Disconnected" + degraded = "Degraded" + + +class ConnectionState(str, Enum): + + reachable = "Reachable" + unreachable = "Unreachable" + unknown = "Unknown" + + +class EvaluationState(str, Enum): + + not_started = "NotStarted" + in_progress = "InProgress" + completed = "Completed" + + +class VirtualNetworkPeeringState(str, Enum): + + initiated = "Initiated" + connected = "Connected" + disconnected = "Disconnected" + + +class VirtualNetworkGatewayType(str, Enum): + + vpn = "Vpn" + express_route = "ExpressRoute" + + +class VpnType(str, Enum): + + policy_based = "PolicyBased" + route_based = "RouteBased" + + +class VirtualNetworkGatewaySkuName(str, Enum): + + basic = "Basic" + high_performance = "HighPerformance" + standard = "Standard" + ultra_performance = "UltraPerformance" + vpn_gw1 = "VpnGw1" + vpn_gw2 = "VpnGw2" + vpn_gw3 = "VpnGw3" + + +class VirtualNetworkGatewaySkuTier(str, Enum): + + basic = "Basic" + high_performance = "HighPerformance" + standard = "Standard" + ultra_performance = "UltraPerformance" + vpn_gw1 = "VpnGw1" + vpn_gw2 = "VpnGw2" + vpn_gw3 = "VpnGw3" + + +class VpnClientProtocol(str, Enum): + + ike_v2 = "IkeV2" + sstp = "SSTP" + + +class BgpPeerState(str, Enum): + + unknown = "Unknown" + stopped = "Stopped" + idle = "Idle" + connecting = "Connecting" + connected = "Connected" + + +class ProcessorArchitecture(str, Enum): + + amd64 = "Amd64" + x86 = "X86" + + +class AuthenticationMethod(str, Enum): + + eaptls = "EAPTLS" + eapmscha_pv2 = "EAPMSCHAPv2" + + +class VirtualNetworkGatewayConnectionStatus(str, Enum): + + unknown = "Unknown" + connecting = "Connecting" + connected = "Connected" + not_connected = "NotConnected" + + +class VirtualNetworkGatewayConnectionType(str, Enum): + + ipsec = "IPsec" + vnet2_vnet = "Vnet2Vnet" + express_route = "ExpressRoute" + vpn_client = "VPNClient" + + +class IpsecEncryption(str, Enum): + + none = "None" + des = "DES" + des3 = "DES3" + aes128 = "AES128" + aes192 = "AES192" + aes256 = "AES256" + gcmaes128 = "GCMAES128" + gcmaes192 = "GCMAES192" + gcmaes256 = "GCMAES256" + + +class IpsecIntegrity(str, Enum): + + md5 = "MD5" + sha1 = "SHA1" + sha256 = "SHA256" + gcmaes128 = "GCMAES128" + gcmaes192 = "GCMAES192" + gcmaes256 = "GCMAES256" + + +class IkeEncryption(str, Enum): + + des = "DES" + des3 = "DES3" + aes128 = "AES128" + aes192 = "AES192" + aes256 = "AES256" + + +class IkeIntegrity(str, Enum): + + md5 = "MD5" + sha1 = "SHA1" + sha256 = "SHA256" + sha384 = "SHA384" + + +class DhGroup(str, Enum): + + none = "None" + dh_group1 = "DHGroup1" + dh_group2 = "DHGroup2" + dh_group14 = "DHGroup14" + dh_group2048 = "DHGroup2048" + ecp256 = "ECP256" + ecp384 = "ECP384" + dh_group24 = "DHGroup24" + + +class PfsGroup(str, Enum): + + none = "None" + pfs1 = "PFS1" + pfs2 = "PFS2" + pfs2048 = "PFS2048" + ecp256 = "ECP256" + ecp384 = "ECP384" + pfs24 = "PFS24" diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_security_group.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_security_group.py new file mode 100644 index 000000000000..19c751ee6c17 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_security_group.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkSecurityGroup(Resource): + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param security_rules: A collection of security rules of the network + security group. + :type security_rules: + list[~azure.mgmt.network.v2018_01_01.models.SecurityRule] + :param default_security_rules: The default security rules of network + security group. + :type default_security_rules: + list[~azure.mgmt.network.v2018_01_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network + interfaces. + :vartype network_interfaces: + list[~azure.mgmt.network.v2018_01_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2018_01_01.models.Subnet] + :param resource_guid: The resource GUID property of the network security + group resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, + 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkSecurityGroup, self).__init__(**kwargs) + self.security_rules = kwargs.get('security_rules', None) + self.default_security_rules = kwargs.get('default_security_rules', None) + self.network_interfaces = None + self.subnets = None + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_security_group_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_security_group_paged.py new file mode 100644 index 000000000000..82624348054d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_security_group_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class NetworkSecurityGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`NetworkSecurityGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[NetworkSecurityGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(NetworkSecurityGroupPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_security_group_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_security_group_py3.py new file mode 100644 index 000000000000..f74cb738076e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_security_group_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkSecurityGroup(Resource): + """NetworkSecurityGroup resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param security_rules: A collection of security rules of the network + security group. + :type security_rules: + list[~azure.mgmt.network.v2018_01_01.models.SecurityRule] + :param default_security_rules: The default security rules of network + security group. + :type default_security_rules: + list[~azure.mgmt.network.v2018_01_01.models.SecurityRule] + :ivar network_interfaces: A collection of references to network + interfaces. + :vartype network_interfaces: + list[~azure.mgmt.network.v2018_01_01.models.NetworkInterface] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2018_01_01.models.Subnet] + :param resource_guid: The resource GUID property of the network security + group resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'network_interfaces': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, + 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, + 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, security_rules=None, default_security_rules=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.security_rules = security_rules + self.default_security_rules = default_security_rules + self.network_interfaces = None + self.subnets = None + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_watcher.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_watcher.py new file mode 100644 index 000000000000..9b99b5be2a9a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_watcher.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkWatcher(Resource): + """Network watcher in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.network.v2018_01_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkWatcher, self).__init__(**kwargs) + self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") + self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_watcher_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_watcher_paged.py new file mode 100644 index 000000000000..183a90030f05 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_watcher_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class NetworkWatcherPaged(Paged): + """ + A paging container for iterating over a list of :class:`NetworkWatcher ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[NetworkWatcher]'} + } + + def __init__(self, *args, **kwargs): + + super(NetworkWatcherPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_watcher_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_watcher_py3.py new file mode 100644 index 000000000000..440bd0d07b48 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/network_watcher_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class NetworkWatcher(Resource): + """Network watcher in a resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.network.v2018_01_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, etag: str="A unique read-only string that changes whenever the resource is updated.", **kwargs) -> None: + super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.etag = etag + self.provisioning_state = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/next_hop_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/next_hop_parameters.py new file mode 100644 index 000000000000..54d8674c8884 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/next_hop_parameters.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopParameters(Model): + """Parameters that define the source and destination endpoint. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. + :type target_resource_id: str + :param source_ip_address: Required. The source IP address. + :type source_ip_address: str + :param destination_ip_address: Required. The destination IP address. + :type destination_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of the nics, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'source_ip_address': {'required': True}, + 'destination_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, + 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.source_ip_address = kwargs.get('source_ip_address', None) + self.destination_ip_address = kwargs.get('destination_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/next_hop_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/next_hop_parameters_py3.py new file mode 100644 index 000000000000..50ee3d334e91 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/next_hop_parameters_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopParameters(Model): + """Parameters that define the source and destination endpoint. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The resource identifier of the target + resource against which the action is to be performed. + :type target_resource_id: str + :param source_ip_address: Required. The source IP address. + :type source_ip_address: str + :param destination_ip_address: Required. The destination IP address. + :type destination_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of the nics, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'source_ip_address': {'required': True}, + 'destination_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, + 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, source_ip_address: str, destination_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(NextHopParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.source_ip_address = source_ip_address + self.destination_ip_address = destination_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/next_hop_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/next_hop_result.py new file mode 100644 index 000000000000..3bc0a1836fbd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/next_hop_result.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopResult(Model): + """The information about next hop from the specified VM. + + :param next_hop_type: Next hop type. Possible values include: 'Internet', + 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', + 'HyperNetGateway', 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2018_01_01.models.NextHopType + :param next_hop_ip_address: Next hop IP Address + :type next_hop_ip_address: str + :param route_table_id: The resource identifier for the route table + associated with the route being returned. If the route being returned does + not correspond to any user created routes then this field will be the + string 'System Route'. + :type route_table_id: str + """ + + _attribute_map = { + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.route_table_id = kwargs.get('route_table_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/next_hop_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/next_hop_result_py3.py new file mode 100644 index 000000000000..30bbf7b310ce --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/next_hop_result_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NextHopResult(Model): + """The information about next hop from the specified VM. + + :param next_hop_type: Next hop type. Possible values include: 'Internet', + 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', + 'HyperNetGateway', 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2018_01_01.models.NextHopType + :param next_hop_ip_address: Next hop IP Address + :type next_hop_ip_address: str + :param route_table_id: The resource identifier for the route table + associated with the route being returned. If the route being returned does + not correspond to any user created routes then this field will be the + string 'System Route'. + :type route_table_id: str + """ + + _attribute_map = { + 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, + 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type=None, next_hop_ip_address: str=None, route_table_id: str=None, **kwargs) -> None: + super(NextHopResult, self).__init__(**kwargs) + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.route_table_id = route_table_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation.py new file mode 100644 index 000000000000..aa834fe10c3e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Network REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.network.v2018_01_01.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param service_specification: Specification of the service. + :type service_specification: + ~azure.mgmt.network.v2018_01_01.models.OperationPropertiesFormatServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationPropertiesFormatServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_display.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_display.py new file mode 100644 index 000000000000..6e37c2433f56 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_display.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Network. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of the operation: get, read, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_display_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_display_py3.py new file mode 100644 index 000000000000..c0508a41bd48 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Network. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of the operation: get, read, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_paged.py new file mode 100644 index 000000000000..2382b4aa69e1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_properties_format_service_specification.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_properties_format_service_specification.py new file mode 100644 index 000000000000..ca51f2cc8990 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_properties_format_service_specification.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationPropertiesFormatServiceSpecification(Model): + """Specification of the service. + + :param metric_specifications: Operation service specification. + :type metric_specifications: + list[~azure.mgmt.network.v2018_01_01.models.MetricSpecification] + :param log_specifications: Operation log specification. + :type log_specifications: + list[~azure.mgmt.network.v2018_01_01.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__(self, **kwargs): + super(OperationPropertiesFormatServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + self.log_specifications = kwargs.get('log_specifications', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_properties_format_service_specification_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_properties_format_service_specification_py3.py new file mode 100644 index 000000000000..aa8bf97f4564 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_properties_format_service_specification_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationPropertiesFormatServiceSpecification(Model): + """Specification of the service. + + :param metric_specifications: Operation service specification. + :type metric_specifications: + list[~azure.mgmt.network.v2018_01_01.models.MetricSpecification] + :param log_specifications: Operation log specification. + :type log_specifications: + list[~azure.mgmt.network.v2018_01_01.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, log_specifications=None, **kwargs) -> None: + super(OperationPropertiesFormatServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + self.log_specifications = log_specifications diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_py3.py new file mode 100644 index 000000000000..a7c212d3a949 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/operation_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Network REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.network.v2018_01_01.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param service_specification: Specification of the service. + :type service_specification: + ~azure.mgmt.network.v2018_01_01.models.OperationPropertiesFormatServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationPropertiesFormatServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/outbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/outbound_nat_rule.py new file mode 100644 index 000000000000..da40d5f42769 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/outbound_nat_rule.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class OutboundNatRule(SubResource): + """Outbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param allocated_outbound_ports: The number of outbound ports to be used + for NAT. + :type allocated_outbound_ports: int + :param frontend_ip_configurations: The Frontend IP addresses of the load + balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_address_pool': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OutboundNatRule, self).__init__(**kwargs) + self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pool = kwargs.get('backend_address_pool', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/outbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/outbound_nat_rule_py3.py new file mode 100644 index 000000000000..64768a735bc2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/outbound_nat_rule_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class OutboundNatRule(SubResource): + """Outbound NAT pool of the load balancer. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param allocated_outbound_ports: The number of outbound ports to be used + for NAT. + :type allocated_outbound_ports: int + :param frontend_ip_configurations: The Frontend IP addresses of the load + balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param backend_address_pool: Required. A reference to a pool of DIPs. + Outbound traffic is randomly load balanced across IPs in the backend IPs. + :type backend_address_pool: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param provisioning_state: Gets the provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'backend_address_pool': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, + 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, + 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, backend_address_pool, id: str=None, allocated_outbound_ports: int=None, frontend_ip_configurations=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(OutboundNatRule, self).__init__(id=id, **kwargs) + self.allocated_outbound_ports = allocated_outbound_ports + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pool = backend_address_pool + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture.py new file mode 100644 index 000000000000..d42b41a53f22 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCapture(Model): + """Parameters that define the create packet capture operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the packet capture. + :vartype name: str + :ivar id: ID of the packet capture. + :vartype id: str + :ivar type: Packet capture type. + :vartype type: str + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2018_01_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2018_01_01.models.PacketCaptureFilter] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, **kwargs): + super(PacketCapture, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_filter.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_filter.py new file mode 100644 index 000000000000..9b2d0a94e0fe --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_filter.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureFilter(Model): + """Filter that is applied to packet capture request. Multiple filters can be + applied. + + :param protocol: Protocol to be filtered on. Possible values include: + 'TCP', 'UDP', 'Any'. Default value: "Any" . + :type protocol: str or ~azure.mgmt.network.v2018_01_01.models.PcProtocol + :param local_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type local_ip_address: str + :param remote_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type remote_ip_address: str + :param local_port: Local port to be filtered on. Notation: "80" for single + port entry."80-85" for range. "80;443;" for multiple entries. Multiple + ranges not currently supported. Mixing ranges with multiple entries not + currently supported. Default = null. + :type local_port: str + :param remote_port: Remote port to be filtered on. Notation: "80" for + single port entry."80-85" for range. "80;443;" for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple + entries not currently supported. Default = null. + :type remote_port: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = kwargs.get('protocol', "Any") + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_filter_py3.py new file mode 100644 index 000000000000..9caad2128201 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_filter_py3.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureFilter(Model): + """Filter that is applied to packet capture request. Multiple filters can be + applied. + + :param protocol: Protocol to be filtered on. Possible values include: + 'TCP', 'UDP', 'Any'. Default value: "Any" . + :type protocol: str or ~azure.mgmt.network.v2018_01_01.models.PcProtocol + :param local_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type local_ip_address: str + :param remote_ip_address: Local IP Address to be filtered on. Notation: + "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. + "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently + supported. Mixing ranges with multiple entries not currently supported. + Default = null. + :type remote_ip_address: str + :param local_port: Local port to be filtered on. Notation: "80" for single + port entry."80-85" for range. "80;443;" for multiple entries. Multiple + ranges not currently supported. Mixing ranges with multiple entries not + currently supported. Default = null. + :type local_port: str + :param remote_port: Remote port to be filtered on. Notation: "80" for + single port entry."80-85" for range. "80;443;" for multiple entries. + Multiple ranges not currently supported. Mixing ranges with multiple + entries not currently supported. Default = null. + :type remote_port: str + """ + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + } + + def __init__(self, *, protocol="Any", local_ip_address: str=None, remote_ip_address: str=None, local_port: str=None, remote_port: str=None, **kwargs) -> None: + super(PacketCaptureFilter, self).__init__(**kwargs) + self.protocol = protocol + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.local_port = local_port + self.remote_port = remote_port diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_parameters.py new file mode 100644 index 000000000000..d28180e27afb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_parameters.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureParameters(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2018_01_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2018_01_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, **kwargs): + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_parameters_py3.py new file mode 100644 index 000000000000..336eefb82965 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_parameters_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureParameters(Model): + """Parameters that define the create packet capture operation. + + All required parameters must be populated in order to send to Azure. + + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2018_01_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2018_01_01.models.PacketCaptureFilter] + """ + + _validation = { + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'target': {'key': 'target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCaptureParameters, self).__init__(**kwargs) + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_py3.py new file mode 100644 index 000000000000..2b7b92dfcdb9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCapture(Model): + """Parameters that define the create packet capture operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the packet capture. + :vartype name: str + :ivar id: ID of the packet capture. + :vartype id: str + :ivar type: Packet capture type. + :vartype type: str + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2018_01_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2018_01_01.models.PacketCaptureFilter] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + } + + def __init__(self, *, target: str, storage_location, bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, **kwargs) -> None: + super(PacketCapture, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_query_status_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_query_status_result.py new file mode 100644 index 000000000000..9a1e340119aa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_query_status_result.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureQueryStatusResult(Model): + """Status of packet capture session. + + :param name: The name of the packet capture resource. + :type name: str + :param id: The ID of the packet capture resource. + :type id: str + :param capture_start_time: The start time of the packet capture session. + :type capture_start_time: datetime + :param packet_capture_status: The status of the packet capture session. + Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', + 'Unknown' + :type packet_capture_status: str or + ~azure.mgmt.network.v2018_01_01.models.PcStatus + :param stop_reason: The reason the current packet capture session was + stopped. + :type stop_reason: str + :param packet_capture_error: List of errors of packet capture session. + :type packet_capture_error: list[str or + ~azure.mgmt.network.v2018_01_01.models.PcError] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, + 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, + 'stop_reason': {'key': 'stopReason', 'type': 'str'}, + 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.capture_start_time = kwargs.get('capture_start_time', None) + self.packet_capture_status = kwargs.get('packet_capture_status', None) + self.stop_reason = kwargs.get('stop_reason', None) + self.packet_capture_error = kwargs.get('packet_capture_error', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_query_status_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_query_status_result_py3.py new file mode 100644 index 000000000000..b0d28e3c5f17 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_query_status_result_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureQueryStatusResult(Model): + """Status of packet capture session. + + :param name: The name of the packet capture resource. + :type name: str + :param id: The ID of the packet capture resource. + :type id: str + :param capture_start_time: The start time of the packet capture session. + :type capture_start_time: datetime + :param packet_capture_status: The status of the packet capture session. + Possible values include: 'NotStarted', 'Running', 'Stopped', 'Error', + 'Unknown' + :type packet_capture_status: str or + ~azure.mgmt.network.v2018_01_01.models.PcStatus + :param stop_reason: The reason the current packet capture session was + stopped. + :type stop_reason: str + :param packet_capture_error: List of errors of packet capture session. + :type packet_capture_error: list[str or + ~azure.mgmt.network.v2018_01_01.models.PcError] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, + 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, + 'stop_reason': {'key': 'stopReason', 'type': 'str'}, + 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, id: str=None, capture_start_time=None, packet_capture_status=None, stop_reason: str=None, packet_capture_error=None, **kwargs) -> None: + super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) + self.name = name + self.id = id + self.capture_start_time = capture_start_time + self.packet_capture_status = packet_capture_status + self.stop_reason = stop_reason + self.packet_capture_error = packet_capture_error diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_result.py new file mode 100644 index 000000000000..63afeadcc410 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_result.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureResult(Model): + """Information about packet capture session. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the packet capture. + :vartype name: str + :ivar id: ID of the packet capture. + :vartype id: str + :ivar type: Packet capture type. + :vartype type: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2018_01_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2018_01_01.models.PacketCaptureFilter] + :param provisioning_state: The provisioning state of the packet capture + session. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2018_01_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PacketCaptureResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") + self.target = kwargs.get('target', None) + self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) + self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) + self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) + self.storage_location = kwargs.get('storage_location', None) + self.filters = kwargs.get('filters', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_result_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_result_paged.py new file mode 100644 index 000000000000..93035aefefff --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_result_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class PacketCaptureResultPaged(Paged): + """ + A paging container for iterating over a list of :class:`PacketCaptureResult ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PacketCaptureResult]'} + } + + def __init__(self, *args, **kwargs): + + super(PacketCaptureResultPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_result_py3.py new file mode 100644 index 000000000000..707c3278fe8d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_result_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureResult(Model): + """Information about packet capture session. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the packet capture. + :vartype name: str + :ivar id: ID of the packet capture. + :vartype id: str + :ivar type: Packet capture type. + :vartype type: str + :param etag: Default value: "A unique read-only string that changes + whenever the resource is updated." . + :type etag: str + :param target: Required. The ID of the targeted resource, only VM is + currently supported. + :type target: str + :param bytes_to_capture_per_packet: Number of bytes captured per packet, + the remaining bytes are truncated. Default value: 0 . + :type bytes_to_capture_per_packet: int + :param total_bytes_per_session: Maximum size of the capture output. + Default value: 1073741824 . + :type total_bytes_per_session: int + :param time_limit_in_seconds: Maximum duration of the capture session in + seconds. Default value: 18000 . + :type time_limit_in_seconds: int + :param storage_location: Required. + :type storage_location: + ~azure.mgmt.network.v2018_01_01.models.PacketCaptureStorageLocation + :param filters: + :type filters: + list[~azure.mgmt.network.v2018_01_01.models.PacketCaptureFilter] + :param provisioning_state: The provisioning state of the packet capture + session. Possible values include: 'Succeeded', 'Updating', 'Deleting', + 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2018_01_01.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'target': {'required': True}, + 'storage_location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'target': {'key': 'properties.target', 'type': 'str'}, + 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, + 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, + 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, + 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, + 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, target: str, storage_location, etag: str="A unique read-only string that changes whenever the resource is updated.", bytes_to_capture_per_packet: int=0, total_bytes_per_session: int=1073741824, time_limit_in_seconds: int=18000, filters=None, provisioning_state=None, **kwargs) -> None: + super(PacketCaptureResult, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.etag = etag + self.target = target + self.bytes_to_capture_per_packet = bytes_to_capture_per_packet + self.total_bytes_per_session = total_bytes_per_session + self.time_limit_in_seconds = time_limit_in_seconds + self.storage_location = storage_location + self.filters = filters + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_storage_location.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_storage_location.py new file mode 100644 index 000000000000..62ed83d592b3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_storage_location.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureStorageLocation(Model): + """Describes the storage location for a packet capture session. + + :param storage_id: The ID of the storage account to save the packet + capture session. Required if no local file path is provided. + :type storage_id: str + :param storage_path: The URI of the storage path to save the packet + capture. Must be a well-formed URI describing the location to save the + packet capture. + :type storage_path: str + :param file_path: A valid local path on the targeting VM. Must include the + name of the capture file (*.cap). For linux virtual machine it must start + with /var/captures. Required if no storage ID is provided, otherwise + optional. + :type file_path: str + """ + + _attribute_map = { + 'storage_id': {'key': 'storageId', 'type': 'str'}, + 'storage_path': {'key': 'storagePath', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) + self.file_path = kwargs.get('file_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_storage_location_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_storage_location_py3.py new file mode 100644 index 000000000000..6925dd4f9bdf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/packet_capture_storage_location_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PacketCaptureStorageLocation(Model): + """Describes the storage location for a packet capture session. + + :param storage_id: The ID of the storage account to save the packet + capture session. Required if no local file path is provided. + :type storage_id: str + :param storage_path: The URI of the storage path to save the packet + capture. Must be a well-formed URI describing the location to save the + packet capture. + :type storage_path: str + :param file_path: A valid local path on the targeting VM. Must include the + name of the capture file (*.cap). For linux virtual machine it must start + with /var/captures. Required if no storage ID is provided, otherwise + optional. + :type file_path: str + """ + + _attribute_map = { + 'storage_id': {'key': 'storageId', 'type': 'str'}, + 'storage_path': {'key': 'storagePath', 'type': 'str'}, + 'file_path': {'key': 'filePath', 'type': 'str'}, + } + + def __init__(self, *, storage_id: str=None, storage_path: str=None, file_path: str=None, **kwargs) -> None: + super(PacketCaptureStorageLocation, self).__init__(**kwargs) + self.storage_id = storage_id + self.storage_path = storage_path + self.file_path = file_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/patch_route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/patch_route_filter.py new file mode 100644 index 000000000000..56a63bebbcc8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/patch_route_filter.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilter(SubResource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2018_01_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(PatchRouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.peerings = kwargs.get('peerings', None) + self.provisioning_state = None + self.name = None + self.etag = None + self.type = None + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/patch_route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/patch_route_filter_py3.py new file mode 100644 index 000000000000..fafe8ce38067 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/patch_route_filter_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilter(SubResource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2018_01_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + :ivar type: Resource type. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, rules=None, peerings=None, tags=None, **kwargs) -> None: + super(PatchRouteFilter, self).__init__(id=id, **kwargs) + self.rules = rules + self.peerings = peerings + self.provisioning_state = None + self.name = None + self.etag = None + self.type = None + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/patch_route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/patch_route_filter_rule.py new file mode 100644 index 000000000000..be8e77d64a13 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/patch_route_filter_rule.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2018_01_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, **kwargs): + super(PatchRouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) + self.provisioning_state = None + self.name = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/patch_route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/patch_route_filter_rule_py3.py new file mode 100644 index 000000000000..cf209e812bc9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/patch_route_filter_rule_py3.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class PatchRouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2018_01_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :vartype name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'name': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, **kwargs) -> None: + super(PatchRouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/probe.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/probe.py new file mode 100644 index 000000000000..0ca403686caf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/probe.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Probe(SubResource): + """A load balancer probe. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar load_balancing_rules: The load balancer rules that use this probe. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.ProbeProtocol + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. + :type port: int + :param interval_in_seconds: The interval, in seconds, for how frequently + to probe the endpoint for health status. Typically, the interval is + slightly less than half the allocated timeout period (in seconds) which + allows two full probes before taking the instance out of rotation. The + default value is 15, the minimum value is 5. + :type interval_in_seconds: int + :param number_of_probes: The number of probes where if no response, will + result in stopping further traffic from being delivered to the endpoint. + This values allows endpoints to be taken out of rotation faster or slower + than the typical times used in Azure. + :type number_of_probes: int + :param request_path: The URI used for requesting health status from the + VM. Path is required if a protocol is set to http. Otherwise, it is not + allowed. There is no default value. + :type request_path: str + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'load_balancing_rules': {'readonly': True}, + 'protocol': {'required': True}, + 'port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, + 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Probe, self).__init__(**kwargs) + self.load_balancing_rules = None + self.protocol = kwargs.get('protocol', None) + self.port = kwargs.get('port', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.number_of_probes = kwargs.get('number_of_probes', None) + self.request_path = kwargs.get('request_path', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/probe_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/probe_paged.py new file mode 100644 index 000000000000..196c4ad3e6ed --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/probe_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ProbePaged(Paged): + """ + A paging container for iterating over a list of :class:`Probe ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Probe]'} + } + + def __init__(self, *args, **kwargs): + + super(ProbePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/probe_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/probe_py3.py new file mode 100644 index 000000000000..5e352a0ab3a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/probe_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Probe(SubResource): + """A load balancer probe. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar load_balancing_rules: The load balancer rules that use this probe. + :vartype load_balancing_rules: + list[~azure.mgmt.network.v2018_01_01.models.SubResource] + :param protocol: Required. The protocol of the end point. Possible values + are: 'Http' or 'Tcp'. If 'Tcp' is specified, a received ACK is required + for the probe to be successful. If 'Http' is specified, a 200 OK response + from the specifies URI is required for the probe to be successful. + Possible values include: 'Http', 'Tcp' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.ProbeProtocol + :param port: Required. The port for communicating the probe. Possible + values range from 1 to 65535, inclusive. + :type port: int + :param interval_in_seconds: The interval, in seconds, for how frequently + to probe the endpoint for health status. Typically, the interval is + slightly less than half the allocated timeout period (in seconds) which + allows two full probes before taking the instance out of rotation. The + default value is 15, the minimum value is 5. + :type interval_in_seconds: int + :param number_of_probes: The number of probes where if no response, will + result in stopping further traffic from being delivered to the endpoint. + This values allows endpoints to be taken out of rotation faster or slower + than the typical times used in Azure. + :type number_of_probes: int + :param request_path: The URI used for requesting health status from the + VM. Path is required if a protocol is set to http. Otherwise, it is not + allowed. There is no default value. + :type request_path: str + :param provisioning_state: Gets the provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'load_balancing_rules': {'readonly': True}, + 'protocol': {'required': True}, + 'port': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, + 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, + 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, port: int, id: str=None, interval_in_seconds: int=None, number_of_probes: int=None, request_path: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Probe, self).__init__(id=id, **kwargs) + self.load_balancing_rules = None + self.protocol = protocol + self.port = port + self.interval_in_seconds = interval_in_seconds + self.number_of_probes = number_of_probes + self.request_path = request_path + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address.py new file mode 100644 index 000000000000..093b16e77a2d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PublicIPAddress(Resource): + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The public IP address SKU. + :type sku: ~azure.mgmt.network.v2018_01_01.models.PublicIPAddressSku + :param public_ip_allocation_method: The public IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type public_ip_allocation_method: str or + ~azure.mgmt.network.v2018_01_01.models.IPAllocationMethod + :param public_ip_address_version: The public IP address version. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + :type public_ip_address_version: str or + ~azure.mgmt.network.v2018_01_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP + address. + :vartype ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.IPConfiguration + :param dns_settings: The FQDN of the DNS record associated with the public + IP address. + :type dns_settings: + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddressDnsSettings + :param ip_tags: The list of tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.network.v2018_01_01.models.IpTag] + :param ip_address: The IP address associated with the public IP address + resource. + :type ip_address: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param resource_guid: The resource GUID property of the public IP + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, + 'ip_tags': {'key': 'properties.ipTags', 'type': '[IpTag]'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PublicIPAddress, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) + self.public_ip_address_version = kwargs.get('public_ip_address_version', None) + self.ip_configuration = None + self.dns_settings = kwargs.get('dns_settings', None) + self.ip_tags = kwargs.get('ip_tags', None) + self.ip_address = kwargs.get('ip_address', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_dns_settings.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_dns_settings.py new file mode 100644 index 000000000000..07dfe30433a6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_dns_settings.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressDnsSettings(Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :param domain_name_label: Gets or sets the Domain name label.The + concatenation of the domain name label and the regionalized DNS zone make + up the fully qualified domain name associated with the public IP address. + If a domain name label is specified, an A DNS record is created for the + public IP in the Microsoft Azure DNS system. + :type domain_name_label: str + :param fqdn: Gets the FQDN, Fully qualified domain name of the A DNS + record associated with the public IP. This is the concatenation of the + domainNameLabel and the regionalized DNS zone. + :type fqdn: str + :param reverse_fqdn: Gets or Sets the Reverse FQDN. A user-visible, fully + qualified domain name that resolves to this public IP address. If the + reverseFqdn is specified, then a PTR DNS record is created pointing from + the IP address in the in-addr.arpa domain to the reverse FQDN. + :type reverse_fqdn: str + """ + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) + self.fqdn = kwargs.get('fqdn', None) + self.reverse_fqdn = kwargs.get('reverse_fqdn', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_dns_settings_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_dns_settings_py3.py new file mode 100644 index 000000000000..e84aa9c10bf5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_dns_settings_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressDnsSettings(Model): + """Contains FQDN of the DNS record associated with the public IP address. + + :param domain_name_label: Gets or sets the Domain name label.The + concatenation of the domain name label and the regionalized DNS zone make + up the fully qualified domain name associated with the public IP address. + If a domain name label is specified, an A DNS record is created for the + public IP in the Microsoft Azure DNS system. + :type domain_name_label: str + :param fqdn: Gets the FQDN, Fully qualified domain name of the A DNS + record associated with the public IP. This is the concatenation of the + domainNameLabel and the regionalized DNS zone. + :type fqdn: str + :param reverse_fqdn: Gets or Sets the Reverse FQDN. A user-visible, fully + qualified domain name that resolves to this public IP address. If the + reverseFqdn is specified, then a PTR DNS record is created pointing from + the IP address in the in-addr.arpa domain to the reverse FQDN. + :type reverse_fqdn: str + """ + + _attribute_map = { + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, + } + + def __init__(self, *, domain_name_label: str=None, fqdn: str=None, reverse_fqdn: str=None, **kwargs) -> None: + super(PublicIPAddressDnsSettings, self).__init__(**kwargs) + self.domain_name_label = domain_name_label + self.fqdn = fqdn + self.reverse_fqdn = reverse_fqdn diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_paged.py new file mode 100644 index 000000000000..1dac9fce99e3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class PublicIPAddressPaged(Paged): + """ + A paging container for iterating over a list of :class:`PublicIPAddress ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PublicIPAddress]'} + } + + def __init__(self, *args, **kwargs): + + super(PublicIPAddressPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_py3.py new file mode 100644 index 000000000000..e5f405e95c62 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_py3.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class PublicIPAddress(Resource): + """Public IP address resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The public IP address SKU. + :type sku: ~azure.mgmt.network.v2018_01_01.models.PublicIPAddressSku + :param public_ip_allocation_method: The public IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type public_ip_allocation_method: str or + ~azure.mgmt.network.v2018_01_01.models.IPAllocationMethod + :param public_ip_address_version: The public IP address version. Possible + values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' + :type public_ip_address_version: str or + ~azure.mgmt.network.v2018_01_01.models.IPVersion + :ivar ip_configuration: The IP configuration associated with the public IP + address. + :vartype ip_configuration: + ~azure.mgmt.network.v2018_01_01.models.IPConfiguration + :param dns_settings: The FQDN of the DNS record associated with the public + IP address. + :type dns_settings: + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddressDnsSettings + :param ip_tags: The list of tags associated with the public IP address. + :type ip_tags: list[~azure.mgmt.network.v2018_01_01.models.IpTag] + :param ip_address: The IP address associated with the public IP address + resource. + :type ip_address: str + :param idle_timeout_in_minutes: The idle timeout of the public IP address. + :type idle_timeout_in_minutes: int + :param resource_guid: The resource GUID property of the public IP + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'ip_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, + 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, + 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, + 'ip_tags': {'key': 'properties.ipTags', 'type': '[IpTag]'}, + 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_tags=None, ip_address: str=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, zones=None, **kwargs) -> None: + super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.public_ip_allocation_method = public_ip_allocation_method + self.public_ip_address_version = public_ip_address_version + self.ip_configuration = None + self.dns_settings = dns_settings + self.ip_tags = ip_tags + self.ip_address = ip_address + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag + self.zones = zones diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_sku.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_sku.py new file mode 100644 index 000000000000..d088ba433dae --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_sku.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressSku(Model): + """SKU of a public IP address. + + :param name: Name of a public IP address SKU. Possible values include: + 'Basic', 'Standard' + :type name: str or + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddressSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_sku_py3.py new file mode 100644 index 000000000000..29737023c272 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/public_ip_address_sku_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PublicIPAddressSku(Model): + """SKU of a public IP address. + + :param name: Name of a public IP address SKU. Possible values include: + 'Basic', 'Standard' + :type name: str or + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddressSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(PublicIPAddressSku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/query_troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/query_troubleshooting_parameters.py new file mode 100644 index 000000000000..6ae1924916c6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/query_troubleshooting_parameters.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryTroubleshootingParameters(Model): + """Parameters that define the resource to query the troubleshooting result. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the + troubleshooting result. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/query_troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/query_troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..b5fccb87857c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/query_troubleshooting_parameters_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryTroubleshootingParameters(Model): + """Parameters that define the resource to query the troubleshooting result. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource ID to query the + troubleshooting result. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(QueryTroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/resource.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/resource.py new file mode 100644 index 000000000000..7dabab29ac9d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/resource.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Common resource representation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/resource_navigation_link.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/resource_navigation_link.py new file mode 100644 index 000000000000..705698f513f6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/resource_navigation_link.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ResourceNavigationLink(SubResource): + """ResourceNavigationLink resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource + :type link: str + :ivar provisioning_state: Provisioning state of the ResourceNavigationLink + resource. + :vartype provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceNavigationLink, self).__init__(**kwargs) + self.linked_resource_type = kwargs.get('linked_resource_type', None) + self.link = kwargs.get('link', None) + self.provisioning_state = None + self.name = kwargs.get('name', None) + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/resource_navigation_link_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/resource_navigation_link_py3.py new file mode 100644 index 000000000000..5cb22d347836 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/resource_navigation_link_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class ResourceNavigationLink(SubResource): + """ResourceNavigationLink resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param linked_resource_type: Resource type of the linked resource. + :type linked_resource_type: str + :param link: Link to the external resource + :type link: str + :ivar provisioning_state: Provisioning state of the ResourceNavigationLink + resource. + :vartype provisioning_state: str + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, + 'link': {'key': 'properties.link', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, linked_resource_type: str=None, link: str=None, name: str=None, **kwargs) -> None: + super(ResourceNavigationLink, self).__init__(id=id, **kwargs) + self.linked_resource_type = linked_resource_type + self.link = link + self.provisioning_state = None + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/resource_py3.py new file mode 100644 index 000000000000..ae95b78b4f23 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/resource_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Common resource representation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/retention_policy_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/retention_policy_parameters.py new file mode 100644 index 000000000000..28cb43056d47 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/retention_policy_parameters.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RetentionPolicyParameters(Model): + """Parameters that define the retention policy for flow log. + + :param days: Number of days to retain flow log records. Default value: 0 . + :type days: int + :param enabled: Flag to enable/disable retention. Default value: False . + :type enabled: bool + """ + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = kwargs.get('days', 0) + self.enabled = kwargs.get('enabled', False) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/retention_policy_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/retention_policy_parameters_py3.py new file mode 100644 index 000000000000..3b2ffc5e741e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/retention_policy_parameters_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class RetentionPolicyParameters(Model): + """Parameters that define the retention policy for flow log. + + :param days: Number of days to retain flow log records. Default value: 0 . + :type days: int + :param enabled: Flag to enable/disable retention. Default value: False . + :type enabled: bool + """ + + _attribute_map = { + 'days': {'key': 'days', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, days: int=0, enabled: bool=False, **kwargs) -> None: + super(RetentionPolicyParameters, self).__init__(**kwargs) + self.days = days + self.enabled = enabled diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route.py new file mode 100644 index 000000000000..daf5fd2bdbaf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Route(SubResource): + """Route resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param address_prefix: The destination CIDR to which the route applies. + :type address_prefix: str + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2018_01_01.models.RouteNextHopType + :param next_hop_ip_address: The IP address packets should be forwarded to. + Next hop values are only allowed in routes where the next hop type is + VirtualAppliance. + :type next_hop_ip_address: str + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'next_hop_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Route, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.next_hop_type = kwargs.get('next_hop_type', None) + self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter.py new file mode 100644 index 000000000000..718664fe9c52 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteFilter(Resource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2018_01_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RouteFilter, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + self.peerings = kwargs.get('peerings', None) + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_paged.py new file mode 100644 index 000000000000..144c39da4dcf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class RouteFilterPaged(Paged): + """ + A paging container for iterating over a list of :class:`RouteFilter ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RouteFilter]'} + } + + def __init__(self, *args, **kwargs): + + super(RouteFilterPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_py3.py new file mode 100644 index 000000000000..05bdfaaa214c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteFilter(Resource): + """Route Filter Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param rules: Collection of RouteFilterRules contained within a route + filter. + :type rules: list[~azure.mgmt.network.v2018_01_01.models.RouteFilterRule] + :param peerings: A collection of references to express route circuit + peerings. + :type peerings: + list[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, + 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, rules=None, peerings=None, **kwargs) -> None: + super(RouteFilter, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.rules = rules + self.peerings = peerings + self.provisioning_state = None + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_rule.py new file mode 100644 index 000000000000..426d0090a277 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_rule.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class RouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2018_01_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param location: Resource location. + :type location: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, **kwargs): + super(RouteFilterRule, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.communities = kwargs.get('communities', None) + self.provisioning_state = None + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_rule_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_rule_paged.py new file mode 100644 index 000000000000..78c49da69bc5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_rule_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class RouteFilterRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`RouteFilterRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RouteFilterRule]'} + } + + def __init__(self, *args, **kwargs): + + super(RouteFilterRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_rule_py3.py new file mode 100644 index 000000000000..70ec4c60e71b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_filter_rule_py3.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class RouteFilterRule(SubResource): + """Route Filter Rule Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param access: Required. The access type of the rule. Valid values are: + 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2018_01_01.models.Access + :ivar route_filter_rule_type: Required. The rule type of the rule. Valid + value is: 'Community'. Default value: "Community" . + :vartype route_filter_rule_type: str + :param communities: Required. The collection for bgp community values to + filter on. e.g. ['12076:5010','12076:5020'] + :type communities: list[str] + :ivar provisioning_state: The provisioning state of the resource. Possible + values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param location: Resource location. + :type location: str + :ivar etag: A unique read-only string that changes whenever the resource + is updated. + :vartype etag: str + """ + + _validation = { + 'access': {'required': True}, + 'route_filter_rule_type': {'required': True, 'constant': True}, + 'communities': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, + 'communities': {'key': 'properties.communities', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + route_filter_rule_type = "Community" + + def __init__(self, *, access, communities, id: str=None, name: str=None, location: str=None, **kwargs) -> None: + super(RouteFilterRule, self).__init__(id=id, **kwargs) + self.access = access + self.communities = communities + self.provisioning_state = None + self.name = name + self.location = location + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_paged.py new file mode 100644 index 000000000000..598a1129ec51 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class RoutePaged(Paged): + """ + A paging container for iterating over a list of :class:`Route ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Route]'} + } + + def __init__(self, *args, **kwargs): + + super(RoutePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_py3.py new file mode 100644 index 000000000000..0553d8a9ab45 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Route(SubResource): + """Route resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param address_prefix: The destination CIDR to which the route applies. + :type address_prefix: str + :param next_hop_type: Required. The type of Azure hop the packet should be + sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', + 'Internet', 'VirtualAppliance', and 'None'. Possible values include: + 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', + 'None' + :type next_hop_type: str or + ~azure.mgmt.network.v2018_01_01.models.RouteNextHopType + :param next_hop_ip_address: The IP address packets should be forwarded to. + Next hop values are only allowed in routes where the next hop type is + VirtualAppliance. + :type next_hop_ip_address: str + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'next_hop_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, + 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, next_hop_type, id: str=None, address_prefix: str=None, next_hop_ip_address: str=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Route, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.next_hop_type = next_hop_type + self.next_hop_ip_address = next_hop_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_table.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_table.py new file mode 100644 index 000000000000..d2cd55e4c685 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_table.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteTable(Resource): + """Route table resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param routes: Collection of routes contained within a route table. + :type routes: list[~azure.mgmt.network.v2018_01_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2018_01_01.models.Subnet] + :param disable_bgp_route_propagation: Gets or sets whether to disable the + routes learned by BGP on that route table. True means disable. + :type disable_bgp_route_propagation: bool + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'routes': {'key': 'properties.routes', 'type': '[Route]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'disable_bgp_route_propagation': {'key': 'properties.disableBgpRoutePropagation', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RouteTable, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) + self.subnets = None + self.disable_bgp_route_propagation = kwargs.get('disable_bgp_route_propagation', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_table_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_table_paged.py new file mode 100644 index 000000000000..bdf562192f9a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_table_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class RouteTablePaged(Paged): + """ + A paging container for iterating over a list of :class:`RouteTable ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RouteTable]'} + } + + def __init__(self, *args, **kwargs): + + super(RouteTablePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_table_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_table_py3.py new file mode 100644 index 000000000000..846217f10f59 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/route_table_py3.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class RouteTable(Resource): + """Route table resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param routes: Collection of routes contained within a route table. + :type routes: list[~azure.mgmt.network.v2018_01_01.models.Route] + :ivar subnets: A collection of references to subnets. + :vartype subnets: list[~azure.mgmt.network.v2018_01_01.models.Subnet] + :param disable_bgp_route_propagation: Gets or sets whether to disable the + routes learned by BGP on that route table. True means disable. + :type disable_bgp_route_propagation: bool + :param provisioning_state: The provisioning state of the resource. + Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'subnets': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'routes': {'key': 'properties.routes', 'type': '[Route]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'disable_bgp_route_propagation': {'key': 'properties.disableBgpRoutePropagation', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, routes=None, disable_bgp_route_propagation: bool=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(RouteTable, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.routes = routes + self.subnets = None + self.disable_bgp_route_propagation = disable_bgp_route_propagation + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_network_interface.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_network_interface.py new file mode 100644 index 000000000000..976716ade89f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_network_interface.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupNetworkInterface(Model): + """Network interface and all its associated security rules. + + :param id: ID of the network interface. + :type id: str + :param security_rule_associations: + :type security_rule_associations: + ~azure.mgmt.network.v2018_01_01.models.SecurityRuleAssociations + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, + } + + def __init__(self, **kwargs): + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.security_rule_associations = kwargs.get('security_rule_associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_network_interface_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_network_interface_py3.py new file mode 100644 index 000000000000..b1a6867d8790 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_network_interface_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupNetworkInterface(Model): + """Network interface and all its associated security rules. + + :param id: ID of the network interface. + :type id: str + :param security_rule_associations: + :type security_rule_associations: + ~azure.mgmt.network.v2018_01_01.models.SecurityRuleAssociations + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, + } + + def __init__(self, *, id: str=None, security_rule_associations=None, **kwargs) -> None: + super(SecurityGroupNetworkInterface, self).__init__(**kwargs) + self.id = id + self.security_rule_associations = security_rule_associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_view_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_view_parameters.py new file mode 100644 index 000000000000..1d547b0b0e2b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_view_parameters.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewParameters(Model): + """Parameters that define the VM to check security groups for. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_view_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_view_parameters_py3.py new file mode 100644 index 000000000000..7ccc48017444 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_view_parameters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewParameters(Model): + """Parameters that define the VM to check security groups for. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ID of the target VM. + :type target_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, **kwargs) -> None: + super(SecurityGroupViewParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_view_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_view_result.py new file mode 100644 index 000000000000..0550eb212752 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_view_result.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewResult(Model): + """The information about security rules applied to the specified VM. + + :param network_interfaces: List of network interfaces on the specified VM. + :type network_interfaces: + list[~azure.mgmt.network.v2018_01_01.models.SecurityGroupNetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, + } + + def __init__(self, **kwargs): + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = kwargs.get('network_interfaces', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_view_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_view_result_py3.py new file mode 100644 index 000000000000..89c724c0577d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_group_view_result_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityGroupViewResult(Model): + """The information about security rules applied to the specified VM. + + :param network_interfaces: List of network interfaces on the specified VM. + :type network_interfaces: + list[~azure.mgmt.network.v2018_01_01.models.SecurityGroupNetworkInterface] + """ + + _attribute_map = { + 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, + } + + def __init__(self, *, network_interfaces=None, **kwargs) -> None: + super(SecurityGroupViewResult, self).__init__(**kwargs) + self.network_interfaces = network_interfaces diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule.py new file mode 100644 index 000000000000..face23bb8ae9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule.py @@ -0,0 +1,137 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class SecurityRule(SubResource): + """Network security rule. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. Integer or range + between 0 and 65535. Asterix '*' can also be used to match all ports. + :type source_port_range: str + :param destination_port_range: The destination port or range. Integer or + range between 0 and 65535. Asterix '*' can also be used to match all + ports. + :type destination_port_range: str + :param source_address_prefix: The CIDR or source IP range. Asterix '*' can + also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + this is an ingress rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param source_address_prefixes: The CIDR or source IP ranges. + :type source_address_prefixes: list[str] + :param source_application_security_groups: The application security group + specified as source. + :type source_application_security_groups: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup] + :param destination_address_prefix: The destination address prefix. CIDR or + destination IP range. Asterix '*' can also be used to match all source + IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. + :type destination_address_prefix: str + :param destination_address_prefixes: The destination address prefixes. + CIDR or destination IP ranges. + :type destination_address_prefixes: list[str] + :param destination_application_security_groups: The application security + group specified as destination. + :type destination_application_security_groups: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup] + :param source_port_ranges: The source port ranges. + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. + :type destination_port_ranges: list[str] + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' + :type access: str or + ~azure.mgmt.network.v2018_01_01.models.SecurityRuleAccess + :param priority: The priority of the rule. The value can be between 100 + and 4096. The priority number must be unique for each rule in the + collection. The lower the priority number, the higher the priority of the + rule. + :type priority: int + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2018_01_01.models.SecurityRuleDirection + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'access': {'required': True}, + 'direction': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'properties.sourceAddressPrefixes', 'type': '[str]'}, + 'source_application_security_groups': {'key': 'properties.sourceApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, + 'destination_address_prefixes': {'key': 'properties.destinationAddressPrefixes', 'type': '[str]'}, + 'destination_application_security_groups': {'key': 'properties.destinationApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'source_port_ranges': {'key': 'properties.sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'properties.destinationPortRanges', 'type': '[str]'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecurityRule, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.protocol = kwargs.get('protocol', None) + self.source_port_range = kwargs.get('source_port_range', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.source_address_prefixes = kwargs.get('source_address_prefixes', None) + self.source_application_security_groups = kwargs.get('source_application_security_groups', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) + self.destination_application_security_groups = kwargs.get('destination_application_security_groups', None) + self.source_port_ranges = kwargs.get('source_port_ranges', None) + self.destination_port_ranges = kwargs.get('destination_port_ranges', None) + self.access = kwargs.get('access', None) + self.priority = kwargs.get('priority', None) + self.direction = kwargs.get('direction', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule_associations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule_associations.py new file mode 100644 index 000000000000..4a9bd9d94095 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule_associations.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityRuleAssociations(Model): + """All security rules associated with the network interface. + + :param network_interface_association: + :type network_interface_association: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceAssociation + :param subnet_association: + :type subnet_association: + ~azure.mgmt.network.v2018_01_01.models.SubnetAssociation + :param default_security_rules: Collection of default security rules of the + network security group. + :type default_security_rules: + list[~azure.mgmt.network.v2018_01_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2018_01_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, + 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, + 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__(self, **kwargs): + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = kwargs.get('network_interface_association', None) + self.subnet_association = kwargs.get('subnet_association', None) + self.default_security_rules = kwargs.get('default_security_rules', None) + self.effective_security_rules = kwargs.get('effective_security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule_associations_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule_associations_py3.py new file mode 100644 index 000000000000..26c4cba1b1cc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule_associations_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecurityRuleAssociations(Model): + """All security rules associated with the network interface. + + :param network_interface_association: + :type network_interface_association: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceAssociation + :param subnet_association: + :type subnet_association: + ~azure.mgmt.network.v2018_01_01.models.SubnetAssociation + :param default_security_rules: Collection of default security rules of the + network security group. + :type default_security_rules: + list[~azure.mgmt.network.v2018_01_01.models.SecurityRule] + :param effective_security_rules: Collection of effective security rules. + :type effective_security_rules: + list[~azure.mgmt.network.v2018_01_01.models.EffectiveNetworkSecurityRule] + """ + + _attribute_map = { + 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, + 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, + 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, + 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, + } + + def __init__(self, *, network_interface_association=None, subnet_association=None, default_security_rules=None, effective_security_rules=None, **kwargs) -> None: + super(SecurityRuleAssociations, self).__init__(**kwargs) + self.network_interface_association = network_interface_association + self.subnet_association = subnet_association + self.default_security_rules = default_security_rules + self.effective_security_rules = effective_security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule_paged.py new file mode 100644 index 000000000000..18fdb8c0eaac --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SecurityRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`SecurityRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SecurityRule]'} + } + + def __init__(self, *args, **kwargs): + + super(SecurityRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule_py3.py new file mode 100644 index 000000000000..5273463ccf2e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/security_rule_py3.py @@ -0,0 +1,137 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class SecurityRule(SubResource): + """Network security rule. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param protocol: Required. Network protocol this rule applies to. Possible + values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', + '*' + :type protocol: str or + ~azure.mgmt.network.v2018_01_01.models.SecurityRuleProtocol + :param source_port_range: The source port or range. Integer or range + between 0 and 65535. Asterix '*' can also be used to match all ports. + :type source_port_range: str + :param destination_port_range: The destination port or range. Integer or + range between 0 and 65535. Asterix '*' can also be used to match all + ports. + :type destination_port_range: str + :param source_address_prefix: The CIDR or source IP range. Asterix '*' can + also be used to match all source IPs. Default tags such as + 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If + this is an ingress rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param source_address_prefixes: The CIDR or source IP ranges. + :type source_address_prefixes: list[str] + :param source_application_security_groups: The application security group + specified as source. + :type source_application_security_groups: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup] + :param destination_address_prefix: The destination address prefix. CIDR or + destination IP range. Asterix '*' can also be used to match all source + IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and + 'Internet' can also be used. + :type destination_address_prefix: str + :param destination_address_prefixes: The destination address prefixes. + CIDR or destination IP ranges. + :type destination_address_prefixes: list[str] + :param destination_application_security_groups: The application security + group specified as destination. + :type destination_application_security_groups: + list[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup] + :param source_port_ranges: The source port ranges. + :type source_port_ranges: list[str] + :param destination_port_ranges: The destination port ranges. + :type destination_port_ranges: list[str] + :param access: Required. The network traffic is allowed or denied. + Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', + 'Deny' + :type access: str or + ~azure.mgmt.network.v2018_01_01.models.SecurityRuleAccess + :param priority: The priority of the rule. The value can be between 100 + and 4096. The priority number must be unique for each rule in the + collection. The lower the priority number, the higher the priority of the + rule. + :type priority: int + :param direction: Required. The direction of the rule. The direction + specifies if rule will be evaluated on incoming or outcoming traffic. + Possible values are: 'Inbound' and 'Outbound'. Possible values include: + 'Inbound', 'Outbound' + :type direction: str or + ~azure.mgmt.network.v2018_01_01.models.SecurityRuleDirection + :param provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'protocol': {'required': True}, + 'access': {'required': True}, + 'direction': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'protocol': {'key': 'properties.protocol', 'type': 'str'}, + 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, + 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, + 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, + 'source_address_prefixes': {'key': 'properties.sourceAddressPrefixes', 'type': '[str]'}, + 'source_application_security_groups': {'key': 'properties.sourceApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, + 'destination_address_prefixes': {'key': 'properties.destinationAddressPrefixes', 'type': '[str]'}, + 'destination_application_security_groups': {'key': 'properties.destinationApplicationSecurityGroups', 'type': '[ApplicationSecurityGroup]'}, + 'source_port_ranges': {'key': 'properties.sourcePortRanges', 'type': '[str]'}, + 'destination_port_ranges': {'key': 'properties.destinationPortRanges', 'type': '[str]'}, + 'access': {'key': 'properties.access', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, protocol, access, direction, id: str=None, description: str=None, source_port_range: str=None, destination_port_range: str=None, source_address_prefix: str=None, source_address_prefixes=None, source_application_security_groups=None, destination_address_prefix: str=None, destination_address_prefixes=None, destination_application_security_groups=None, source_port_ranges=None, destination_port_ranges=None, priority: int=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(SecurityRule, self).__init__(id=id, **kwargs) + self.description = description + self.protocol = protocol + self.source_port_range = source_port_range + self.destination_port_range = destination_port_range + self.source_address_prefix = source_address_prefix + self.source_address_prefixes = source_address_prefixes + self.source_application_security_groups = source_application_security_groups + self.destination_address_prefix = destination_address_prefix + self.destination_address_prefixes = destination_address_prefixes + self.destination_application_security_groups = destination_application_security_groups + self.source_port_ranges = source_port_ranges + self.destination_port_ranges = destination_port_ranges + self.access = access + self.priority = priority + self.direction = direction + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/service_endpoint_properties_format.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/service_endpoint_properties_format.py new file mode 100644 index 000000000000..87ca01e64540 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/service_endpoint_properties_format.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceEndpointPropertiesFormat(Model): + """The service endpoint properties. + + :param service: The type of the endpoint service. + :type service: str + :param locations: A list of locations. + :type locations: list[str] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + """ + + _attribute_map = { + 'service': {'key': 'service', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = kwargs.get('service', None) + self.locations = kwargs.get('locations', None) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/service_endpoint_properties_format_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/service_endpoint_properties_format_py3.py new file mode 100644 index 000000000000..8d3d2e5e8347 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/service_endpoint_properties_format_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceEndpointPropertiesFormat(Model): + """The service endpoint properties. + + :param service: The type of the endpoint service. + :type service: str + :param locations: A list of locations. + :type locations: list[str] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + """ + + _attribute_map = { + 'service': {'key': 'service', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, service: str=None, locations=None, provisioning_state: str=None, **kwargs) -> None: + super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) + self.service = service + self.locations = locations + self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/sub_resource.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/sub_resource.py new file mode 100644 index 000000000000..6ab81f55f21b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/sub_resource.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """Reference to another subresource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/sub_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/sub_resource_py3.py new file mode 100644 index 000000000000..8f4c4c816061 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/sub_resource_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubResource(Model): + """Reference to another subresource. + + :param id: Resource ID. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet.py new file mode 100644 index 000000000000..e6a67d3186f6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Subnet(SubResource): + """Subnet in a virtual network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param address_prefix: The address prefix for the subnet. + :type address_prefix: str + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup + :param route_table: The reference of the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2018_01_01.models.RouteTable + :param service_endpoints: An array of service endpoints. + :type service_endpoints: + list[~azure.mgmt.network.v2018_01_01.models.ServiceEndpointPropertiesFormat] + :ivar ip_configurations: Gets an array of references to the network + interface IP configurations using subnet. + :vartype ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.IPConfiguration] + :param resource_navigation_links: Gets an array of references to the + external resources using subnet. + :type resource_navigation_links: + list[~azure.mgmt.network.v2018_01_01.models.ResourceNavigationLink] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'ip_configurations': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, + 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Subnet, self).__init__(**kwargs) + self.address_prefix = kwargs.get('address_prefix', None) + self.network_security_group = kwargs.get('network_security_group', None) + self.route_table = kwargs.get('route_table', None) + self.service_endpoints = kwargs.get('service_endpoints', None) + self.ip_configurations = None + self.resource_navigation_links = kwargs.get('resource_navigation_links', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet_association.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet_association.py new file mode 100644 index 000000000000..f329c752a5a7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet_association.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Subnet ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2018_01_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, **kwargs): + super(SubnetAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = kwargs.get('security_rules', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet_association_py3.py new file mode 100644 index 000000000000..d9e420bd18cb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubnetAssociation(Model): + """Network interface and its custom security rules. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Subnet ID. + :vartype id: str + :param security_rules: Collection of custom security rules. + :type security_rules: + list[~azure.mgmt.network.v2018_01_01.models.SecurityRule] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, + } + + def __init__(self, *, security_rules=None, **kwargs) -> None: + super(SubnetAssociation, self).__init__(**kwargs) + self.id = None + self.security_rules = security_rules diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet_paged.py new file mode 100644 index 000000000000..e740aedc8c92 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SubnetPaged(Paged): + """ + A paging container for iterating over a list of :class:`Subnet ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Subnet]'} + } + + def __init__(self, *args, **kwargs): + + super(SubnetPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet_py3.py new file mode 100644 index 000000000000..a0bf5fb2161a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/subnet_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class Subnet(SubResource): + """Subnet in a virtual network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param address_prefix: The address prefix for the subnet. + :type address_prefix: str + :param network_security_group: The reference of the NetworkSecurityGroup + resource. + :type network_security_group: + ~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup + :param route_table: The reference of the RouteTable resource. + :type route_table: ~azure.mgmt.network.v2018_01_01.models.RouteTable + :param service_endpoints: An array of service endpoints. + :type service_endpoints: + list[~azure.mgmt.network.v2018_01_01.models.ServiceEndpointPropertiesFormat] + :ivar ip_configurations: Gets an array of references to the network + interface IP configurations using subnet. + :vartype ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.IPConfiguration] + :param resource_navigation_links: Gets an array of references to the + external resources using subnet. + :type resource_navigation_links: + list[~azure.mgmt.network.v2018_01_01.models.ResourceNavigationLink] + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'ip_configurations': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, + 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, + 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, address_prefix: str=None, network_security_group=None, route_table=None, service_endpoints=None, resource_navigation_links=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(Subnet, self).__init__(id=id, **kwargs) + self.address_prefix = address_prefix + self.network_security_group = network_security_group + self.route_table = route_table + self.service_endpoints = service_endpoints + self.ip_configurations = None + self.resource_navigation_links = resource_navigation_links + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/tags_object.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/tags_object.py new file mode 100644 index 000000000000..2966ec220f94 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/tags_object.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagsObject(Model): + """Tags object for patch operations. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TagsObject, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/tags_object_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/tags_object_py3.py new file mode 100644 index 000000000000..8be0bb4a15d7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/tags_object_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TagsObject(Model): + """Tags object for patch operations. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsObject, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology.py new file mode 100644 index 000000000000..138b7a909caf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Topology(Model): + """Topology of the specified resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: GUID representing the operation id. + :vartype id: str + :ivar created_date_time: The datetime when the topology was initially + created for the resource group. + :vartype created_date_time: datetime + :ivar last_modified: The datetime when the topology was last modified. + :vartype last_modified: datetime + :param resources: + :type resources: + list[~azure.mgmt.network.v2018_01_01.models.TopologyResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, + } + + def __init__(self, **kwargs): + super(Topology, self).__init__(**kwargs) + self.id = None + self.created_date_time = None + self.last_modified = None + self.resources = kwargs.get('resources', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_association.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_association.py new file mode 100644 index 000000000000..4468ea3eadb6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_association.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyAssociation(Model): + """Resources that have an association with the parent resource. + + :param name: The name of the resource that is associated with the parent + resource. + :type name: str + :param resource_id: The ID of the resource that is associated with the + parent resource. + :type resource_id: str + :param association_type: The association type of the child resource to the + parent resource. Possible values include: 'Associated', 'Contains' + :type association_type: str or + ~azure.mgmt.network.v2018_01_01.models.AssociationType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'association_type': {'key': 'associationType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TopologyAssociation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.resource_id = kwargs.get('resource_id', None) + self.association_type = kwargs.get('association_type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_association_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_association_py3.py new file mode 100644 index 000000000000..67afa656da7a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_association_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyAssociation(Model): + """Resources that have an association with the parent resource. + + :param name: The name of the resource that is associated with the parent + resource. + :type name: str + :param resource_id: The ID of the resource that is associated with the + parent resource. + :type resource_id: str + :param association_type: The association type of the child resource to the + parent resource. Possible values include: 'Associated', 'Contains' + :type association_type: str or + ~azure.mgmt.network.v2018_01_01.models.AssociationType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'association_type': {'key': 'associationType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, resource_id: str=None, association_type=None, **kwargs) -> None: + super(TopologyAssociation, self).__init__(**kwargs) + self.name = name + self.resource_id = resource_id + self.association_type = association_type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_parameters.py new file mode 100644 index 000000000000..658880384c40 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_parameters.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyParameters(Model): + """Parameters that define the representation of topology. + + :param target_resource_group_name: The name of the target resource group + to perform topology on. + :type target_resource_group_name: str + :param target_virtual_network: The reference of the Virtual Network + resource. + :type target_virtual_network: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param target_subnet: The reference of the Subnet resource. + :type target_subnet: ~azure.mgmt.network.v2018_01_01.models.SubResource + """ + + _attribute_map = { + 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, + 'target_virtual_network': {'key': 'targetVirtualNetwork', 'type': 'SubResource'}, + 'target_subnet': {'key': 'targetSubnet', 'type': 'SubResource'}, + } + + def __init__(self, **kwargs): + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = kwargs.get('target_resource_group_name', None) + self.target_virtual_network = kwargs.get('target_virtual_network', None) + self.target_subnet = kwargs.get('target_subnet', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_parameters_py3.py new file mode 100644 index 000000000000..263d773b19f1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_parameters_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyParameters(Model): + """Parameters that define the representation of topology. + + :param target_resource_group_name: The name of the target resource group + to perform topology on. + :type target_resource_group_name: str + :param target_virtual_network: The reference of the Virtual Network + resource. + :type target_virtual_network: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param target_subnet: The reference of the Subnet resource. + :type target_subnet: ~azure.mgmt.network.v2018_01_01.models.SubResource + """ + + _attribute_map = { + 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, + 'target_virtual_network': {'key': 'targetVirtualNetwork', 'type': 'SubResource'}, + 'target_subnet': {'key': 'targetSubnet', 'type': 'SubResource'}, + } + + def __init__(self, *, target_resource_group_name: str=None, target_virtual_network=None, target_subnet=None, **kwargs) -> None: + super(TopologyParameters, self).__init__(**kwargs) + self.target_resource_group_name = target_resource_group_name + self.target_virtual_network = target_virtual_network + self.target_subnet = target_subnet diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_py3.py new file mode 100644 index 000000000000..3c8c786341ea --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Topology(Model): + """Topology of the specified resource group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: GUID representing the operation id. + :vartype id: str + :ivar created_date_time: The datetime when the topology was initially + created for the resource group. + :vartype created_date_time: datetime + :ivar last_modified: The datetime when the topology was last modified. + :vartype last_modified: datetime + :param resources: + :type resources: + list[~azure.mgmt.network.v2018_01_01.models.TopologyResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, + } + + def __init__(self, *, resources=None, **kwargs) -> None: + super(Topology, self).__init__(**kwargs) + self.id = None + self.created_date_time = None + self.last_modified = None + self.resources = resources diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_resource.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_resource.py new file mode 100644 index 000000000000..9b86682f02b3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_resource.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyResource(Model): + """The network resource topology information for the given resource group. + + :param name: Name of the resource. + :type name: str + :param id: ID of the resource. + :type id: str + :param location: Resource location. + :type location: str + :param associations: Holds the associations the resource has with other + resources in the resource group. + :type associations: + list[~azure.mgmt.network.v2018_01_01.models.TopologyAssociation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, + } + + def __init__(self, **kwargs): + super(TopologyResource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.associations = kwargs.get('associations', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_resource_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_resource_py3.py new file mode 100644 index 000000000000..c4685a0e8461 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/topology_resource_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TopologyResource(Model): + """The network resource topology information for the given resource group. + + :param name: Name of the resource. + :type name: str + :param id: ID of the resource. + :type id: str + :param location: Resource location. + :type location: str + :param associations: Holds the associations the resource has with other + resources in the resource group. + :type associations: + list[~azure.mgmt.network.v2018_01_01.models.TopologyAssociation] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, + } + + def __init__(self, *, name: str=None, id: str=None, location: str=None, associations=None, **kwargs) -> None: + super(TopologyResource, self).__init__(**kwargs) + self.name = name + self.id = id + self.location = location + self.associations = associations diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/traffic_analytics_configuration_properties.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/traffic_analytics_configuration_properties.py new file mode 100644 index 000000000000..07ec840d9ed3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/traffic_analytics_configuration_properties.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TrafficAnalyticsConfigurationProperties(Model): + """Parameters that define the configuration of traffic analytics. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Flag to enable/disable traffic analytics. + :type enabled: bool + :param workspace_id: Required. The resource guid of the attached workspace + :type workspace_id: str + :param workspace_region: Required. The location of the attached workspace + :type workspace_region: str + :param workspace_resource_id: Required. Resource Id of the attached + workspace + :type workspace_resource_id: str + """ + + _validation = { + 'enabled': {'required': True}, + 'workspace_id': {'required': True}, + 'workspace_region': {'required': True}, + 'workspace_resource_id': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'workspace_region': {'key': 'workspaceRegion', 'type': 'str'}, + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrafficAnalyticsConfigurationProperties, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.workspace_id = kwargs.get('workspace_id', None) + self.workspace_region = kwargs.get('workspace_region', None) + self.workspace_resource_id = kwargs.get('workspace_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/traffic_analytics_configuration_properties_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/traffic_analytics_configuration_properties_py3.py new file mode 100644 index 000000000000..bbc5ad2372c3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/traffic_analytics_configuration_properties_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TrafficAnalyticsConfigurationProperties(Model): + """Parameters that define the configuration of traffic analytics. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Flag to enable/disable traffic analytics. + :type enabled: bool + :param workspace_id: Required. The resource guid of the attached workspace + :type workspace_id: str + :param workspace_region: Required. The location of the attached workspace + :type workspace_region: str + :param workspace_resource_id: Required. Resource Id of the attached + workspace + :type workspace_resource_id: str + """ + + _validation = { + 'enabled': {'required': True}, + 'workspace_id': {'required': True}, + 'workspace_region': {'required': True}, + 'workspace_resource_id': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'workspace_region': {'key': 'workspaceRegion', 'type': 'str'}, + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool, workspace_id: str, workspace_region: str, workspace_resource_id: str, **kwargs) -> None: + super(TrafficAnalyticsConfigurationProperties, self).__init__(**kwargs) + self.enabled = enabled + self.workspace_id = workspace_id + self.workspace_region = workspace_region + self.workspace_resource_id = workspace_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_details.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_details.py new file mode 100644 index 000000000000..7e16c6e0a327 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_details.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingDetails(Model): + """Information gained from troubleshooting of specified resource. + + :param id: The id of the get troubleshoot operation. + :type id: str + :param reason_type: Reason type of failure. + :type reason_type: str + :param summary: A summary of troubleshooting. + :type summary: str + :param detail: Details on troubleshooting results. + :type detail: str + :param recommended_actions: List of recommended actions. + :type recommended_actions: + list[~azure.mgmt.network.v2018_01_01.models.TroubleshootingRecommendedActions] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'reason_type': {'key': 'reasonType', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'detail': {'key': 'detail', 'type': 'str'}, + 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, + } + + def __init__(self, **kwargs): + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.reason_type = kwargs.get('reason_type', None) + self.summary = kwargs.get('summary', None) + self.detail = kwargs.get('detail', None) + self.recommended_actions = kwargs.get('recommended_actions', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_details_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_details_py3.py new file mode 100644 index 000000000000..ea5c7f61c5aa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_details_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingDetails(Model): + """Information gained from troubleshooting of specified resource. + + :param id: The id of the get troubleshoot operation. + :type id: str + :param reason_type: Reason type of failure. + :type reason_type: str + :param summary: A summary of troubleshooting. + :type summary: str + :param detail: Details on troubleshooting results. + :type detail: str + :param recommended_actions: List of recommended actions. + :type recommended_actions: + list[~azure.mgmt.network.v2018_01_01.models.TroubleshootingRecommendedActions] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'reason_type': {'key': 'reasonType', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': 'str'}, + 'detail': {'key': 'detail', 'type': 'str'}, + 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, + } + + def __init__(self, *, id: str=None, reason_type: str=None, summary: str=None, detail: str=None, recommended_actions=None, **kwargs) -> None: + super(TroubleshootingDetails, self).__init__(**kwargs) + self.id = id + self.reason_type = reason_type + self.summary = summary + self.detail = detail + self.recommended_actions = recommended_actions diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_parameters.py new file mode 100644 index 000000000000..6b11d3eb5ffc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_parameters.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingParameters(Model): + """Parameters that define the resource to troubleshoot. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. + :type target_resource_id: str + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. + :type storage_id: str + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. + :type storage_path: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'storage_path': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.storage_id = kwargs.get('storage_id', None) + self.storage_path = kwargs.get('storage_path', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_parameters_py3.py new file mode 100644 index 000000000000..e010b7bdc9de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_parameters_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingParameters(Model): + """Parameters that define the resource to troubleshoot. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The target resource to troubleshoot. + :type target_resource_id: str + :param storage_id: Required. The ID for the storage account to save the + troubleshoot result. + :type storage_id: str + :param storage_path: Required. The path to the blob to save the + troubleshoot result in. + :type storage_path: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'storage_id': {'required': True}, + 'storage_path': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, + 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, storage_id: str, storage_path: str, **kwargs) -> None: + super(TroubleshootingParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.storage_id = storage_id + self.storage_path = storage_path diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_recommended_actions.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_recommended_actions.py new file mode 100644 index 000000000000..be395be4ad54 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_recommended_actions.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingRecommendedActions(Model): + """Recommended actions based on discovered issues. + + :param action_id: ID of the recommended action. + :type action_id: str + :param action_text: Description of recommended actions. + :type action_text: str + :param action_uri: The uri linking to a documentation for the recommended + troubleshooting actions. + :type action_uri: str + :param action_uri_text: The information from the URI for the recommended + troubleshooting actions. + :type action_uri_text: str + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'action_text': {'key': 'actionText', 'type': 'str'}, + 'action_uri': {'key': 'actionUri', 'type': 'str'}, + 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = kwargs.get('action_id', None) + self.action_text = kwargs.get('action_text', None) + self.action_uri = kwargs.get('action_uri', None) + self.action_uri_text = kwargs.get('action_uri_text', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_recommended_actions_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_recommended_actions_py3.py new file mode 100644 index 000000000000..05c3f654353b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_recommended_actions_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingRecommendedActions(Model): + """Recommended actions based on discovered issues. + + :param action_id: ID of the recommended action. + :type action_id: str + :param action_text: Description of recommended actions. + :type action_text: str + :param action_uri: The uri linking to a documentation for the recommended + troubleshooting actions. + :type action_uri: str + :param action_uri_text: The information from the URI for the recommended + troubleshooting actions. + :type action_uri_text: str + """ + + _attribute_map = { + 'action_id': {'key': 'actionId', 'type': 'str'}, + 'action_text': {'key': 'actionText', 'type': 'str'}, + 'action_uri': {'key': 'actionUri', 'type': 'str'}, + 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, + } + + def __init__(self, *, action_id: str=None, action_text: str=None, action_uri: str=None, action_uri_text: str=None, **kwargs) -> None: + super(TroubleshootingRecommendedActions, self).__init__(**kwargs) + self.action_id = action_id + self.action_text = action_text + self.action_uri = action_uri + self.action_uri_text = action_uri_text diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_result.py new file mode 100644 index 000000000000..06c813adb94e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_result.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingResult(Model): + """Troubleshooting information gained from specified resource. + + :param start_time: The start time of the troubleshooting. + :type start_time: datetime + :param end_time: The end time of the troubleshooting. + :type end_time: datetime + :param code: The result code of the troubleshooting. + :type code: str + :param results: Information from troubleshooting. + :type results: + list[~azure.mgmt.network.v2018_01_01.models.TroubleshootingDetails] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, + } + + def __init__(self, **kwargs): + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.code = kwargs.get('code', None) + self.results = kwargs.get('results', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_result_py3.py new file mode 100644 index 000000000000..4a04f7fd0259 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/troubleshooting_result_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TroubleshootingResult(Model): + """Troubleshooting information gained from specified resource. + + :param start_time: The start time of the troubleshooting. + :type start_time: datetime + :param end_time: The end time of the troubleshooting. + :type end_time: datetime + :param code: The result code of the troubleshooting. + :type code: str + :param results: Information from troubleshooting. + :type results: + list[~azure.mgmt.network.v2018_01_01.models.TroubleshootingDetails] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, + } + + def __init__(self, *, start_time=None, end_time=None, code: str=None, results=None, **kwargs) -> None: + super(TroubleshootingResult, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.code = code + self.results = results diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/tunnel_connection_health.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/tunnel_connection_health.py new file mode 100644 index 000000000000..5f120d16fb21 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/tunnel_connection_health.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TunnelConnectionHealth(Model): + """VirtualNetworkGatewayConnection properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tunnel: Tunnel name. + :vartype tunnel: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values include: 'Unknown', 'Connecting', 'Connected', + 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionStatus + :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this + connection + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: The Egress Bytes Transferred in this + connection + :vartype egress_bytes_transferred: long + :ivar last_connection_established_utc_time: The time at which connection + was established in Utc format. + :vartype last_connection_established_utc_time: str + """ + + _validation = { + 'tunnel': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'last_connection_established_utc_time': {'readonly': True}, + } + + _attribute_map = { + 'tunnel': {'key': 'tunnel', 'type': 'str'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TunnelConnectionHealth, self).__init__(**kwargs) + self.tunnel = None + self.connection_status = None + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.last_connection_established_utc_time = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/tunnel_connection_health_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/tunnel_connection_health_py3.py new file mode 100644 index 000000000000..5d3cb00d3a79 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/tunnel_connection_health_py3.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class TunnelConnectionHealth(Model): + """VirtualNetworkGatewayConnection properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tunnel: Tunnel name. + :vartype tunnel: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values include: 'Unknown', 'Connecting', 'Connected', + 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionStatus + :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this + connection + :vartype ingress_bytes_transferred: long + :ivar egress_bytes_transferred: The Egress Bytes Transferred in this + connection + :vartype egress_bytes_transferred: long + :ivar last_connection_established_utc_time: The time at which connection + was established in Utc format. + :vartype last_connection_established_utc_time: str + """ + + _validation = { + 'tunnel': {'readonly': True}, + 'connection_status': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'last_connection_established_utc_time': {'readonly': True}, + } + + _attribute_map = { + 'tunnel': {'key': 'tunnel', 'type': 'str'}, + 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, + 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, + 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, + 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TunnelConnectionHealth, self).__init__(**kwargs) + self.tunnel = None + self.connection_status = None + self.ingress_bytes_transferred = None + self.egress_bytes_transferred = None + self.last_connection_established_utc_time = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage.py new file mode 100644 index 000000000000..be77f6e664e7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes network resource usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource identifier. + :vartype id: str + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . + :vartype unit: str + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.network.v2018_01_01.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.id = None + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage_name.py new file mode 100644 index 000000000000..bd1813944fdc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage_name.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage_name_py3.py new file mode 100644 index 000000000000..4e5e3e10de15 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage_name_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class UsageName(Model): + """The usage names. + + :param value: A string describing the resource name. + :type value: str + :param localized_value: A localized string describing the resource name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage_paged.py new file mode 100644 index 000000000000..d11271e3bf64 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage_py3.py new file mode 100644 index 000000000000..9912f00ccf22 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/usage_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """Describes network resource usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource identifier. + :vartype id: str + :ivar unit: Required. An enum describing the unit of measurement. Default + value: "Count" . + :vartype unit: str + :param current_value: Required. The current value of the usage. + :type current_value: long + :param limit: Required. The limit of usage. + :type limit: long + :param name: Required. The name of the type of usage. + :type name: ~azure.mgmt.network.v2018_01_01.models.UsageName + """ + + _validation = { + 'id': {'readonly': True}, + 'unit': {'required': True, 'constant': True}, + 'current_value': {'required': True}, + 'limit': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + unit = "Count" + + def __init__(self, *, current_value: int, limit: int, name, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.id = None + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/verification_ip_flow_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/verification_ip_flow_parameters.py new file mode 100644 index 000000000000..34b495318f8a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/verification_ip_flow_parameters.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowParameters(Model): + """Parameters that define the IP flow to be verified. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. + :type target_resource_id: str + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' + :type direction: str or ~azure.mgmt.network.v2018_01_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' + :type protocol: str or ~azure.mgmt.network.v2018_01_01.models.Protocol + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type local_port: str + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type remote_port: str + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. + :type local_ip_address: str + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. + :type remote_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of them, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'local_port': {'required': True}, + 'remote_port': {'required': True}, + 'local_ip_address': {'required': True}, + 'remote_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = kwargs.get('target_resource_id', None) + self.direction = kwargs.get('direction', None) + self.protocol = kwargs.get('protocol', None) + self.local_port = kwargs.get('local_port', None) + self.remote_port = kwargs.get('remote_port', None) + self.local_ip_address = kwargs.get('local_ip_address', None) + self.remote_ip_address = kwargs.get('remote_ip_address', None) + self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/verification_ip_flow_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/verification_ip_flow_parameters_py3.py new file mode 100644 index 000000000000..b88f89e31ceb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/verification_ip_flow_parameters_py3.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowParameters(Model): + """Parameters that define the IP flow to be verified. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. The ID of the target resource to + perform next-hop on. + :type target_resource_id: str + :param direction: Required. The direction of the packet represented as a + 5-tuple. Possible values include: 'Inbound', 'Outbound' + :type direction: str or ~azure.mgmt.network.v2018_01_01.models.Direction + :param protocol: Required. Protocol to be verified on. Possible values + include: 'TCP', 'UDP' + :type protocol: str or ~azure.mgmt.network.v2018_01_01.models.Protocol + :param local_port: Required. The local port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type local_port: str + :param remote_port: Required. The remote port. Acceptable values are a + single integer in the range (0-65535). Support for * for the source port, + which depends on the direction. + :type remote_port: str + :param local_ip_address: Required. The local IP address. Acceptable values + are valid IPv4 addresses. + :type local_ip_address: str + :param remote_ip_address: Required. The remote IP address. Acceptable + values are valid IPv4 addresses. + :type remote_ip_address: str + :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP + forwarding is enabled on any of them, then this parameter must be + specified. Otherwise optional). + :type target_nic_resource_id: str + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'direction': {'required': True}, + 'protocol': {'required': True}, + 'local_port': {'required': True}, + 'remote_port': {'required': True}, + 'local_ip_address': {'required': True}, + 'remote_ip_address': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'local_port': {'key': 'localPort', 'type': 'str'}, + 'remote_port': {'key': 'remotePort', 'type': 'str'}, + 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, + 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, + 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str, direction, protocol, local_port: str, remote_port: str, local_ip_address: str, remote_ip_address: str, target_nic_resource_id: str=None, **kwargs) -> None: + super(VerificationIPFlowParameters, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.direction = direction + self.protocol = protocol + self.local_port = local_port + self.remote_port = remote_port + self.local_ip_address = local_ip_address + self.remote_ip_address = remote_ip_address + self.target_nic_resource_id = target_nic_resource_id diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/verification_ip_flow_result.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/verification_ip_flow_result.py new file mode 100644 index 000000000000..cd30c86e2898 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/verification_ip_flow_result.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowResult(Model): + """Results of IP flow verification on the target resource. + + :param access: Indicates whether the traffic is allowed or denied. + Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2018_01_01.models.Access + :param rule_name: Name of the rule. If input is not matched against any + security rule, it is not displayed. + :type rule_name: str + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.rule_name = kwargs.get('rule_name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/verification_ip_flow_result_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/verification_ip_flow_result_py3.py new file mode 100644 index 000000000000..20f4341a3ef1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/verification_ip_flow_result_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VerificationIPFlowResult(Model): + """Results of IP flow verification on the target resource. + + :param access: Indicates whether the traffic is allowed or denied. + Possible values include: 'Allow', 'Deny' + :type access: str or ~azure.mgmt.network.v2018_01_01.models.Access + :param rule_name: Name of the rule. If input is not matched against any + security rule, it is not displayed. + :type rule_name: str + """ + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + } + + def __init__(self, *, access=None, rule_name: str=None, **kwargs) -> None: + super(VerificationIPFlowResult, self).__init__(**kwargs) + self.access = access + self.rule_name = rule_name diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network.py new file mode 100644 index 000000000000..fc21ef7fbc7d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetwork(Resource): + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param address_space: The AddressSpace that contains an array of IP + address ranges that can be used by subnets. + :type address_space: ~azure.mgmt.network.v2018_01_01.models.AddressSpace + :param dhcp_options: The dhcpOptions that contains an array of DNS servers + available to VMs deployed in the virtual network. + :type dhcp_options: ~azure.mgmt.network.v2018_01_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2018_01_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeering] + :param resource_guid: The resourceGuid property of the Virtual Network + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param enable_ddos_protection: Indicates if DDoS protection is enabled for + all the protected resources in a Virtual Network. + :type enable_ddos_protection: bool + :param enable_vm_protection: Indicates if Vm protection is enabled for all + the subnets in a Virtual Network. + :type enable_vm_protection: bool + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'enable_ddos_protection': {'key': 'properties.enableDdosProtection', 'type': 'bool'}, + 'enable_vm_protection': {'key': 'properties.enableVmProtection', 'type': 'bool'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetwork, self).__init__(**kwargs) + self.address_space = kwargs.get('address_space', None) + self.dhcp_options = kwargs.get('dhcp_options', None) + self.subnets = kwargs.get('subnets', None) + self.virtual_network_peerings = kwargs.get('virtual_network_peerings', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.enable_ddos_protection = kwargs.get('enable_ddos_protection', None) + self.enable_vm_protection = kwargs.get('enable_vm_protection', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_connection_gateway_reference.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_connection_gateway_reference.py new file mode 100644 index 000000000000..aa10101778f6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_connection_gateway_reference.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkConnectionGatewayReference(Model): + """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or + LocalNetworkGateway resource. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_connection_gateway_reference_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_connection_gateway_reference_py3.py new file mode 100644 index 000000000000..b2d9734baf3c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_connection_gateway_reference_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkConnectionGatewayReference(Model): + """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of VirtualNetworkGateway or + LocalNetworkGateway resource. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway.py new file mode 100644 index 000000000000..ad0bffe032f3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param ip_configurations: IP configurations for virtual network gateway. + :type ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible + values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', + 'ExpressRoute' + :type gateway_type: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayType + :param vpn_type: The type of this virtual network gateway. Possible values + are: 'PolicyBased' and 'RouteBased'. Possible values include: + 'PolicyBased', 'RouteBased' + :type vpn_type: str or ~azure.mgmt.network.v2018_01_01.models.VpnType + :param enable_bgp: Whether BGP is enabled for this virtual network gateway + or not. + :type enable_bgp: bool + :param active_active: ActiveActive flag + :type active_active: bool + :param gateway_default_site: The reference of the LocalNetworkGateway + resource which represents local network site having default routes. Assign + Null value in case of removing existing default site setting. + :type gateway_default_site: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param sku: The reference of the VirtualNetworkGatewaySku resource which + represents the SKU selected for Virtual network gateway. + :type sku: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewaySku + :param vpn_client_configuration: The reference of the + VpnClientConfiguration resource which represents the P2S VpnClient + configurations. + :type vpn_client_configuration: + ~azure.mgmt.network.v2018_01_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2018_01_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + VirtualNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGateway resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, + 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, + 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'active_active': {'key': 'properties.activeActive', 'type': 'bool'}, + 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, + 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, + 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkGateway, self).__init__(**kwargs) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.gateway_type = kwargs.get('gateway_type', None) + self.vpn_type = kwargs.get('vpn_type', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.active_active = kwargs.get('active_active', None) + self.gateway_default_site = kwargs.get('gateway_default_site', None) + self.sku = kwargs.get('sku', None) + self.vpn_client_configuration = kwargs.get('vpn_client_configuration', None) + self.bgp_settings = kwargs.get('bgp_settings', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = None + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection.py new file mode 100644 index 000000000000..3227e58d8863 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnection(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2018_01_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2018_01_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnection, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = None + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_list_entity.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_list_entity.py new file mode 100644 index 000000000000..bbef0f52441c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_list_entity.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnectionListEntity(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkConnectionGatewayReference + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkConnectionGatewayReference + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkConnectionGatewayReference + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2018_01_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2018_01_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(**kwargs) + self.authorization_key = kwargs.get('authorization_key', None) + self.virtual_network_gateway1 = kwargs.get('virtual_network_gateway1', None) + self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) + self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) + self.connection_type = kwargs.get('connection_type', None) + self.routing_weight = kwargs.get('routing_weight', None) + self.shared_key = kwargs.get('shared_key', None) + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = kwargs.get('peer', None) + self.enable_bgp = kwargs.get('enable_bgp', None) + self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) + self.ipsec_policies = kwargs.get('ipsec_policies', None) + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = None + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_list_entity_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_list_entity_paged.py new file mode 100644 index 000000000000..c2100c28c151 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_list_entity_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class VirtualNetworkGatewayConnectionListEntityPaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualNetworkGatewayConnectionListEntity ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualNetworkGatewayConnectionListEntity]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualNetworkGatewayConnectionListEntityPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_list_entity_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_list_entity_py3.py new file mode 100644 index 000000000000..55474b39f1f4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_list_entity_py3.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnectionListEntity(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkConnectionGatewayReference + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkConnectionGatewayReference + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkConnectionGatewayReference + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2018_01_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2018_01_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, use_policy_based_traffic_selectors: bool=None, ipsec_policies=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnectionListEntity, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_paged.py new file mode 100644 index 000000000000..9f10576e7373 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class VirtualNetworkGatewayConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualNetworkGatewayConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualNetworkGatewayConnection]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualNetworkGatewayConnectionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_py3.py new file mode 100644 index 000000000000..8ca726b23d7d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_connection_py3.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGatewayConnection(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param authorization_key: The authorizationKey. + :type authorization_key: str + :param virtual_network_gateway1: Required. The reference to virtual + network gateway resource. + :type virtual_network_gateway1: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway + :param virtual_network_gateway2: The reference to virtual network gateway + resource. + :type virtual_network_gateway2: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway + :param local_network_gateway2: The reference to local network gateway + resource. + :type local_network_gateway2: + ~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway + :param connection_type: Required. Gateway connection type. Possible values + are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values + include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' + :type connection_type: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionType + :param routing_weight: The routing weight. + :type routing_weight: int + :param shared_key: The IPSec shared key. + :type shared_key: str + :ivar connection_status: Virtual network Gateway connection status. + Possible values are 'Unknown', 'Connecting', 'Connected' and + 'NotConnected'. Possible values include: 'Unknown', 'Connecting', + 'Connected', 'NotConnected' + :vartype connection_status: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionStatus + :ivar tunnel_connection_status: Collection of all tunnels' connection + health status. + :vartype tunnel_connection_status: + list[~azure.mgmt.network.v2018_01_01.models.TunnelConnectionHealth] + :ivar egress_bytes_transferred: The egress bytes transferred in this + connection. + :vartype egress_bytes_transferred: long + :ivar ingress_bytes_transferred: The ingress bytes transferred in this + connection. + :vartype ingress_bytes_transferred: long + :param peer: The reference to peerings resource. + :type peer: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param enable_bgp: EnableBgp flag + :type enable_bgp: bool + :param use_policy_based_traffic_selectors: Enable policy-based traffic + selectors. + :type use_policy_based_traffic_selectors: bool + :param ipsec_policies: The IPSec Policies to be considered by this + connection. + :type ipsec_policies: + list[~azure.mgmt.network.v2018_01_01.models.IpsecPolicy] + :param resource_guid: The resource GUID property of the + VirtualNetworkGatewayConnection resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_gateway1': {'required': True}, + 'connection_type': {'required': True}, + 'connection_status': {'readonly': True}, + 'tunnel_connection_status': {'readonly': True}, + 'egress_bytes_transferred': {'readonly': True}, + 'ingress_bytes_transferred': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, + 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, + 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, + 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, + 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, + 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, + 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, + 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, + 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, + 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, + 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, + 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_gateway1, connection_type, id: str=None, location: str=None, tags=None, authorization_key: str=None, virtual_network_gateway2=None, local_network_gateway2=None, routing_weight: int=None, shared_key: str=None, peer=None, enable_bgp: bool=None, use_policy_based_traffic_selectors: bool=None, ipsec_policies=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.authorization_key = authorization_key + self.virtual_network_gateway1 = virtual_network_gateway1 + self.virtual_network_gateway2 = virtual_network_gateway2 + self.local_network_gateway2 = local_network_gateway2 + self.connection_type = connection_type + self.routing_weight = routing_weight + self.shared_key = shared_key + self.connection_status = None + self.tunnel_connection_status = None + self.egress_bytes_transferred = None + self.ingress_bytes_transferred = None + self.peer = peer + self.enable_bgp = enable_bgp + self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors + self.ipsec_policies = ipsec_policies + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_ip_configuration.py new file mode 100644 index 000000000000..df5486bb72a3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_ip_configuration.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2018_01_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :ivar provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkGatewayIPConfiguration, self).__init__(**kwargs) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = None + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_ip_configuration_py3.py new file mode 100644 index 000000000000..8ad876ec15d3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_ip_configuration_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkGatewayIPConfiguration(SubResource): + """IP configuration for virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param private_ip_allocation_method: The private IP allocation method. + Possible values are: 'Static' and 'Dynamic'. Possible values include: + 'Static', 'Dynamic' + :type private_ip_allocation_method: str or + ~azure.mgmt.network.v2018_01_01.models.IPAllocationMethod + :param subnet: The reference of the subnet resource. + :type subnet: ~azure.mgmt.network.v2018_01_01.models.SubResource + :param public_ip_address: The reference of the public IP resource. + :type public_ip_address: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :ivar provisioning_state: The provisioning state of the public IP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.public_ip_address = public_ip_address + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_paged.py new file mode 100644 index 000000000000..f6e40c06019b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class VirtualNetworkGatewayPaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualNetworkGateway ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualNetworkGateway]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualNetworkGatewayPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_py3.py new file mode 100644 index 000000000000..14e9d661343a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_py3.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetworkGateway(Resource): + """A common class for general resource information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param ip_configurations: IP configurations for virtual network gateway. + :type ip_configurations: + list[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayIPConfiguration] + :param gateway_type: The type of this virtual network gateway. Possible + values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'Vpn', + 'ExpressRoute' + :type gateway_type: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayType + :param vpn_type: The type of this virtual network gateway. Possible values + are: 'PolicyBased' and 'RouteBased'. Possible values include: + 'PolicyBased', 'RouteBased' + :type vpn_type: str or ~azure.mgmt.network.v2018_01_01.models.VpnType + :param enable_bgp: Whether BGP is enabled for this virtual network gateway + or not. + :type enable_bgp: bool + :param active_active: ActiveActive flag + :type active_active: bool + :param gateway_default_site: The reference of the LocalNetworkGateway + resource which represents local network site having default routes. Assign + Null value in case of removing existing default site setting. + :type gateway_default_site: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param sku: The reference of the VirtualNetworkGatewaySku resource which + represents the SKU selected for Virtual network gateway. + :type sku: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewaySku + :param vpn_client_configuration: The reference of the + VpnClientConfiguration resource which represents the P2S VpnClient + configurations. + :type vpn_client_configuration: + ~azure.mgmt.network.v2018_01_01.models.VpnClientConfiguration + :param bgp_settings: Virtual network gateway's BGP speaker settings. + :type bgp_settings: ~azure.mgmt.network.v2018_01_01.models.BgpSettings + :param resource_guid: The resource GUID property of the + VirtualNetworkGateway resource. + :type resource_guid: str + :ivar provisioning_state: The provisioning state of the + VirtualNetworkGateway resource. Possible values are: 'Updating', + 'Deleting', and 'Failed'. + :vartype provisioning_state: str + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, + 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, + 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, + 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, + 'active_active': {'key': 'properties.activeActive', 'type': 'bool'}, + 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, + 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, + 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, + 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, ip_configurations=None, gateway_type=None, vpn_type=None, enable_bgp: bool=None, active_active: bool=None, gateway_default_site=None, sku=None, vpn_client_configuration=None, bgp_settings=None, resource_guid: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.ip_configurations = ip_configurations + self.gateway_type = gateway_type + self.vpn_type = vpn_type + self.enable_bgp = enable_bgp + self.active_active = active_active + self.gateway_default_site = gateway_default_site + self.sku = sku + self.vpn_client_configuration = vpn_client_configuration + self.bgp_settings = bgp_settings + self.resource_guid = resource_guid + self.provisioning_state = None + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_sku.py new file mode 100644 index 000000000000..1806945d98b8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_sku.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkGatewaySku(Model): + """VirtualNetworkGatewaySku details. + + :param name: Gateway SKU name. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type name: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewaySkuName + :param tier: Gateway SKU tier. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type tier: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewaySkuTier + :param capacity: The capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_sku_py3.py new file mode 100644 index 000000000000..b22b59707e9b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_gateway_sku_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkGatewaySku(Model): + """VirtualNetworkGatewaySku details. + + :param name: Gateway SKU name. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type name: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewaySkuName + :param tier: Gateway SKU tier. Possible values include: 'Basic', + 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', 'VpnGw2', + 'VpnGw3' + :type tier: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewaySkuTier + :param capacity: The capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name=None, tier=None, capacity: int=None, **kwargs) -> None: + super(VirtualNetworkGatewaySku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_paged.py new file mode 100644 index 000000000000..bf4fedfab341 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class VirtualNetworkPaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualNetwork ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualNetwork]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualNetworkPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_peering.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_peering.py new file mode 100644 index 000000000000..edc8342d46dc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_peering.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkPeering(SubResource): + """Peerings in a virtual network resource. + + :param id: Resource ID. + :type id: str + :param allow_virtual_network_access: Whether the VMs in the linked virtual + network space would be able to access all the VMs in local Virtual network + space. + :type allow_virtual_network_access: bool + :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs + in the remote virtual network will be allowed/disallowed. + :type allow_forwarded_traffic: bool + :param allow_gateway_transit: If gateway links can be used in remote + virtual networking to link to this virtual network. + :type allow_gateway_transit: bool + :param use_remote_gateways: If remote gateways can be used on this virtual + network. If the flag is set to true, and allowGatewayTransit on remote + peering is also true, virtual network will use gateways of remote virtual + network for transit. Only one peering can have this flag set to true. This + flag cannot be set if virtual network already has a gateway. + :type use_remote_gateways: bool + :param remote_virtual_network: The reference of the remote virtual + network. The remote virtual network can be in the same or different region + (preview). See here to register for the preview and learn more + (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + :type remote_virtual_network: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param remote_address_space: The reference of the remote virtual network + address space. + :type remote_address_space: + ~azure.mgmt.network.v2018_01_01.models.AddressSpace + :param peering_state: The status of the virtual network peering. Possible + values are 'Initiated', 'Connected', and 'Disconnected'. Possible values + include: 'Initiated', 'Connected', 'Disconnected' + :type peering_state: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeeringState + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, + 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, + 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, + 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'remote_address_space': {'key': 'properties.remoteAddressSpace', 'type': 'AddressSpace'}, + 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkPeering, self).__init__(**kwargs) + self.allow_virtual_network_access = kwargs.get('allow_virtual_network_access', None) + self.allow_forwarded_traffic = kwargs.get('allow_forwarded_traffic', None) + self.allow_gateway_transit = kwargs.get('allow_gateway_transit', None) + self.use_remote_gateways = kwargs.get('use_remote_gateways', None) + self.remote_virtual_network = kwargs.get('remote_virtual_network', None) + self.remote_address_space = kwargs.get('remote_address_space', None) + self.peering_state = kwargs.get('peering_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_peering_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_peering_paged.py new file mode 100644 index 000000000000..f05d1cc58e0b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_peering_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class VirtualNetworkPeeringPaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualNetworkPeering ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualNetworkPeering]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualNetworkPeeringPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_peering_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_peering_py3.py new file mode 100644 index 000000000000..05b85fa7637b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_peering_py3.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VirtualNetworkPeering(SubResource): + """Peerings in a virtual network resource. + + :param id: Resource ID. + :type id: str + :param allow_virtual_network_access: Whether the VMs in the linked virtual + network space would be able to access all the VMs in local Virtual network + space. + :type allow_virtual_network_access: bool + :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs + in the remote virtual network will be allowed/disallowed. + :type allow_forwarded_traffic: bool + :param allow_gateway_transit: If gateway links can be used in remote + virtual networking to link to this virtual network. + :type allow_gateway_transit: bool + :param use_remote_gateways: If remote gateways can be used on this virtual + network. If the flag is set to true, and allowGatewayTransit on remote + peering is also true, virtual network will use gateways of remote virtual + network for transit. Only one peering can have this flag set to true. This + flag cannot be set if virtual network already has a gateway. + :type use_remote_gateways: bool + :param remote_virtual_network: The reference of the remote virtual + network. The remote virtual network can be in the same or different region + (preview). See here to register for the preview and learn more + (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). + :type remote_virtual_network: + ~azure.mgmt.network.v2018_01_01.models.SubResource + :param remote_address_space: The reference of the remote virtual network + address space. + :type remote_address_space: + ~azure.mgmt.network.v2018_01_01.models.AddressSpace + :param peering_state: The status of the virtual network peering. Possible + values are 'Initiated', 'Connected', and 'Disconnected'. Possible values + include: 'Initiated', 'Connected', 'Disconnected' + :type peering_state: str or + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeeringState + :param provisioning_state: The provisioning state of the resource. + :type provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, + 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, + 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, + 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, + 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, + 'remote_address_space': {'key': 'properties.remoteAddressSpace', 'type': 'AddressSpace'}, + 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, allow_virtual_network_access: bool=None, allow_forwarded_traffic: bool=None, allow_gateway_transit: bool=None, use_remote_gateways: bool=None, remote_virtual_network=None, remote_address_space=None, peering_state=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VirtualNetworkPeering, self).__init__(id=id, **kwargs) + self.allow_virtual_network_access = allow_virtual_network_access + self.allow_forwarded_traffic = allow_forwarded_traffic + self.allow_gateway_transit = allow_gateway_transit + self.use_remote_gateways = use_remote_gateways + self.remote_virtual_network = remote_virtual_network + self.remote_address_space = remote_address_space + self.peering_state = peering_state + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_py3.py new file mode 100644 index 000000000000..b6b6ca6a815c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class VirtualNetwork(Resource): + """Virtual Network resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param address_space: The AddressSpace that contains an array of IP + address ranges that can be used by subnets. + :type address_space: ~azure.mgmt.network.v2018_01_01.models.AddressSpace + :param dhcp_options: The dhcpOptions that contains an array of DNS servers + available to VMs deployed in the virtual network. + :type dhcp_options: ~azure.mgmt.network.v2018_01_01.models.DhcpOptions + :param subnets: A list of subnets in a Virtual Network. + :type subnets: list[~azure.mgmt.network.v2018_01_01.models.Subnet] + :param virtual_network_peerings: A list of peerings in a Virtual Network. + :type virtual_network_peerings: + list[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeering] + :param resource_guid: The resourceGuid property of the Virtual Network + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the PublicIP + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param enable_ddos_protection: Indicates if DDoS protection is enabled for + all the protected resources in a Virtual Network. + :type enable_ddos_protection: bool + :param enable_vm_protection: Indicates if Vm protection is enabled for all + the subnets in a Virtual Network. + :type enable_vm_protection: bool + :param etag: Gets a unique read-only string that changes whenever the + resource is updated. + :type etag: str + """ + + _validation = { + '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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, + 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, + 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, + 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'enable_ddos_protection': {'key': 'properties.enableDdosProtection', 'type': 'bool'}, + 'enable_vm_protection': {'key': 'properties.enableVmProtection', 'type': 'bool'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, address_space=None, dhcp_options=None, subnets=None, virtual_network_peerings=None, resource_guid: str=None, provisioning_state: str=None, enable_ddos_protection: bool=None, enable_vm_protection: bool=None, etag: str=None, **kwargs) -> None: + super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.address_space = address_space + self.dhcp_options = dhcp_options + self.subnets = subnets + self.virtual_network_peerings = virtual_network_peerings + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.enable_ddos_protection = enable_ddos_protection + self.enable_vm_protection = enable_vm_protection + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage.py new file mode 100644 index 000000000000..3cf06b4ce1ca --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsage(Model): + """Usage details for subnet. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar current_value: Indicates number of IPs used from the Subnet. + :vartype current_value: float + :ivar id: Subnet identifier. + :vartype id: str + :ivar limit: Indicates the size of the subnet. + :vartype limit: float + :ivar name: The name containing common and localized value for usage. + :vartype name: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkUsageName + :ivar unit: Usage units. Returns 'Count' + :vartype unit: str + """ + + _validation = { + 'current_value': {'readonly': True}, + 'id': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'name': {'key': 'name', 'type': 'VirtualNetworkUsageName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkUsage, self).__init__(**kwargs) + self.current_value = None + self.id = None + self.limit = None + self.name = None + self.unit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage_name.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage_name.py new file mode 100644 index 000000000000..607ccec3b964 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage_name.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsageName(Model): + """Usage strings container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar localized_value: Localized subnet size and usage string. + :vartype localized_value: str + :ivar value: Subnet size and usage string. + :vartype value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkUsageName, self).__init__(**kwargs) + self.localized_value = None + self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage_name_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage_name_py3.py new file mode 100644 index 000000000000..1651ebda7e77 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage_name_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsageName(Model): + """Usage strings container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar localized_value: Localized subnet size and usage string. + :vartype localized_value: str + :ivar value: Subnet size and usage string. + :vartype value: str + """ + + _validation = { + 'localized_value': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsageName, self).__init__(**kwargs) + self.localized_value = None + self.value = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage_paged.py new file mode 100644 index 000000000000..902ffa5bdc78 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class VirtualNetworkUsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualNetworkUsage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualNetworkUsage]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualNetworkUsagePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage_py3.py new file mode 100644 index 000000000000..97ad6cead97f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/virtual_network_usage_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkUsage(Model): + """Usage details for subnet. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar current_value: Indicates number of IPs used from the Subnet. + :vartype current_value: float + :ivar id: Subnet identifier. + :vartype id: str + :ivar limit: Indicates the size of the subnet. + :vartype limit: float + :ivar name: The name containing common and localized value for usage. + :vartype name: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkUsageName + :ivar unit: Usage units. Returns 'Count' + :vartype unit: str + """ + + _validation = { + 'current_value': {'readonly': True}, + 'id': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + 'unit': {'readonly': True}, + } + + _attribute_map = { + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'id': {'key': 'id', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'name': {'key': 'name', 'type': 'VirtualNetworkUsageName'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualNetworkUsage, self).__init__(**kwargs) + self.current_value = None + self.id = None + self.limit = None + self.name = None + self.unit = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_configuration.py new file mode 100644 index 000000000000..65ff34ea1143 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_configuration.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientConfiguration(Model): + """VpnClientConfiguration for P2S client. + + :param vpn_client_address_pool: The reference of the address space + resource which represents Address space for P2S VpnClient. + :type vpn_client_address_pool: + ~azure.mgmt.network.v2018_01_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual + network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2018_01_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for + Virtual network gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2018_01_01.models.VpnClientRevokedCertificate] + :param vpn_client_protocols: VpnClientProtocols for Virtual network + gateway. + :type vpn_client_protocols: list[str or + ~azure.mgmt.network.v2018_01_01.models.VpnClientProtocol] + :param radius_server_address: The radius server address property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_address: str + :param radius_server_secret: The radius secret property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_secret: str + """ + + _attribute_map = { + 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, + 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, + 'vpn_client_protocols': {'key': 'vpnClientProtocols', 'type': '[str]'}, + 'radius_server_address': {'key': 'radiusServerAddress', 'type': 'str'}, + 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = kwargs.get('vpn_client_address_pool', None) + self.vpn_client_root_certificates = kwargs.get('vpn_client_root_certificates', None) + self.vpn_client_revoked_certificates = kwargs.get('vpn_client_revoked_certificates', None) + self.vpn_client_protocols = kwargs.get('vpn_client_protocols', None) + self.radius_server_address = kwargs.get('radius_server_address', None) + self.radius_server_secret = kwargs.get('radius_server_secret', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_configuration_py3.py new file mode 100644 index 000000000000..7deb2bdb5615 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_configuration_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientConfiguration(Model): + """VpnClientConfiguration for P2S client. + + :param vpn_client_address_pool: The reference of the address space + resource which represents Address space for P2S VpnClient. + :type vpn_client_address_pool: + ~azure.mgmt.network.v2018_01_01.models.AddressSpace + :param vpn_client_root_certificates: VpnClientRootCertificate for virtual + network gateway. + :type vpn_client_root_certificates: + list[~azure.mgmt.network.v2018_01_01.models.VpnClientRootCertificate] + :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for + Virtual network gateway. + :type vpn_client_revoked_certificates: + list[~azure.mgmt.network.v2018_01_01.models.VpnClientRevokedCertificate] + :param vpn_client_protocols: VpnClientProtocols for Virtual network + gateway. + :type vpn_client_protocols: list[str or + ~azure.mgmt.network.v2018_01_01.models.VpnClientProtocol] + :param radius_server_address: The radius server address property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_address: str + :param radius_server_secret: The radius secret property of the + VirtualNetworkGateway resource for vpn client connection. + :type radius_server_secret: str + """ + + _attribute_map = { + 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, + 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, + 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, + 'vpn_client_protocols': {'key': 'vpnClientProtocols', 'type': '[str]'}, + 'radius_server_address': {'key': 'radiusServerAddress', 'type': 'str'}, + 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, + } + + def __init__(self, *, vpn_client_address_pool=None, vpn_client_root_certificates=None, vpn_client_revoked_certificates=None, vpn_client_protocols=None, radius_server_address: str=None, radius_server_secret: str=None, **kwargs) -> None: + super(VpnClientConfiguration, self).__init__(**kwargs) + self.vpn_client_address_pool = vpn_client_address_pool + self.vpn_client_root_certificates = vpn_client_root_certificates + self.vpn_client_revoked_certificates = vpn_client_revoked_certificates + self.vpn_client_protocols = vpn_client_protocols + self.radius_server_address = radius_server_address + self.radius_server_secret = radius_server_secret diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_parameters.py new file mode 100644 index 000000000000..8f389a22a021 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_parameters.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientParameters(Model): + """Vpn Client Parameters for package generation. + + :param processor_architecture: VPN client Processor Architecture. Possible + values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' + :type processor_architecture: str or + ~azure.mgmt.network.v2018_01_01.models.ProcessorArchitecture + :param authentication_method: VPN client Authentication Method. Possible + values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', + 'EAPMSCHAPv2' + :type authentication_method: str or + ~azure.mgmt.network.v2018_01_01.models.AuthenticationMethod + :param radius_server_auth_certificate: The public certificate data for the + radius server authentication certificate as a Base-64 encoded string. + Required only if external radius authentication has been configured with + EAPTLS authentication. + :type radius_server_auth_certificate: str + :param client_root_certificates: A list of client root certificates public + certificate data encoded as Base-64 strings. Optional parameter for + external radius based authentication with EAPTLS. + :type client_root_certificates: list[str] + """ + + _attribute_map = { + 'processor_architecture': {'key': 'processorArchitecture', 'type': 'str'}, + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + 'radius_server_auth_certificate': {'key': 'radiusServerAuthCertificate', 'type': 'str'}, + 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = kwargs.get('processor_architecture', None) + self.authentication_method = kwargs.get('authentication_method', None) + self.radius_server_auth_certificate = kwargs.get('radius_server_auth_certificate', None) + self.client_root_certificates = kwargs.get('client_root_certificates', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_parameters_py3.py new file mode 100644 index 000000000000..a10a78c3bcc2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_parameters_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnClientParameters(Model): + """Vpn Client Parameters for package generation. + + :param processor_architecture: VPN client Processor Architecture. Possible + values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' + :type processor_architecture: str or + ~azure.mgmt.network.v2018_01_01.models.ProcessorArchitecture + :param authentication_method: VPN client Authentication Method. Possible + values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', + 'EAPMSCHAPv2' + :type authentication_method: str or + ~azure.mgmt.network.v2018_01_01.models.AuthenticationMethod + :param radius_server_auth_certificate: The public certificate data for the + radius server authentication certificate as a Base-64 encoded string. + Required only if external radius authentication has been configured with + EAPTLS authentication. + :type radius_server_auth_certificate: str + :param client_root_certificates: A list of client root certificates public + certificate data encoded as Base-64 strings. Optional parameter for + external radius based authentication with EAPTLS. + :type client_root_certificates: list[str] + """ + + _attribute_map = { + 'processor_architecture': {'key': 'processorArchitecture', 'type': 'str'}, + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + 'radius_server_auth_certificate': {'key': 'radiusServerAuthCertificate', 'type': 'str'}, + 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, + } + + def __init__(self, *, processor_architecture=None, authentication_method=None, radius_server_auth_certificate: str=None, client_root_certificates=None, **kwargs) -> None: + super(VpnClientParameters, self).__init__(**kwargs) + self.processor_architecture = processor_architecture + self.authentication_method = authentication_method + self.radius_server_auth_certificate = radius_server_auth_certificate + self.client_root_certificates = client_root_certificates diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_revoked_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_revoked_certificate.py new file mode 100644 index 000000000000..1fa6f6a1ef23 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_revoked_certificate.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + :ivar provisioning_state: The provisioning state of the VPN client revoked + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VpnClientRevokedCertificate, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) + self.provisioning_state = None + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_revoked_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_revoked_certificate_py3.py new file mode 100644 index 000000000000..7c1e05f283a5 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_revoked_certificate_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRevokedCertificate(SubResource): + """VPN client revoked certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param thumbprint: The revoked VPN client certificate thumbprint. + :type thumbprint: str + :ivar provisioning_state: The provisioning state of the VPN client revoked + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, thumbprint: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRevokedCertificate, self).__init__(id=id, **kwargs) + self.thumbprint = thumbprint + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_root_certificate.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_root_certificate.py new file mode 100644 index 000000000000..48c7033d42ec --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_root_certificate.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param public_cert_data: Required. The certificate public data. + :type public_cert_data: str + :ivar provisioning_state: The provisioning state of the VPN client root + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'public_cert_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VpnClientRootCertificate, self).__init__(**kwargs) + self.public_cert_data = kwargs.get('public_cert_data', None) + self.provisioning_state = None + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_root_certificate_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_root_certificate_py3.py new file mode 100644 index 000000000000..db8a1e547705 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_client_root_certificate_py3.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sub_resource import SubResource + + +class VpnClientRootCertificate(SubResource): + """VPN client root certificate of virtual network gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Resource ID. + :type id: str + :param public_cert_data: Required. The certificate public data. + :type public_cert_data: str + :ivar provisioning_state: The provisioning state of the VPN client root + certificate resource. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :vartype provisioning_state: str + :param name: The name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _validation = { + 'public_cert_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, public_cert_data: str, id: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(VpnClientRootCertificate, self).__init__(id=id, **kwargs) + self.public_cert_data = public_cert_data + self.provisioning_state = None + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_device_script_parameters.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_device_script_parameters.py new file mode 100644 index 000000000000..e4f8f12701b7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_device_script_parameters.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnDeviceScriptParameters(Model): + """Vpn device configuration script generation parameters. + + :param vendor: The vendor for the vpn device. + :type vendor: str + :param device_family: The device family for the vpn device. + :type device_family: str + :param firmware_version: The firmware version for the vpn device. + :type firmware_version: str + """ + + _attribute_map = { + 'vendor': {'key': 'vendor', 'type': 'str'}, + 'device_family': {'key': 'deviceFamily', 'type': 'str'}, + 'firmware_version': {'key': 'firmwareVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VpnDeviceScriptParameters, self).__init__(**kwargs) + self.vendor = kwargs.get('vendor', None) + self.device_family = kwargs.get('device_family', None) + self.firmware_version = kwargs.get('firmware_version', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_device_script_parameters_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_device_script_parameters_py3.py new file mode 100644 index 000000000000..e5520ffb5a18 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/vpn_device_script_parameters_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VpnDeviceScriptParameters(Model): + """Vpn device configuration script generation parameters. + + :param vendor: The vendor for the vpn device. + :type vendor: str + :param device_family: The device family for the vpn device. + :type device_family: str + :param firmware_version: The firmware version for the vpn device. + :type firmware_version: str + """ + + _attribute_map = { + 'vendor': {'key': 'vendor', 'type': 'str'}, + 'device_family': {'key': 'deviceFamily', 'type': 'str'}, + 'firmware_version': {'key': 'firmwareVersion', 'type': 'str'}, + } + + def __init__(self, *, vendor: str=None, device_family: str=None, firmware_version: str=None, **kwargs) -> None: + super(VpnDeviceScriptParameters, self).__init__(**kwargs) + self.vendor = vendor + self.device_family = device_family + self.firmware_version = firmware_version diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/network_management_client.py new file mode 100644 index 000000000000..398496371570 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/network_management_client.py @@ -0,0 +1,337 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import ServiceClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling +import uuid +from .operations.application_gateways_operations import ApplicationGatewaysOperations +from .operations.application_security_groups_operations import ApplicationSecurityGroupsOperations +from .operations.available_endpoint_services_operations import AvailableEndpointServicesOperations +from .operations.express_route_circuit_authorizations_operations import ExpressRouteCircuitAuthorizationsOperations +from .operations.express_route_circuit_peerings_operations import ExpressRouteCircuitPeeringsOperations +from .operations.express_route_circuits_operations import ExpressRouteCircuitsOperations +from .operations.express_route_service_providers_operations import ExpressRouteServiceProvidersOperations +from .operations.load_balancers_operations import LoadBalancersOperations +from .operations.load_balancer_backend_address_pools_operations import LoadBalancerBackendAddressPoolsOperations +from .operations.load_balancer_frontend_ip_configurations_operations import LoadBalancerFrontendIPConfigurationsOperations +from .operations.inbound_nat_rules_operations import InboundNatRulesOperations +from .operations.load_balancer_load_balancing_rules_operations import LoadBalancerLoadBalancingRulesOperations +from .operations.load_balancer_network_interfaces_operations import LoadBalancerNetworkInterfacesOperations +from .operations.load_balancer_probes_operations import LoadBalancerProbesOperations +from .operations.network_interfaces_operations import NetworkInterfacesOperations +from .operations.network_interface_ip_configurations_operations import NetworkInterfaceIPConfigurationsOperations +from .operations.network_interface_load_balancers_operations import NetworkInterfaceLoadBalancersOperations +from .operations.network_security_groups_operations import NetworkSecurityGroupsOperations +from .operations.security_rules_operations import SecurityRulesOperations +from .operations.default_security_rules_operations import DefaultSecurityRulesOperations +from .operations.network_watchers_operations import NetworkWatchersOperations +from .operations.packet_captures_operations import PacketCapturesOperations +from .operations.connection_monitors_operations import ConnectionMonitorsOperations +from .operations.operations import Operations +from .operations.public_ip_addresses_operations import PublicIPAddressesOperations +from .operations.route_filters_operations import RouteFiltersOperations +from .operations.route_filter_rules_operations import RouteFilterRulesOperations +from .operations.route_tables_operations import RouteTablesOperations +from .operations.routes_operations import RoutesOperations +from .operations.bgp_service_communities_operations import BgpServiceCommunitiesOperations +from .operations.usages_operations import UsagesOperations +from .operations.virtual_networks_operations import VirtualNetworksOperations +from .operations.subnets_operations import SubnetsOperations +from .operations.virtual_network_peerings_operations import VirtualNetworkPeeringsOperations +from .operations.virtual_network_gateways_operations import VirtualNetworkGatewaysOperations +from .operations.virtual_network_gateway_connections_operations import VirtualNetworkGatewayConnectionsOperations +from .operations.local_network_gateways_operations import LocalNetworkGatewaysOperations +from . import models + + +class NetworkManagementClientConfiguration(AzureConfiguration): + """Configuration for NetworkManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription credentials which uniquely + identify the Microsoft Azure subscription. The subscription ID forms part + of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(NetworkManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-network/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class NetworkManagementClient(object): + """Network Client + + :ivar config: Configuration for client. + :vartype config: NetworkManagementClientConfiguration + + :ivar application_gateways: ApplicationGateways operations + :vartype application_gateways: azure.mgmt.network.v2018_01_01.operations.ApplicationGatewaysOperations + :ivar application_security_groups: ApplicationSecurityGroups operations + :vartype application_security_groups: azure.mgmt.network.v2018_01_01.operations.ApplicationSecurityGroupsOperations + :ivar available_endpoint_services: AvailableEndpointServices operations + :vartype available_endpoint_services: azure.mgmt.network.v2018_01_01.operations.AvailableEndpointServicesOperations + :ivar express_route_circuit_authorizations: ExpressRouteCircuitAuthorizations operations + :vartype express_route_circuit_authorizations: azure.mgmt.network.v2018_01_01.operations.ExpressRouteCircuitAuthorizationsOperations + :ivar express_route_circuit_peerings: ExpressRouteCircuitPeerings operations + :vartype express_route_circuit_peerings: azure.mgmt.network.v2018_01_01.operations.ExpressRouteCircuitPeeringsOperations + :ivar express_route_circuits: ExpressRouteCircuits operations + :vartype express_route_circuits: azure.mgmt.network.v2018_01_01.operations.ExpressRouteCircuitsOperations + :ivar express_route_service_providers: ExpressRouteServiceProviders operations + :vartype express_route_service_providers: azure.mgmt.network.v2018_01_01.operations.ExpressRouteServiceProvidersOperations + :ivar load_balancers: LoadBalancers operations + :vartype load_balancers: azure.mgmt.network.v2018_01_01.operations.LoadBalancersOperations + :ivar load_balancer_backend_address_pools: LoadBalancerBackendAddressPools operations + :vartype load_balancer_backend_address_pools: azure.mgmt.network.v2018_01_01.operations.LoadBalancerBackendAddressPoolsOperations + :ivar load_balancer_frontend_ip_configurations: LoadBalancerFrontendIPConfigurations operations + :vartype load_balancer_frontend_ip_configurations: azure.mgmt.network.v2018_01_01.operations.LoadBalancerFrontendIPConfigurationsOperations + :ivar inbound_nat_rules: InboundNatRules operations + :vartype inbound_nat_rules: azure.mgmt.network.v2018_01_01.operations.InboundNatRulesOperations + :ivar load_balancer_load_balancing_rules: LoadBalancerLoadBalancingRules operations + :vartype load_balancer_load_balancing_rules: azure.mgmt.network.v2018_01_01.operations.LoadBalancerLoadBalancingRulesOperations + :ivar load_balancer_network_interfaces: LoadBalancerNetworkInterfaces operations + :vartype load_balancer_network_interfaces: azure.mgmt.network.v2018_01_01.operations.LoadBalancerNetworkInterfacesOperations + :ivar load_balancer_probes: LoadBalancerProbes operations + :vartype load_balancer_probes: azure.mgmt.network.v2018_01_01.operations.LoadBalancerProbesOperations + :ivar network_interfaces: NetworkInterfaces operations + :vartype network_interfaces: azure.mgmt.network.v2018_01_01.operations.NetworkInterfacesOperations + :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurations operations + :vartype network_interface_ip_configurations: azure.mgmt.network.v2018_01_01.operations.NetworkInterfaceIPConfigurationsOperations + :ivar network_interface_load_balancers: NetworkInterfaceLoadBalancers operations + :vartype network_interface_load_balancers: azure.mgmt.network.v2018_01_01.operations.NetworkInterfaceLoadBalancersOperations + :ivar network_security_groups: NetworkSecurityGroups operations + :vartype network_security_groups: azure.mgmt.network.v2018_01_01.operations.NetworkSecurityGroupsOperations + :ivar security_rules: SecurityRules operations + :vartype security_rules: azure.mgmt.network.v2018_01_01.operations.SecurityRulesOperations + :ivar default_security_rules: DefaultSecurityRules operations + :vartype default_security_rules: azure.mgmt.network.v2018_01_01.operations.DefaultSecurityRulesOperations + :ivar network_watchers: NetworkWatchers operations + :vartype network_watchers: azure.mgmt.network.v2018_01_01.operations.NetworkWatchersOperations + :ivar packet_captures: PacketCaptures operations + :vartype packet_captures: azure.mgmt.network.v2018_01_01.operations.PacketCapturesOperations + :ivar connection_monitors: ConnectionMonitors operations + :vartype connection_monitors: azure.mgmt.network.v2018_01_01.operations.ConnectionMonitorsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.network.v2018_01_01.operations.Operations + :ivar public_ip_addresses: PublicIPAddresses operations + :vartype public_ip_addresses: azure.mgmt.network.v2018_01_01.operations.PublicIPAddressesOperations + :ivar route_filters: RouteFilters operations + :vartype route_filters: azure.mgmt.network.v2018_01_01.operations.RouteFiltersOperations + :ivar route_filter_rules: RouteFilterRules operations + :vartype route_filter_rules: azure.mgmt.network.v2018_01_01.operations.RouteFilterRulesOperations + :ivar route_tables: RouteTables operations + :vartype route_tables: azure.mgmt.network.v2018_01_01.operations.RouteTablesOperations + :ivar routes: Routes operations + :vartype routes: azure.mgmt.network.v2018_01_01.operations.RoutesOperations + :ivar bgp_service_communities: BgpServiceCommunities operations + :vartype bgp_service_communities: azure.mgmt.network.v2018_01_01.operations.BgpServiceCommunitiesOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.network.v2018_01_01.operations.UsagesOperations + :ivar virtual_networks: VirtualNetworks operations + :vartype virtual_networks: azure.mgmt.network.v2018_01_01.operations.VirtualNetworksOperations + :ivar subnets: Subnets operations + :vartype subnets: azure.mgmt.network.v2018_01_01.operations.SubnetsOperations + :ivar virtual_network_peerings: VirtualNetworkPeerings operations + :vartype virtual_network_peerings: azure.mgmt.network.v2018_01_01.operations.VirtualNetworkPeeringsOperations + :ivar virtual_network_gateways: VirtualNetworkGateways operations + :vartype virtual_network_gateways: azure.mgmt.network.v2018_01_01.operations.VirtualNetworkGatewaysOperations + :ivar virtual_network_gateway_connections: VirtualNetworkGatewayConnections operations + :vartype virtual_network_gateway_connections: azure.mgmt.network.v2018_01_01.operations.VirtualNetworkGatewayConnectionsOperations + :ivar local_network_gateways: LocalNetworkGateways operations + :vartype local_network_gateways: azure.mgmt.network.v2018_01_01.operations.LocalNetworkGatewaysOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription credentials which uniquely + identify the Microsoft Azure subscription. The subscription ID forms part + of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = NetworkManagementClientConfiguration(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)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.application_gateways = ApplicationGatewaysOperations( + self._client, self.config, self._serialize, self._deserialize) + self.application_security_groups = ApplicationSecurityGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.available_endpoint_services = AvailableEndpointServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.express_route_circuits = ExpressRouteCircuitsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.express_route_service_providers = ExpressRouteServiceProvidersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.load_balancers = LoadBalancersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.load_balancer_backend_address_pools = LoadBalancerBackendAddressPoolsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.load_balancer_frontend_ip_configurations = LoadBalancerFrontendIPConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.inbound_nat_rules = InboundNatRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.load_balancer_load_balancing_rules = LoadBalancerLoadBalancingRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.load_balancer_network_interfaces = LoadBalancerNetworkInterfacesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.load_balancer_probes = LoadBalancerProbesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.network_interfaces = NetworkInterfacesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.network_interface_ip_configurations = NetworkInterfaceIPConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.network_interface_load_balancers = NetworkInterfaceLoadBalancersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.network_security_groups = NetworkSecurityGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.security_rules = SecurityRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.default_security_rules = DefaultSecurityRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.network_watchers = NetworkWatchersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.packet_captures = PacketCapturesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.connection_monitors = ConnectionMonitorsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.public_ip_addresses = PublicIPAddressesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.route_filters = RouteFiltersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.route_filter_rules = RouteFilterRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.route_tables = RouteTablesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.routes = RoutesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.bgp_service_communities = BgpServiceCommunitiesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.virtual_networks = VirtualNetworksOperations( + self._client, self.config, self._serialize, self._deserialize) + self.subnets = SubnetsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.virtual_network_peerings = VirtualNetworkPeeringsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.virtual_network_gateways = VirtualNetworkGatewaysOperations( + self._client, self.config, self._serialize, self._deserialize) + self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.local_network_gateways = LocalNetworkGatewaysOperations( + self._client, self.config, self._serialize, self._deserialize) + + def check_dns_name_availability( + self, location, domain_name_label, custom_headers=None, raw=False, **operation_config): + """Checks whether a domain name in the cloudapp.azure.com zone is + available for use. + + :param location: The location of the domain name. + :type location: str + :param domain_name_label: The domain name to be verified. It must + conform to the following regular expression: + ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + :type domain_name_label: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DnsNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.network.v2018_01_01.models.DnsNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2018-01-01" + + # Construct URL + url = self.check_dns_name_availability.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, '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['domainNameLabel'] = self._serialize.query("domain_name_label", domain_name_label, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DnsNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/__init__.py new file mode 100644 index 000000000000..eeaf47139863 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/__init__.py @@ -0,0 +1,88 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .application_gateways_operations import ApplicationGatewaysOperations +from .application_security_groups_operations import ApplicationSecurityGroupsOperations +from .available_endpoint_services_operations import AvailableEndpointServicesOperations +from .express_route_circuit_authorizations_operations import ExpressRouteCircuitAuthorizationsOperations +from .express_route_circuit_peerings_operations import ExpressRouteCircuitPeeringsOperations +from .express_route_circuits_operations import ExpressRouteCircuitsOperations +from .express_route_service_providers_operations import ExpressRouteServiceProvidersOperations +from .load_balancers_operations import LoadBalancersOperations +from .load_balancer_backend_address_pools_operations import LoadBalancerBackendAddressPoolsOperations +from .load_balancer_frontend_ip_configurations_operations import LoadBalancerFrontendIPConfigurationsOperations +from .inbound_nat_rules_operations import InboundNatRulesOperations +from .load_balancer_load_balancing_rules_operations import LoadBalancerLoadBalancingRulesOperations +from .load_balancer_network_interfaces_operations import LoadBalancerNetworkInterfacesOperations +from .load_balancer_probes_operations import LoadBalancerProbesOperations +from .network_interfaces_operations import NetworkInterfacesOperations +from .network_interface_ip_configurations_operations import NetworkInterfaceIPConfigurationsOperations +from .network_interface_load_balancers_operations import NetworkInterfaceLoadBalancersOperations +from .network_security_groups_operations import NetworkSecurityGroupsOperations +from .security_rules_operations import SecurityRulesOperations +from .default_security_rules_operations import DefaultSecurityRulesOperations +from .network_watchers_operations import NetworkWatchersOperations +from .packet_captures_operations import PacketCapturesOperations +from .connection_monitors_operations import ConnectionMonitorsOperations +from .operations import Operations +from .public_ip_addresses_operations import PublicIPAddressesOperations +from .route_filters_operations import RouteFiltersOperations +from .route_filter_rules_operations import RouteFilterRulesOperations +from .route_tables_operations import RouteTablesOperations +from .routes_operations import RoutesOperations +from .bgp_service_communities_operations import BgpServiceCommunitiesOperations +from .usages_operations import UsagesOperations +from .virtual_networks_operations import VirtualNetworksOperations +from .subnets_operations import SubnetsOperations +from .virtual_network_peerings_operations import VirtualNetworkPeeringsOperations +from .virtual_network_gateways_operations import VirtualNetworkGatewaysOperations +from .virtual_network_gateway_connections_operations import VirtualNetworkGatewayConnectionsOperations +from .local_network_gateways_operations import LocalNetworkGatewaysOperations + +__all__ = [ + 'ApplicationGatewaysOperations', + 'ApplicationSecurityGroupsOperations', + 'AvailableEndpointServicesOperations', + 'ExpressRouteCircuitAuthorizationsOperations', + 'ExpressRouteCircuitPeeringsOperations', + 'ExpressRouteCircuitsOperations', + 'ExpressRouteServiceProvidersOperations', + 'LoadBalancersOperations', + 'LoadBalancerBackendAddressPoolsOperations', + 'LoadBalancerFrontendIPConfigurationsOperations', + 'InboundNatRulesOperations', + 'LoadBalancerLoadBalancingRulesOperations', + 'LoadBalancerNetworkInterfacesOperations', + 'LoadBalancerProbesOperations', + 'NetworkInterfacesOperations', + 'NetworkInterfaceIPConfigurationsOperations', + 'NetworkInterfaceLoadBalancersOperations', + 'NetworkSecurityGroupsOperations', + 'SecurityRulesOperations', + 'DefaultSecurityRulesOperations', + 'NetworkWatchersOperations', + 'PacketCapturesOperations', + 'ConnectionMonitorsOperations', + 'Operations', + 'PublicIPAddressesOperations', + 'RouteFiltersOperations', + 'RouteFilterRulesOperations', + 'RouteTablesOperations', + 'RoutesOperations', + 'BgpServiceCommunitiesOperations', + 'UsagesOperations', + 'VirtualNetworksOperations', + 'SubnetsOperations', + 'VirtualNetworkPeeringsOperations', + 'VirtualNetworkGatewaysOperations', + 'VirtualNetworkGatewayConnectionsOperations', + 'LocalNetworkGatewaysOperations', +] diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/application_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/application_gateways_operations.py new file mode 100644 index 000000000000..f0c16e439c1f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/application_gateways_operations.py @@ -0,0 +1,1025 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ApplicationGatewaysOperations(object): + """ApplicationGatewaysOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} + + def get( + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationGateway or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.ApplicationGateway or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} + + + def _create_or_update_initial( + self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApplicationGateway') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('ApplicationGateway', response) + if response.status_code == 201: + deserialized = self._deserialize('ApplicationGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, application_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates the specified application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param parameters: Parameters supplied to the create or update + application gateway operation. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGateway + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ApplicationGateway] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ApplicationGateway]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ApplicationGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} + + + def _update_tags_initial( + self, resource_group_name, application_gateway_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, application_gateway_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the specified application gateway tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ApplicationGateway or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ApplicationGateway] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ApplicationGateway]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ApplicationGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all application gateways in a resource group. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ApplicationGateway + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationGateway] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ApplicationGatewayPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApplicationGatewayPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} + + def list_all( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the application gateways in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ApplicationGateway + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationGateway] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ApplicationGatewayPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApplicationGatewayPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} + + + def _start_initial( + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def start( + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Starts the specified application gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._start_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} + + + def _stop_initial( + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def stop( + self, resource_group_name, application_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Stops the specified application gateway in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} + + + def _backend_health_initial( + self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.backend_health.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('ApplicationGatewayBackendHealth', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def backend_health( + self, resource_group_name, application_gateway_name, expand=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Gets the backend health of the specified application gateway in a + resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_gateway_name: The name of the application gateway. + :type application_gateway_name: str + :param expand: Expands BackendAddressPool and BackendHttpSettings + referenced in backend health. + :type expand: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApplicationGatewayBackendHealth or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHealth] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayBackendHealth]] + :raises: :class:`CloudError` + """ + raw_result = self._backend_health_initial( + resource_group_name=resource_group_name, + application_gateway_name=application_gateway_name, + expand=expand, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ApplicationGatewayBackendHealth', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} + + def list_available_waf_rule_sets( + self, custom_headers=None, raw=False, **operation_config): + """Lists all available web application firewall rule sets. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationGatewayAvailableWafRuleSetsResult or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayAvailableWafRuleSetsResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_available_waf_rule_sets.metadata['url'] + path_format_arguments = { + '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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGatewayAvailableWafRuleSetsResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_available_waf_rule_sets.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'} + + def list_available_ssl_options( + self, custom_headers=None, raw=False, **operation_config): + """Lists available Ssl options for configuring Ssl policy. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationGatewayAvailableSslOptions or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewayAvailableSslOptions + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_available_ssl_options.metadata['url'] + path_format_arguments = { + '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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGatewayAvailableSslOptions', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_available_ssl_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default'} + + def list_available_ssl_predefined_policies( + self, custom_headers=None, raw=False, **operation_config): + """Lists all SSL predefined policies for configuring Ssl policy. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + ApplicationGatewaySslPredefinedPolicy + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslPredefinedPolicyPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslPredefinedPolicy] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_available_ssl_predefined_policies.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ApplicationGatewaySslPredefinedPolicyPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApplicationGatewaySslPredefinedPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_available_ssl_predefined_policies.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies'} + + def get_ssl_predefined_policy( + self, predefined_policy_name, custom_headers=None, raw=False, **operation_config): + """Gets Ssl predefined policy with the specified policy name. + + :param predefined_policy_name: Name of Ssl predefined policy. + :type predefined_policy_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationGatewaySslPredefinedPolicy or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ApplicationGatewaySslPredefinedPolicy + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_ssl_predefined_policy.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'predefinedPolicyName': self._serialize.url("predefined_policy_name", predefined_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGatewaySslPredefinedPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_ssl_predefined_policy.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/application_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/application_security_groups_operations.py new file mode 100644 index 000000000000..4c780394f520 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/application_security_groups_operations.py @@ -0,0 +1,424 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ApplicationSecurityGroupsOperations(object): + """ApplicationSecurityGroupsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified application security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_security_group_name: The name of the application + security group. + :type application_security_group_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} + + def get( + self, resource_group_name, application_security_group_name, custom_headers=None, raw=False, **operation_config): + """Gets information about the specified application security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_security_group_name: The name of the application + security group. + :type application_security_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationSecurityGroup or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ApplicationSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} + + + def _create_or_update_initial( + self, resource_group_name, application_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'applicationSecurityGroupName': self._serialize.url("application_security_group_name", application_security_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ApplicationSecurityGroup') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('ApplicationSecurityGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('ApplicationSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, application_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates an application security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param application_security_group_name: The name of the application + security group. + :type application_security_group_name: str + :param parameters: Parameters supplied to the create or update + ApplicationSecurityGroup operation. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ApplicationSecurityGroup or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + application_security_group_name=application_security_group_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ApplicationSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}'} + + def list_all( + self, custom_headers=None, raw=False, **operation_config): + """Gets all application security groups in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ApplicationSecurityGroup + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroupPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ApplicationSecurityGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApplicationSecurityGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all the application security groups in a resource group. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ApplicationSecurityGroup + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroupPaged[~azure.mgmt.network.v2018_01_01.models.ApplicationSecurityGroup] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ApplicationSecurityGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ApplicationSecurityGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/available_endpoint_services_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/available_endpoint_services_operations.py new file mode 100644 index 000000000000..9bc3ff11ecc2 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/available_endpoint_services_operations.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class AvailableEndpointServicesOperations(object): + """AvailableEndpointServicesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, location, custom_headers=None, raw=False, **operation_config): + """List what values of endpoint services are available for use. + + :param location: The location to check available endpoint services. + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EndpointServiceResult + :rtype: + ~azure.mgmt.network.v2018_01_01.models.EndpointServiceResultPaged[~azure.mgmt.network.v2018_01_01.models.EndpointServiceResult] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EndpointServiceResultPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EndpointServiceResultPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/bgp_service_communities_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/bgp_service_communities_operations.py new file mode 100644 index 000000000000..7dab1f1b2397 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/bgp_service_communities_operations.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class BgpServiceCommunitiesOperations(object): + """BgpServiceCommunitiesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the available bgp service communities. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BgpServiceCommunity + :rtype: + ~azure.mgmt.network.v2018_01_01.models.BgpServiceCommunityPaged[~azure.mgmt.network.v2018_01_01.models.BgpServiceCommunity] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.BgpServiceCommunityPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BgpServiceCommunityPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/connection_monitors_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/connection_monitors_operations.py new file mode 100644 index 000000000000..23e2e45c7497 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/connection_monitors_operations.py @@ -0,0 +1,644 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ConnectionMonitorsOperations(object): + """ConnectionMonitorsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ConnectionMonitor') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('ConnectionMonitorResult', response) + if response.status_code == 201: + deserialized = self._deserialize('ConnectionMonitorResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a connection monitor. + + :param resource_group_name: The name of the resource group containing + Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :param parameters: Parameters that define the operation to create a + connection monitor. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitor + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectionMonitorResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorResult]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConnectionMonitorResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} + + def get( + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): + """Gets a connection monitor by name. + + :param resource_group_name: The name of the resource group containing + Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectionMonitorResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionMonitorResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} + + + def _delete_initial( + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified connection monitor. + + :param resource_group_name: The name of the resource group containing + Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'} + + + def _stop_initial( + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def stop( + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Stops the specified connection monitor. + + :param resource_group_name: The name of the resource group containing + Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop'} + + + def _start_initial( + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def start( + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Starts the specified connection monitor. + + :param resource_group_name: The name of the resource group containing + Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name of the connection monitor. + :type connection_monitor_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._start_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start'} + + + def _query_initial( + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.query.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'connectionMonitorName': self._serialize.url("connection_monitor_name", connection_monitor_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('ConnectionMonitorQueryResult', response) + if response.status_code == 202: + deserialized = self._deserialize('ConnectionMonitorQueryResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def query( + self, resource_group_name, network_watcher_name, connection_monitor_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Query a snapshot of the most recent connection states. + + :param resource_group_name: The name of the resource group containing + Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param connection_monitor_name: The name given to the connection + monitor. + :type connection_monitor_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConnectionMonitorQueryResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorQueryResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorQueryResult]] + :raises: :class:`CloudError` + """ + raw_result = self._query_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + connection_monitor_name=connection_monitor_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConnectionMonitorQueryResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + query.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query'} + + def list( + self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): + """Lists all connection monitors for the specified Network Watcher. + + :param resource_group_name: The name of the resource group containing + Network Watcher. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConnectionMonitorResult + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorResultPaged[~azure.mgmt.network.v2018_01_01.models.ConnectionMonitorResult] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ConnectionMonitorResultPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ConnectionMonitorResultPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/default_security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/default_security_rules_operations.py new file mode 100644 index 000000000000..e83517f41008 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/default_security_rules_operations.py @@ -0,0 +1,177 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DefaultSecurityRulesOperations(object): + """DefaultSecurityRulesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all default security rules in a network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security + group. + :type network_security_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SecurityRule + :rtype: + ~azure.mgmt.network.v2018_01_01.models.SecurityRulePaged[~azure.mgmt.network.v2018_01_01.models.SecurityRule] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SecurityRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SecurityRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules'} + + def get( + self, resource_group_name, network_security_group_name, default_security_rule_name, custom_headers=None, raw=False, **operation_config): + """Get the specified default network security rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security + group. + :type network_security_group_name: str + :param default_security_rule_name: The name of the default security + rule. + :type default_security_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SecurityRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.SecurityRule or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'defaultSecurityRuleName': self._serialize.url("default_security_rule_name", default_security_rule_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecurityRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/express_route_circuit_authorizations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/express_route_circuit_authorizations_operations.py new file mode 100644 index 000000000000..ce1d78a2f99b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/express_route_circuit_authorizations_operations.py @@ -0,0 +1,374 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ExpressRouteCircuitAuthorizationsOperations(object): + """ExpressRouteCircuitAuthorizationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified authorization from the specified express route + circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param authorization_name: The name of the authorization. + :type authorization_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} + + def get( + self, resource_group_name, circuit_name, authorization_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified authorization from the specified express route + circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param authorization_name: The name of the authorization. + :type authorization_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExpressRouteCircuitAuthorization or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitAuthorization + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitAuthorization', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} + + + def _create_or_update_initial( + self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('ExpressRouteCircuitAuthorization', response) + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteCircuitAuthorization', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates an authorization in the specified express route + circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param authorization_name: The name of the authorization. + :type authorization_name: str + :param authorization_parameters: Parameters supplied to the create or + update express route circuit authorization operation. + :type authorization_parameters: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitAuthorization + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitAuthorization or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitAuthorization] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitAuthorization]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + authorization_name=authorization_name, + authorization_parameters=authorization_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ExpressRouteCircuitAuthorization', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} + + def list( + self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + """Gets all authorizations in an express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the circuit. + :type circuit_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExpressRouteCircuitAuthorization + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitAuthorizationPaged[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitAuthorization] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ExpressRouteCircuitAuthorizationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExpressRouteCircuitAuthorizationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/express_route_circuit_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/express_route_circuit_peerings_operations.py new file mode 100644 index 000000000000..e802faf1ddad --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/express_route_circuit_peerings_operations.py @@ -0,0 +1,371 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ExpressRouteCircuitPeeringsOperations(object): + """ExpressRouteCircuitPeeringsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified peering from the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} + + def get( + self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified authorization from the specified express route + circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExpressRouteCircuitPeering or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitPeering', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} + + + def _create_or_update_initial( + self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('ExpressRouteCircuitPeering', response) + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteCircuitPeering', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, circuit_name, peering_name, peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a peering in the specified express route circuits. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param peering_parameters: Parameters supplied to the create or update + express route circuit peering operation. + :type peering_parameters: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitPeering or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + peering_parameters=peering_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ExpressRouteCircuitPeering', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} + + def list( + self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + """Gets all peerings in a specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExpressRouteCircuitPeering + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeeringPaged[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPeering] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ExpressRouteCircuitPeeringPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExpressRouteCircuitPeeringPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/express_route_circuits_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/express_route_circuits_operations.py new file mode 100644 index 000000000000..977cbfc985f0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/express_route_circuits_operations.py @@ -0,0 +1,961 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ExpressRouteCircuitsOperations(object): + """ExpressRouteCircuitsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, circuit_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} + + def get( + self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + """Gets information about the specified express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of express route circuit. + :type circuit_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExpressRouteCircuit or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuit', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} + + + def _create_or_update_initial( + self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('ExpressRouteCircuit', response) + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteCircuit', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, circuit_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates an express route circuit. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the circuit. + :type circuit_name: str + :param parameters: Parameters supplied to the create or update express + route circuit operation. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ExpressRouteCircuit', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} + + + def _update_tags_initial( + self, resource_group_name, circuit_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuit', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, circuit_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an express route circuit tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the circuit. + :type circuit_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ExpressRouteCircuit or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ExpressRouteCircuit', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} + + + def _list_arp_table_initial( + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.list_arp_table.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, '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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('ExpressRouteCircuitsArpTableListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_arp_table( + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): + """Gets the currently advertised ARP table associated with the express + route circuit in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsArpTableListResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitsArpTableListResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitsArpTableListResult]] + :raises: :class:`CloudError` + """ + raw_result = self._list_arp_table_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} + + + def _list_routes_table_initial( + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.list_routes_table.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, '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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('ExpressRouteCircuitsRoutesTableListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_routes_table( + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): + """Gets the currently advertised routes table associated with the express + route circuit in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableListResult or + ClientRawResponse if + raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitsRoutesTableListResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitsRoutesTableListResult]] + :raises: :class:`CloudError` + """ + raw_result = self._list_routes_table_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} + + + def _list_routes_table_summary_initial( + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.list_routes_table_summary.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'devicePath': self._serialize.url("device_path", device_path, '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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('ExpressRouteCircuitsRoutesTableSummaryListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_routes_table_summary( + self, resource_group_name, circuit_name, peering_name, device_path, custom_headers=None, raw=False, polling=True, **operation_config): + """Gets the currently advertised routes table summary associated with the + express route circuit in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param device_path: The path of the device. + :type device_path: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteCircuitsRoutesTableSummaryListResult or + ClientRawResponse if + raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult]] + :raises: :class:`CloudError` + """ + raw_result = self._list_routes_table_summary_initial( + resource_group_name=resource_group_name, + circuit_name=circuit_name, + peering_name=peering_name, + device_path=device_path, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} + + def get_stats( + self, resource_group_name, circuit_name, custom_headers=None, raw=False, **operation_config): + """Gets all the stats from an express route circuit in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExpressRouteCircuitStats or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitStats or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_stats.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitStats', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} + + def get_peering_stats( + self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config): + """Gets all stats from an express route circuit in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param circuit_name: The name of the express route circuit. + :type circuit_name: str + :param peering_name: The name of the peering. + :type peering_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExpressRouteCircuitStats or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitStats or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_peering_stats.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ExpressRouteCircuitStats', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_peering_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all the express route circuits in a resource group. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExpressRouteCircuit + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPaged[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ExpressRouteCircuitPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExpressRouteCircuitPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} + + def list_all( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the express route circuits in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExpressRouteCircuit + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuitPaged[~azure.mgmt.network.v2018_01_01.models.ExpressRouteCircuit] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ExpressRouteCircuitPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExpressRouteCircuitPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/express_route_service_providers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/express_route_service_providers_operations.py new file mode 100644 index 000000000000..6072b854e1c1 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/express_route_service_providers_operations.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ExpressRouteServiceProvidersOperations(object): + """ExpressRouteServiceProvidersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the available express route service providers. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ExpressRouteServiceProvider + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ExpressRouteServiceProviderPaged[~azure.mgmt.network.v2018_01_01.models.ExpressRouteServiceProvider] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ExpressRouteServiceProviderPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ExpressRouteServiceProviderPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/inbound_nat_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/inbound_nat_rules_operations.py new file mode 100644 index 000000000000..201ff22af705 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/inbound_nat_rules_operations.py @@ -0,0 +1,372 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class InboundNatRulesOperations(object): + """InboundNatRulesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + """Gets all the inbound nat rules in a load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of InboundNatRule + :rtype: + ~azure.mgmt.network.v2018_01_01.models.InboundNatRulePaged[~azure.mgmt.network.v2018_01_01.models.InboundNatRule] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.InboundNatRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.InboundNatRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules'} + + + def _delete_initial( + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified load balancer inbound nat rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound nat rule. + :type inbound_nat_rule_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} + + def get( + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified load balancer inbound nat rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound nat rule. + :type inbound_nat_rule_name: str + :param expand: Expands referenced resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InboundNatRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.InboundNatRule or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('InboundNatRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} + + + def _create_or_update_initial( + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('InboundNatRule', response) + if response.status_code == 201: + deserialized = self._deserialize('InboundNatRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a load balancer inbound nat rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param inbound_nat_rule_name: The name of the inbound nat rule. + :type inbound_nat_rule_name: str + :param inbound_nat_rule_parameters: Parameters supplied to the create + or update inbound nat rule operation. + :type inbound_nat_rule_parameters: + ~azure.mgmt.network.v2018_01_01.models.InboundNatRule + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns InboundNatRule or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.InboundNatRule] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.InboundNatRule]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + inbound_nat_rule_name=inbound_nat_rule_name, + inbound_nat_rule_parameters=inbound_nat_rule_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('InboundNatRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_backend_address_pools_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_backend_address_pools_operations.py new file mode 100644 index 000000000000..1b50067ed0f3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_backend_address_pools_operations.py @@ -0,0 +1,175 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class LoadBalancerBackendAddressPoolsOperations(object): + """LoadBalancerBackendAddressPoolsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + """Gets all the load balancer backed address pools. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BackendAddressPool + :rtype: + ~azure.mgmt.network.v2018_01_01.models.BackendAddressPoolPaged[~azure.mgmt.network.v2018_01_01.models.BackendAddressPool] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.BackendAddressPoolPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BackendAddressPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools'} + + def get( + self, resource_group_name, load_balancer_name, backend_address_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets load balancer backend address pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param backend_address_pool_name: The name of the backend address + pool. + :type backend_address_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BackendAddressPool or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.BackendAddressPool or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BackendAddressPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_frontend_ip_configurations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_frontend_ip_configurations_operations.py new file mode 100644 index 000000000000..22244a095d31 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_frontend_ip_configurations_operations.py @@ -0,0 +1,175 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class LoadBalancerFrontendIPConfigurationsOperations(object): + """LoadBalancerFrontendIPConfigurationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + """Gets all the load balancer frontend IP configurations. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of FrontendIPConfiguration + :rtype: + ~azure.mgmt.network.v2018_01_01.models.FrontendIPConfigurationPaged[~azure.mgmt.network.v2018_01_01.models.FrontendIPConfiguration] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.FrontendIPConfigurationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.FrontendIPConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations'} + + def get( + self, resource_group_name, load_balancer_name, frontend_ip_configuration_name, custom_headers=None, raw=False, **operation_config): + """Gets load balancer frontend IP configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param frontend_ip_configuration_name: The name of the frontend IP + configuration. + :type frontend_ip_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: FrontendIPConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.FrontendIPConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'frontendIPConfigurationName': self._serialize.url("frontend_ip_configuration_name", frontend_ip_configuration_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('FrontendIPConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_load_balancing_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_load_balancing_rules_operations.py new file mode 100644 index 000000000000..57aa41b58848 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_load_balancing_rules_operations.py @@ -0,0 +1,174 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class LoadBalancerLoadBalancingRulesOperations(object): + """LoadBalancerLoadBalancingRulesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + """Gets all the load balancing rules in a load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LoadBalancingRule + :rtype: + ~azure.mgmt.network.v2018_01_01.models.LoadBalancingRulePaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancingRule] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.LoadBalancingRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LoadBalancingRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules'} + + def get( + self, resource_group_name, load_balancer_name, load_balancing_rule_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified load balancer load balancing rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param load_balancing_rule_name: The name of the load balancing rule. + :type load_balancing_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LoadBalancingRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.LoadBalancingRule or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'loadBalancingRuleName': self._serialize.url("load_balancing_rule_name", load_balancing_rule_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LoadBalancingRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_network_interfaces_operations.py new file mode 100644 index 000000000000..df21916c6079 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_network_interfaces_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class LoadBalancerNetworkInterfacesOperations(object): + """LoadBalancerNetworkInterfacesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + """Gets associated load balancer network interfaces. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NetworkInterface + :rtype: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfacePaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterface] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NetworkInterfacePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NetworkInterfacePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_probes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_probes_operations.py new file mode 100644 index 000000000000..4a5e70efcfca --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancer_probes_operations.py @@ -0,0 +1,174 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class LoadBalancerProbesOperations(object): + """LoadBalancerProbesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + """Gets all the load balancer probes. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Probe + :rtype: + ~azure.mgmt.network.v2018_01_01.models.ProbePaged[~azure.mgmt.network.v2018_01_01.models.Probe] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ProbePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProbePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes'} + + def get( + self, resource_group_name, load_balancer_name, probe_name, custom_headers=None, raw=False, **operation_config): + """Gets load balancer probe. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param probe_name: The name of the probe. + :type probe_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Probe or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.Probe or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), + 'probeName': self._serialize.url("probe_name", probe_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Probe', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancers_operations.py new file mode 100644 index 000000000000..be5e69de6e06 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/load_balancers_operations.py @@ -0,0 +1,524 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class LoadBalancersOperations(object): + """LoadBalancersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, load_balancer_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} + + def get( + self, resource_group_name, load_balancer_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param expand: Expands referenced resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LoadBalancer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.LoadBalancer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LoadBalancer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} + + + def _create_or_update_initial( + self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'LoadBalancer') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('LoadBalancer', response) + if response.status_code == 201: + deserialized = self._deserialize('LoadBalancer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, load_balancer_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a load balancer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param parameters: Parameters supplied to the create or update load + balancer operation. + :type parameters: ~azure.mgmt.network.v2018_01_01.models.LoadBalancer + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.LoadBalancer] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.LoadBalancer]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('LoadBalancer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} + + + def _update_tags_initial( + self, resource_group_name, load_balancer_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LoadBalancer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, load_balancer_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a load balancer tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param load_balancer_name: The name of the load balancer. + :type load_balancer_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LoadBalancer or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.LoadBalancer] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.LoadBalancer]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + load_balancer_name=load_balancer_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('LoadBalancer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} + + def list_all( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the load balancers in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LoadBalancer + :rtype: + ~azure.mgmt.network.v2018_01_01.models.LoadBalancerPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancer] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.LoadBalancerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LoadBalancerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all the load balancers in a resource group. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LoadBalancer + :rtype: + ~azure.mgmt.network.v2018_01_01.models.LoadBalancerPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancer] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.LoadBalancerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LoadBalancerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/local_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/local_network_gateways_operations.py new file mode 100644 index 000000000000..d59b8f8b600a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/local_network_gateways_operations.py @@ -0,0 +1,461 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class LocalNetworkGatewaysOperations(object): + """LocalNetworkGatewaysOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'LocalNetworkGateway') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('LocalNetworkGateway', response) + if response.status_code == 201: + deserialized = self._deserialize('LocalNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, local_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a local network gateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network + gateway. + :type local_network_gateway_name: str + :param parameters: Parameters supplied to the create or update local + network gateway operation. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('LocalNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} + + def get( + self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified local network gateway in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network + gateway. + :type local_network_gateway_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LocalNetworkGateway or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LocalNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} + + + def _delete_initial( + self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, local_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified local network gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network + gateway. + :type local_network_gateway_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} + + + def _update_tags_initial( + self, resource_group_name, local_network_gateway_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LocalNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, local_network_gateway_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a local network gateway tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param local_network_gateway_name: The name of the local network + gateway. + :type local_network_gateway_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LocalNetworkGateway or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + local_network_gateway_name=local_network_gateway_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('LocalNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all the local network gateways in a resource group. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LocalNetworkGateway + :rtype: + ~azure.mgmt.network.v2018_01_01.models.LocalNetworkGatewayPaged[~azure.mgmt.network.v2018_01_01.models.LocalNetworkGateway] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.LocalNetworkGatewayPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LocalNetworkGatewayPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_interface_ip_configurations_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_interface_ip_configurations_operations.py new file mode 100644 index 000000000000..85329ea6f795 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_interface_ip_configurations_operations.py @@ -0,0 +1,176 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class NetworkInterfaceIPConfigurationsOperations(object): + """NetworkInterfaceIPConfigurationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + """Get all ip configurations in a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NetworkInterfaceIPConfiguration + :rtype: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfigurationPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NetworkInterfaceIPConfigurationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NetworkInterfaceIPConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations'} + + def get( + self, resource_group_name, network_interface_name, ip_configuration_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified network interface ip configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param ip_configuration_name: The name of the ip configuration name. + :type ip_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NetworkInterfaceIPConfiguration or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkInterfaceIPConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_interface_load_balancers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_interface_load_balancers_operations.py new file mode 100644 index 000000000000..4da33762d5c8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_interface_load_balancers_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class NetworkInterfaceLoadBalancersOperations(object): + """NetworkInterfaceLoadBalancersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + """List all load balancers in a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LoadBalancer + :rtype: + ~azure.mgmt.network.v2018_01_01.models.LoadBalancerPaged[~azure.mgmt.network.v2018_01_01.models.LoadBalancer] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.LoadBalancerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LoadBalancerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_interfaces_operations.py new file mode 100644 index 000000000000..6abfd8896c7b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_interfaces_operations.py @@ -0,0 +1,1121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class NetworkInterfacesOperations(object): + """NetworkInterfacesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + + def _delete_initial( + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + api_version = "2018-01-01" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} + + def get( + self, resource_group_name, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets information about the specified network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param expand: Expands referenced resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NetworkInterface or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkInterface or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2018-01-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_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("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkInterface', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} + + + def _create_or_update_initial( + self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2018-01-01" + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'NetworkInterface') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('NetworkInterface', response) + if response.status_code == 201: + deserialized = self._deserialize('NetworkInterface', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, network_interface_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param parameters: Parameters supplied to the create or update network + interface operation. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterface + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.NetworkInterface] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.NetworkInterface]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('NetworkInterface', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} + + + def _update_tags_initial( + self, resource_group_name, network_interface_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + api_version = "2018-01-01" + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkInterface', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, network_interface_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a network interface tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkInterface or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.NetworkInterface] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.NetworkInterface]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('NetworkInterface', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} + + def list_all( + self, custom_headers=None, raw=False, **operation_config): + """Gets all network interfaces in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NetworkInterface + :rtype: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfacePaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterface] + :raises: :class:`CloudError` + """ + api_version = "2018-01-01" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + path_format_arguments = { + '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("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NetworkInterfacePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NetworkInterfacePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all network interfaces in a resource group. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NetworkInterface + :rtype: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfacePaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterface] + :raises: :class:`CloudError` + """ + api_version = "2018-01-01" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + '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("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NetworkInterfacePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NetworkInterfacePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} + + + def _get_effective_route_table_initial( + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + api_version = "2018-01-01" + + # Construct URL + url = self.get_effective_route_table.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('EffectiveRouteListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_effective_route_table( + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Gets all route tables applied to a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveRouteListResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.EffectiveRouteListResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.EffectiveRouteListResult]] + :raises: :class:`CloudError` + """ + raw_result = self._get_effective_route_table_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('EffectiveRouteListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_effective_route_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} + + + def _list_effective_network_security_groups_initial( + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, **operation_config): + api_version = "2018-01-01" + + # Construct URL + url = self.list_effective_network_security_groups.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('EffectiveNetworkSecurityGroupListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_effective_network_security_groups( + self, resource_group_name, network_interface_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Gets all network security groups applied to a network interface. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + EffectiveNetworkSecurityGroupListResult or + ClientRawResponse if + raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.EffectiveNetworkSecurityGroupListResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.EffectiveNetworkSecurityGroupListResult]] + :raises: :class:`CloudError` + """ + raw_result = self._list_effective_network_security_groups_initial( + resource_group_name=resource_group_name, + network_interface_name=network_interface_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_effective_network_security_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} + + def list_virtual_machine_scale_set_vm_network_interfaces( + self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, custom_headers=None, raw=False, **operation_config): + """Gets information about all network interfaces in a virtual machine in a + virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine + scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NetworkInterface + :rtype: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfacePaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterface] + :raises: :class:`CloudError` + """ + api_version = "2017-03-30" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, '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("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NetworkInterfacePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NetworkInterfacePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} + + def list_virtual_machine_scale_set_network_interfaces( + self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): + """Gets all network interfaces in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine + scale set. + :type virtual_machine_scale_set_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NetworkInterface + :rtype: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfacePaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterface] + :raises: :class:`CloudError` + """ + api_version = "2017-03-30" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_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("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NetworkInterfacePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NetworkInterfacePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} + + def get_virtual_machine_scale_set_network_interface( + self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the specified network interface in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine + scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param expand: Expands referenced resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NetworkInterface or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkInterface or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2017-03-30" + + # Construct URL + url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_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("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkInterface', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} + + def list_virtual_machine_scale_set_ip_configurations( + self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the specified network interface ip configuration in a virtual + machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine + scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param expand: Expands referenced resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NetworkInterfaceIPConfiguration + :rtype: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfigurationPaged[~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration] + :raises: :class:`CloudError` + """ + api_version = "2017-03-30" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_ip_configurations.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_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("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NetworkInterfaceIPConfigurationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NetworkInterfaceIPConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_virtual_machine_scale_set_ip_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations'} + + def get_virtual_machine_scale_set_ip_configuration( + self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the specified network interface ip configuration in a virtual + machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine + scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param ip_configuration_name: The name of the ip configuration. + :type ip_configuration_name: str + :param expand: Expands referenced resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NetworkInterfaceIPConfiguration or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.network.v2018_01_01.models.NetworkInterfaceIPConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2017-03-30" + + # Construct URL + url = self.get_virtual_machine_scale_set_ip_configuration.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_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("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkInterfaceIPConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_virtual_machine_scale_set_ip_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_security_groups_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_security_groups_operations.py new file mode 100644 index 000000000000..51c9d5b49471 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_security_groups_operations.py @@ -0,0 +1,530 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class NetworkSecurityGroupsOperations(object): + """NetworkSecurityGroupsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security + group. + :type network_security_group_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} + + def get( + self, resource_group_name, network_security_group_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security + group. + :type network_security_group_name: str + :param expand: Expands referenced resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NetworkSecurityGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} + + + def _create_or_update_initial( + self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('NetworkSecurityGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('NetworkSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, network_security_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a network security group in the specified resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security + group. + :type network_security_group_name: str + :param parameters: Parameters supplied to the create or update network + security group operation. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('NetworkSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} + + + def _update_tags_initial( + self, resource_group_name, network_security_group_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, network_security_group_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a network security group tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security + group. + :type network_security_group_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NetworkSecurityGroup or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('NetworkSecurityGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} + + def list_all( + self, custom_headers=None, raw=False, **operation_config): + """Gets all network security groups in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NetworkSecurityGroup + :rtype: + ~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroupPaged[~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NetworkSecurityGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NetworkSecurityGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all network security groups in a resource group. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NetworkSecurityGroup + :rtype: + ~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroupPaged[~azure.mgmt.network.v2018_01_01.models.NetworkSecurityGroup] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NetworkSecurityGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NetworkSecurityGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_watchers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_watchers_operations.py new file mode 100644 index 000000000000..81db04e1082b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/network_watchers_operations.py @@ -0,0 +1,1587 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class NetworkWatchersOperations(object): + """NetworkWatchersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def create_or_update( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a network watcher in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the network watcher + resource. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.NetworkWatcher + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NetworkWatcher or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkWatcher or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'NetworkWatcher') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('NetworkWatcher', response) + if response.status_code == 201: + deserialized = self._deserialize('NetworkWatcher', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} + + def get( + self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified network watcher by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NetworkWatcher or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkWatcher or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkWatcher', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} + + + def _delete_initial( + self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified network watcher resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} + + def update_tags( + self, resource_group_name, network_watcher_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates a network watcher tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NetworkWatcher or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.NetworkWatcher or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NetworkWatcher', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all network watchers by resource group. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NetworkWatcher + :rtype: + ~azure.mgmt.network.v2018_01_01.models.NetworkWatcherPaged[~azure.mgmt.network.v2018_01_01.models.NetworkWatcher] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NetworkWatcherPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NetworkWatcherPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'} + + def list_all( + self, custom_headers=None, raw=False, **operation_config): + """Gets all network watchers by subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NetworkWatcher + :rtype: + ~azure.mgmt.network.v2018_01_01.models.NetworkWatcherPaged[~azure.mgmt.network.v2018_01_01.models.NetworkWatcher] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NetworkWatcherPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NetworkWatcherPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'} + + def get_topology( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + """Gets the current network topology by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the representation of + topology. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.TopologyParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Topology or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.Topology or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_topology.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TopologyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Topology', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_topology.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'} + + + def _verify_ip_flow_initial( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.verify_ip_flow.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('VerificationIPFlowResult', response) + if response.status_code == 202: + deserialized = self._deserialize('VerificationIPFlowResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def verify_ip_flow( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Verify IP flow from the specified VM to a location given the currently + configured NSG rules. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the IP flow to be verified. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.VerificationIPFlowParameters + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VerificationIPFlowResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.VerificationIPFlowResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.VerificationIPFlowResult]] + :raises: :class:`CloudError` + """ + raw_result = self._verify_ip_flow_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VerificationIPFlowResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + verify_ip_flow.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} + + + def _get_next_hop_initial( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.get_next_hop.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'NextHopParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('NextHopResult', response) + if response.status_code == 202: + deserialized = self._deserialize('NextHopResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_next_hop( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Gets the next hop from the specified VM. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param parameters: Parameters that define the source and destination + endpoint. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.NextHopParameters + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NextHopResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.NextHopResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.NextHopResult]] + :raises: :class:`CloudError` + """ + raw_result = self._get_next_hop_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('NextHopResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_next_hop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} + + + def _get_vm_security_rules_initial( + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + parameters = models.SecurityGroupViewParameters(target_resource_id=target_resource_id) + + # Construct URL + url = self.get_vm_security_rules.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('SecurityGroupViewResult', response) + if response.status_code == 202: + deserialized = self._deserialize('SecurityGroupViewResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_vm_security_rules( + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Gets the configured and effective security group rules on the specified + VM. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param target_resource_id: ID of the target VM. + :type target_resource_id: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityGroupViewResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.SecurityGroupViewResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.SecurityGroupViewResult]] + :raises: :class:`CloudError` + """ + raw_result = self._get_vm_security_rules_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + target_resource_id=target_resource_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('SecurityGroupViewResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vm_security_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} + + + def _get_troubleshooting_initial( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.get_troubleshooting.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TroubleshootingParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('TroubleshootingResult', response) + if response.status_code == 202: + deserialized = self._deserialize('TroubleshootingResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_troubleshooting( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Initiate troubleshooting on a specified resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that define the resource to + troubleshoot. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.TroubleshootingParameters + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.TroubleshootingResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.TroubleshootingResult]] + :raises: :class:`CloudError` + """ + raw_result = self._get_troubleshooting_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('TroubleshootingResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} + + + def _get_troubleshooting_result_initial( + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + parameters = models.QueryTroubleshootingParameters(target_resource_id=target_resource_id) + + # Construct URL + url = self.get_troubleshooting_result.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('TroubleshootingResult', response) + if response.status_code == 202: + deserialized = self._deserialize('TroubleshootingResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_troubleshooting_result( + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Get the last completed troubleshooting result on a specified resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param target_resource_id: The target resource ID to query the + troubleshooting result. + :type target_resource_id: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TroubleshootingResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.TroubleshootingResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.TroubleshootingResult]] + :raises: :class:`CloudError` + """ + raw_result = self._get_troubleshooting_result_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + target_resource_id=target_resource_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('TroubleshootingResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_troubleshooting_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} + + + def _set_flow_log_configuration_initial( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.set_flow_log_configuration.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'FlowLogInformation') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('FlowLogInformation', response) + if response.status_code == 202: + deserialized = self._deserialize('FlowLogInformation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def set_flow_log_configuration( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Configures flow log and traffic analytics (optional) on a specified + resource. + + :param resource_group_name: The name of the network watcher resource + group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that define the configuration of flow + log. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.FlowLogInformation + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.FlowLogInformation] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.FlowLogInformation]] + :raises: :class:`CloudError` + """ + raw_result = self._set_flow_log_configuration_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('FlowLogInformation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_flow_log_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} + + + def _get_flow_log_status_initial( + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, **operation_config): + parameters = models.FlowLogStatusParameters(target_resource_id=target_resource_id) + + # Construct URL + url = self.get_flow_log_status.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('FlowLogInformation', response) + if response.status_code == 202: + deserialized = self._deserialize('FlowLogInformation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_flow_log_status( + self, resource_group_name, network_watcher_name, target_resource_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Queries status of flow log and traffic analytics (optional) on a + specified resource. + + :param resource_group_name: The name of the network watcher resource + group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param target_resource_id: The target resource where getting the flow + logging and traffic analytics (optional) status. + :type target_resource_id: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FlowLogInformation or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.FlowLogInformation] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.FlowLogInformation]] + :raises: :class:`CloudError` + """ + raw_result = self._get_flow_log_status_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + target_resource_id=target_resource_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('FlowLogInformation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_flow_log_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} + + + def _check_connectivity_initial( + self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, **operation_config): + parameters = models.ConnectivityParameters(source=source, destination=destination) + + # Construct URL + url = self.check_connectivity.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ConnectivityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('ConnectivityInformation', response) + if response.status_code == 202: + deserialized = self._deserialize('ConnectivityInformation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def check_connectivity( + self, resource_group_name, network_watcher_name, source, destination, custom_headers=None, raw=False, polling=True, **operation_config): + """Verifies the possibility of establishing a direct TCP connection from a + virtual machine to a given endpoint including another VM or an + arbitrary remote server. + + :param resource_group_name: The name of the network watcher resource + group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param source: + :type source: + ~azure.mgmt.network.v2018_01_01.models.ConnectivitySource + :param destination: + :type destination: + ~azure.mgmt.network.v2018_01_01.models.ConnectivityDestination + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectivityInformation + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ConnectivityInformation] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ConnectivityInformation]] + :raises: :class:`CloudError` + """ + raw_result = self._check_connectivity_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + source=source, + destination=destination, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConnectivityInformation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + check_connectivity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} + + + def _get_azure_reachability_report_initial( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.get_azure_reachability_report.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AzureReachabilityReportParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('AzureReachabilityReport', response) + if response.status_code == 202: + deserialized = self._deserialize('AzureReachabilityReport', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_azure_reachability_report( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Gets the relative latency score for internet service providers from a + specified location to Azure regions. + + :param resource_group_name: The name of the network watcher resource + group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that determine Azure reachability report + configuration. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.AzureReachabilityReportParameters + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AzureReachabilityReport + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.AzureReachabilityReport] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.AzureReachabilityReport]] + :raises: :class:`CloudError` + """ + raw_result = self._get_azure_reachability_report_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AzureReachabilityReport', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_azure_reachability_report.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport'} + + + def _list_available_providers_initial( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.list_available_providers.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AvailableProvidersListParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('AvailableProvidersList', response) + if response.status_code == 202: + deserialized = self._deserialize('AvailableProvidersList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_available_providers( + self, resource_group_name, network_watcher_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Lists all available internet service providers for a specified Azure + region. + + :param resource_group_name: The name of the network watcher resource + group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher resource. + :type network_watcher_name: str + :param parameters: Parameters that scope the list of available + providers. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.AvailableProvidersListParameters + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AvailableProvidersList + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.AvailableProvidersList] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.AvailableProvidersList]] + :raises: :class:`CloudError` + """ + raw_result = self._list_available_providers_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AvailableProvidersList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + list_available_providers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/operations.py new file mode 100644 index 000000000000..e6cb621b5701 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/operations.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Network Rest API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.network.v2018_01_01.models.OperationPaged[~azure.mgmt.network.v2018_01_01.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Network/operations'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/packet_captures_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/packet_captures_operations.py new file mode 100644 index 000000000000..b285e1ef66c8 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/packet_captures_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PacketCapturesOperations(object): + """PacketCapturesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _create_initial( + self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PacketCapture') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('PacketCaptureResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create and start a packet capture on the specified VM. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. + :type packet_capture_name: str + :param parameters: Parameters that define the create packet capture + operation. + :type parameters: ~azure.mgmt.network.v2018_01_01.models.PacketCapture + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PacketCaptureResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.PacketCaptureResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.PacketCaptureResult]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PacketCaptureResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} + + def get( + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + """Gets a packet capture session by name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. + :type packet_capture_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PacketCaptureResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.PacketCaptureResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PacketCaptureResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} + + + def _delete_initial( + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified packet capture session. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. + :type packet_capture_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} + + + def _stop_initial( + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def stop( + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Stops a specified packet capture session. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the network watcher. + :type network_watcher_name: str + :param packet_capture_name: The name of the packet capture session. + :type packet_capture_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} + + + def _get_status_initial( + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.get_status.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), + 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('PacketCaptureQueryStatusResult', response) + if response.status_code == 202: + deserialized = self._deserialize('PacketCaptureQueryStatusResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_status( + self, resource_group_name, network_watcher_name, packet_capture_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Query the status of a running packet capture session. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param packet_capture_name: The name given to the packet capture + session. + :type packet_capture_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + PacketCaptureQueryStatusResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.PacketCaptureQueryStatusResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.PacketCaptureQueryStatusResult]] + :raises: :class:`CloudError` + """ + raw_result = self._get_status_initial( + resource_group_name=resource_group_name, + network_watcher_name=network_watcher_name, + packet_capture_name=packet_capture_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PacketCaptureQueryStatusResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} + + def list( + self, resource_group_name, network_watcher_name, custom_headers=None, raw=False, **operation_config): + """Lists all packet capture sessions within the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_watcher_name: The name of the Network Watcher resource. + :type network_watcher_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PacketCaptureResult + :rtype: + ~azure.mgmt.network.v2018_01_01.models.PacketCaptureResultPaged[~azure.mgmt.network.v2018_01_01.models.PacketCaptureResult] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PacketCaptureResultPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PacketCaptureResultPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/public_ip_addresses_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/public_ip_addresses_operations.py new file mode 100644 index 000000000000..0eaf42b89de3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/public_ip_addresses_operations.py @@ -0,0 +1,775 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PublicIPAddressesOperations(object): + """PublicIPAddressesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + + def _delete_initial( + self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, **operation_config): + api_version = "2018-01-01" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, public_ip_address_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified public IP address. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_address_name: The name of the subnet. + :type public_ip_address_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} + + def get( + self, resource_group_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified public IP address in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_address_name: The name of the subnet. + :type public_ip_address_name: str + :param expand: Expands referenced resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PublicIPAddress or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2018-01-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_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("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PublicIPAddress', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} + + + def _create_or_update_initial( + self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2018-01-01" + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PublicIPAddress') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('PublicIPAddress', response) + if response.status_code == 201: + deserialized = self._deserialize('PublicIPAddress', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, public_ip_address_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a static or dynamic public IP address. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. + :type public_ip_address_name: str + :param parameters: Parameters supplied to the create or update public + IP address operation. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.PublicIPAddress] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.PublicIPAddress]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PublicIPAddress', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} + + + def _update_tags_initial( + self, resource_group_name, public_ip_address_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + api_version = "2018-01-01" + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PublicIPAddress', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, public_ip_address_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates public IP address tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_address_name: The name of the public IP address. + :type public_ip_address_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PublicIPAddress or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.PublicIPAddress] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.PublicIPAddress]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + public_ip_address_name=public_ip_address_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PublicIPAddress', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} + + def list_all( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the public IP addresses in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PublicIPAddress + :rtype: + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddressPaged[~azure.mgmt.network.v2018_01_01.models.PublicIPAddress] + :raises: :class:`CloudError` + """ + api_version = "2018-01-01" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + path_format_arguments = { + '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("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PublicIPAddressPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PublicIPAddressPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all public IP addresses in a resource group. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PublicIPAddress + :rtype: + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddressPaged[~azure.mgmt.network.v2018_01_01.models.PublicIPAddress] + :raises: :class:`CloudError` + """ + api_version = "2018-01-01" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + '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("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PublicIPAddressPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PublicIPAddressPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} + + def list_virtual_machine_scale_set_public_ip_addresses( + self, resource_group_name, virtual_machine_scale_set_name, custom_headers=None, raw=False, **operation_config): + """Gets information about all public IP addresses on a virtual machine + scale set level. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine + scale set. + :type virtual_machine_scale_set_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PublicIPAddress + :rtype: + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddressPaged[~azure.mgmt.network.v2018_01_01.models.PublicIPAddress] + :raises: :class:`CloudError` + """ + api_version = "2017-03-30" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_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("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PublicIPAddressPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PublicIPAddressPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_virtual_machine_scale_set_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses'} + + def list_virtual_machine_scale_set_vm_public_ip_addresses( + self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, custom_headers=None, raw=False, **operation_config): + """Gets information about all public IP addresses in a virtual machine IP + configuration in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine + scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The network interface name. + :type network_interface_name: str + :param ip_configuration_name: The IP configuration name. + :type ip_configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PublicIPAddress + :rtype: + ~azure.mgmt.network.v2018_01_01.models.PublicIPAddressPaged[~azure.mgmt.network.v2018_01_01.models.PublicIPAddress] + :raises: :class:`CloudError` + """ + api_version = "2017-03-30" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_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("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PublicIPAddressPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PublicIPAddressPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_virtual_machine_scale_set_vm_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses'} + + def get_virtual_machine_scale_set_public_ip_address( + self, resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, public_ip_address_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Get the specified public IP address in a virtual machine scale set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_machine_scale_set_name: The name of the virtual machine + scale set. + :type virtual_machine_scale_set_name: str + :param virtualmachine_index: The virtual machine index. + :type virtualmachine_index: str + :param network_interface_name: The name of the network interface. + :type network_interface_name: str + :param ip_configuration_name: The name of the IP configuration. + :type ip_configuration_name: str + :param public_ip_address_name: The name of the public IP Address. + :type public_ip_address_name: str + :param expand: Expands referenced resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PublicIPAddress or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.PublicIPAddress or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2017-03-30" + + # Construct URL + url = self.get_virtual_machine_scale_set_public_ip_address.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), + 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), + 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), + 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), + 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_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("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PublicIPAddress', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_virtual_machine_scale_set_public_ip_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/route_filter_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/route_filter_rules_operations.py new file mode 100644 index 000000000000..1ba765becf55 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/route_filter_rules_operations.py @@ -0,0 +1,474 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class RouteFilterRulesOperations(object): + """RouteFilterRulesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified rule from a route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} + + def get( + self, resource_group_name, route_filter_name, rule_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified rule from a route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param rule_name: The name of the rule. + :type rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RouteFilterRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteFilterRule or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RouteFilterRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} + + + def _create_or_update_initial( + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('RouteFilterRule', response) + if response.status_code == 201: + deserialized = self._deserialize('RouteFilterRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a route in the specified route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param rule_name: The name of the route filter rule. + :type rule_name: str + :param route_filter_rule_parameters: Parameters supplied to the create + or update route filter rule operation. + :type route_filter_rule_parameters: + ~azure.mgmt.network.v2018_01_01.models.RouteFilterRule + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.RouteFilterRule] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.RouteFilterRule]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + route_filter_rule_parameters=route_filter_rule_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RouteFilterRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} + + + def _update_initial( + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), + 'ruleName': self._serialize.url("rule_name", rule_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RouteFilterRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a route in the specified route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param rule_name: The name of the route filter rule. + :type rule_name: str + :param route_filter_rule_parameters: Parameters supplied to the update + route filter rule operation. + :type route_filter_rule_parameters: + ~azure.mgmt.network.v2018_01_01.models.PatchRouteFilterRule + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilterRule or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.RouteFilterRule] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.RouteFilterRule]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + rule_name=rule_name, + route_filter_rule_parameters=route_filter_rule_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RouteFilterRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} + + def list_by_route_filter( + self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): + """Gets all RouteFilterRules in a route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of RouteFilterRule + :rtype: + ~azure.mgmt.network.v2018_01_01.models.RouteFilterRulePaged[~azure.mgmt.network.v2018_01_01.models.RouteFilterRule] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_route_filter.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RouteFilterRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RouteFilterRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_route_filter.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/route_filters_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/route_filters_operations.py new file mode 100644 index 000000000000..5dcaa5d090c4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/route_filters_operations.py @@ -0,0 +1,525 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class RouteFiltersOperations(object): + """RouteFiltersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, route_filter_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, route_filter_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} + + def get( + self, resource_group_name, route_filter_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified route filter. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param expand: Expands referenced express route bgp peering resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RouteFilter or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteFilter or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RouteFilter', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} + + + def _create_or_update_initial( + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('RouteFilter', response) + if response.status_code == 201: + deserialized = self._deserialize('RouteFilter', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a route filter in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param route_filter_parameters: Parameters supplied to the create or + update route filter operation. + :type route_filter_parameters: + ~azure.mgmt.network.v2018_01_01.models.RouteFilter + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.RouteFilter] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.RouteFilter]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + route_filter_parameters=route_filter_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RouteFilter', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} + + + def _update_initial( + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeFilterName': self._serialize.url("route_filter_name", route_filter_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RouteFilter', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, route_filter_name, route_filter_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a route filter in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_filter_name: The name of the route filter. + :type route_filter_name: str + :param route_filter_parameters: Parameters supplied to the update + route filter operation. + :type route_filter_parameters: + ~azure.mgmt.network.v2018_01_01.models.PatchRouteFilter + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteFilter or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.RouteFilter] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.RouteFilter]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + route_filter_name=route_filter_name, + route_filter_parameters=route_filter_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RouteFilter', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all route filters in a resource group. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of RouteFilter + :rtype: + ~azure.mgmt.network.v2018_01_01.models.RouteFilterPaged[~azure.mgmt.network.v2018_01_01.models.RouteFilter] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + 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'), + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RouteFilterPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RouteFilterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets all route filters in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of RouteFilter + :rtype: + ~azure.mgmt.network.v2018_01_01.models.RouteFilterPaged[~azure.mgmt.network.v2018_01_01.models.RouteFilter] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + 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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RouteFilterPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RouteFilterPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/route_tables_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/route_tables_operations.py new file mode 100644 index 000000000000..3bdc92eff377 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/route_tables_operations.py @@ -0,0 +1,524 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class RouteTablesOperations(object): + """RouteTablesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, route_table_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} + + def get( + self, resource_group_name, route_table_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param expand: Expands referenced resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RouteTable or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.RouteTable or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RouteTable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} + + + def _create_or_update_initial( + self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RouteTable') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('RouteTable', response) + if response.status_code == 201: + deserialized = self._deserialize('RouteTable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, route_table_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or updates a route table in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param parameters: Parameters supplied to the create or update route + table operation. + :type parameters: ~azure.mgmt.network.v2018_01_01.models.RouteTable + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.RouteTable] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.RouteTable]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RouteTable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} + + + def _update_tags_initial( + self, resource_group_name, route_table_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RouteTable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, route_table_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a route table tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns RouteTable or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.RouteTable] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.RouteTable]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RouteTable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all route tables in a resource group. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of RouteTable + :rtype: + ~azure.mgmt.network.v2018_01_01.models.RouteTablePaged[~azure.mgmt.network.v2018_01_01.models.RouteTable] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RouteTablePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RouteTablePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} + + def list_all( + self, custom_headers=None, raw=False, **operation_config): + """Gets all route tables in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of RouteTable + :rtype: + ~azure.mgmt.network.v2018_01_01.models.RouteTablePaged[~azure.mgmt.network.v2018_01_01.models.RouteTable] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RouteTablePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RouteTablePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/routes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/routes_operations.py new file mode 100644 index 000000000000..18d72b337c73 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/routes_operations.py @@ -0,0 +1,367 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class RoutesOperations(object): + """RoutesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified route from a route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param route_name: The name of the route. + :type route_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} + + def get( + self, resource_group_name, route_table_name, route_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified route from a route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param route_name: The name of the route. + :type route_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Route or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.Route or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Route', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} + + + def _create_or_update_initial( + self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), + 'routeName': self._serialize.url("route_name", route_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(route_parameters, 'Route') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('Route', response) + if response.status_code == 201: + deserialized = self._deserialize('Route', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, route_table_name, route_name, route_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a route in the specified route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param route_name: The name of the route. + :type route_name: str + :param route_parameters: Parameters supplied to the create or update + route operation. + :type route_parameters: ~azure.mgmt.network.v2018_01_01.models.Route + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Route or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.Route] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.Route]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + route_table_name=route_table_name, + route_name=route_name, + route_parameters=route_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Route', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} + + def list( + self, resource_group_name, route_table_name, custom_headers=None, raw=False, **operation_config): + """Gets all routes in a route table. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param route_table_name: The name of the route table. + :type route_table_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Route + :rtype: + ~azure.mgmt.network.v2018_01_01.models.RoutePaged[~azure.mgmt.network.v2018_01_01.models.Route] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'routeTableName': self._serialize.url("route_table_name", route_table_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.RoutePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.RoutePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/security_rules_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/security_rules_operations.py new file mode 100644 index 000000000000..844fa7235dfa --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/security_rules_operations.py @@ -0,0 +1,373 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class SecurityRulesOperations(object): + """SecurityRulesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified network security rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security + group. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. + :type security_rule_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} + + def get( + self, resource_group_name, network_security_group_name, security_rule_name, custom_headers=None, raw=False, **operation_config): + """Get the specified network security rule. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security + group. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. + :type security_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SecurityRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.SecurityRule or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecurityRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} + + + def _create_or_update_initial( + self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), + 'securityRuleName': self._serialize.url("security_rule_name", security_rule_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('SecurityRule', response) + if response.status_code == 201: + deserialized = self._deserialize('SecurityRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a security rule in the specified network security + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security + group. + :type network_security_group_name: str + :param security_rule_name: The name of the security rule. + :type security_rule_name: str + :param security_rule_parameters: Parameters supplied to the create or + update network security rule operation. + :type security_rule_parameters: + ~azure.mgmt.network.v2018_01_01.models.SecurityRule + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SecurityRule or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.SecurityRule] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.SecurityRule]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_security_group_name=network_security_group_name, + security_rule_name=security_rule_name, + security_rule_parameters=security_rule_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('SecurityRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} + + def list( + self, resource_group_name, network_security_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all security rules in a network security group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param network_security_group_name: The name of the network security + group. + :type network_security_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SecurityRule + :rtype: + ~azure.mgmt.network.v2018_01_01.models.SecurityRulePaged[~azure.mgmt.network.v2018_01_01.models.SecurityRule] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SecurityRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SecurityRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/subnets_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/subnets_operations.py new file mode 100644 index 000000000000..43962bcbf9ef --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/subnets_operations.py @@ -0,0 +1,371 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class SubnetsOperations(object): + """SubnetsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, virtual_network_name, subnet_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified subnet. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} + + def get( + self, resource_group_name, virtual_network_name, subnet_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified subnet by virtual network and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :param expand: Expands referenced resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Subnet or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.Subnet or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Subnet', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} + + + def _create_or_update_initial( + self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'subnetName': self._serialize.url("subnet_name", subnet_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(subnet_parameters, 'Subnet') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('Subnet', response) + if response.status_code == 201: + deserialized = self._deserialize('Subnet', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, virtual_network_name, subnet_name, subnet_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a subnet in the specified virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param subnet_name: The name of the subnet. + :type subnet_name: str + :param subnet_parameters: Parameters supplied to the create or update + subnet operation. + :type subnet_parameters: ~azure.mgmt.network.v2018_01_01.models.Subnet + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Subnet or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.Subnet] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.Subnet]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + subnet_name=subnet_name, + subnet_parameters=subnet_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Subnet', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} + + def list( + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + """Gets all subnets in a virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Subnet + :rtype: + ~azure.mgmt.network.v2018_01_01.models.SubnetPaged[~azure.mgmt.network.v2018_01_01.models.Subnet] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SubnetPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SubnetPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/usages_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/usages_operations.py new file mode 100644 index 000000000000..8c4d11870c31 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/usages_operations.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class UsagesOperations(object): + """UsagesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + def list( + self, location, custom_headers=None, raw=False, **operation_config): + """List network usages for a subscription. + + :param location: The location where resource usage is queried. + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Usage + :rtype: + ~azure.mgmt.network.v2018_01_01.models.UsagePaged[~azure.mgmt.network.v2018_01_01.models.Usage] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_network_gateway_connections_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_network_gateway_connections_operations.py new file mode 100644 index 000000000000..e38370fb2d6c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_network_gateway_connections_operations.py @@ -0,0 +1,749 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class VirtualNetworkGatewayConnectionsOperations(object): + """VirtualNetworkGatewayConnectionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('VirtualNetworkGatewayConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkGatewayConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a virtual network gateway connection in the + specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the + virtual network gateway connection. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the create or update virtual + network gateway connection operation. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnection + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnection or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnection]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VirtualNetworkGatewayConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} + + def get( + self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified virtual network gateway connection by resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the + virtual network gateway connection. + :type virtual_network_gateway_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VirtualNetworkGatewayConnection or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnection + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGatewayConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} + + + def _delete_initial( + self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified virtual network Gateway connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the + virtual network gateway connection. + :type virtual_network_gateway_connection_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} + + + def _update_tags_initial( + self, resource_group_name, virtual_network_gateway_connection_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGatewayConnectionListEntity', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, virtual_network_gateway_connection_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a virtual network gateway connection tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the + virtual network gateway connection. + :type virtual_network_gateway_connection_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + VirtualNetworkGatewayConnectionListEntity or + ClientRawResponse if + raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionListEntity] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionListEntity]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VirtualNetworkGatewayConnectionListEntity', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} + + + def _set_shared_key_initial( + self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, **operation_config): + parameters = models.ConnectionSharedKey(value=value) + + # Construct URL + url = self.set_shared_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ConnectionSharedKey') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('ConnectionSharedKey', response) + if response.status_code == 201: + deserialized = self._deserialize('ConnectionSharedKey', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def set_shared_key( + self, resource_group_name, virtual_network_gateway_connection_name, value, custom_headers=None, raw=False, polling=True, **operation_config): + """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the + virtual network gateway connection shared key for passed virtual + network gateway connection in the specified resource group through + Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network + gateway connection name. + :type virtual_network_gateway_connection_name: str + :param value: The virtual network connection shared key value. + :type value: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConnectionSharedKey or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ConnectionSharedKey] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ConnectionSharedKey]] + :raises: :class:`CloudError` + """ + raw_result = self._set_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + value=value, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConnectionSharedKey', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} + + def get_shared_key( + self, resource_group_name, virtual_network_gateway_connection_name, custom_headers=None, raw=False, **operation_config): + """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves + information about the specified virtual network gateway connection + shared key through Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network + gateway connection shared key name. + :type virtual_network_gateway_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectionSharedKey or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.ConnectionSharedKey or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_shared_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionSharedKey', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """The List VirtualNetworkGatewayConnections operation retrieves all the + virtual network gateways connections created. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VirtualNetworkGatewayConnection + :rtype: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnection] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.VirtualNetworkGatewayConnectionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualNetworkGatewayConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} + + + def _reset_shared_key_initial( + self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, **operation_config): + parameters = models.ConnectionResetSharedKey(key_length=key_length) + + # Construct URL + url = self.reset_shared_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('ConnectionResetSharedKey', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def reset_shared_key( + self, resource_group_name, virtual_network_gateway_connection_name, key_length, custom_headers=None, raw=False, polling=True, **operation_config): + """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the + virtual network gateway connection shared key for passed virtual + network gateway connection in the specified resource group through + Network resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The virtual network + gateway connection reset shared key Name. + :type virtual_network_gateway_connection_name: str + :param key_length: The virtual network connection reset shared key + length, should between 1 and 128. + :type key_length: int + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConnectionResetSharedKey or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.ConnectionResetSharedKey] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.ConnectionResetSharedKey]] + :raises: :class:`CloudError` + """ + raw_result = self._reset_shared_key_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, + key_length=key_length, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConnectionResetSharedKey', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_network_gateways_operations.py new file mode 100644 index 000000000000..49c4abd032ff --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_network_gateways_operations.py @@ -0,0 +1,1360 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class VirtualNetworkGatewaysOperations(object): + """VirtualNetworkGatewaysOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('VirtualNetworkGateway', response) + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a virtual network gateway in the specified resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to create or update virtual + network gateway operation. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VirtualNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} + + def get( + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified virtual network gateway by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VirtualNetworkGateway or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} + + + def _delete_initial( + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified virtual network gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} + + + def _update_tags_initial( + self, resource_group_name, virtual_network_gateway_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, virtual_network_gateway_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a virtual network gateway tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VirtualNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all virtual network gateways by resource group. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VirtualNetworkGateway + :rtype: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.VirtualNetworkGatewayPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualNetworkGatewayPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} + + def list_connections( + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + """Gets all the connections in a virtual network gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + VirtualNetworkGatewayConnectionListEntity + :rtype: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionListEntityPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGatewayConnectionListEntity] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_connections.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.VirtualNetworkGatewayConnectionListEntityPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualNetworkGatewayConnectionListEntityPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections'} + + + def _reset_initial( + self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.reset.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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 = {} + if gateway_vip is not None: + query_parameters['gatewayVip'] = self._serialize.query("gateway_vip", gateway_vip, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('VirtualNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def reset( + self, resource_group_name, virtual_network_gateway_name, gateway_vip=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Resets the primary of the virtual network gateway in the specified + resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param gateway_vip: Virtual network gateway vip address supplied to + the begin reset of the active-active feature enabled gateway. + :type gateway_vip: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkGateway + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkGateway]] + :raises: :class:`CloudError` + """ + raw_result = self._reset_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + gateway_vip=gateway_vip, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VirtualNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} + + + def _generatevpnclientpackage_initial( + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.generatevpnclientpackage.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VpnClientParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def generatevpnclientpackage( + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Generates VPN client package for P2S client of the virtual network + gateway in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.VpnClientParameters + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] + :raises: :class:`CloudError` + """ + raw_result = self._generatevpnclientpackage_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} + + + def _generate_vpn_profile_initial( + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.generate_vpn_profile.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VpnClientParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def generate_vpn_profile( + self, resource_group_name, virtual_network_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Generates VPN profile for P2S client of the virtual network gateway in + the specified resource group. Used for IKEV2 and radius based + authentication. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param parameters: Parameters supplied to the generate virtual network + gateway VPN client package operation. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.VpnClientParameters + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] + :raises: :class:`CloudError` + """ + raw_result = self._generate_vpn_profile_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} + + + def _get_vpn_profile_package_url_initial( + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.get_vpn_profile_package_url.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_vpn_profile_package_url( + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Gets pre-generated VPN profile for P2S client of the virtual network + gateway in the specified resource group. The profile needs to be + generated first using generateVpnProfile. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns str or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[str] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[str]] + :raises: :class:`CloudError` + """ + raw_result = self._get_vpn_profile_package_url_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_vpn_profile_package_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'} + + + def _get_bgp_peer_status_initial( + self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.get_bgp_peer_status.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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 = {} + if peer is not None: + query_parameters['peer'] = self._serialize.query("peer", peer, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('BgpPeerStatusListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_bgp_peer_status( + self, resource_group_name, virtual_network_gateway_name, peer=None, custom_headers=None, raw=False, polling=True, **operation_config): + """The GetBgpPeerStatus operation retrieves the status of all BGP peers. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param peer: The IP address of the peer to retrieve the status of. + :type peer: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BgpPeerStatusListResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.BgpPeerStatusListResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.BgpPeerStatusListResult]] + :raises: :class:`CloudError` + """ + raw_result = self._get_bgp_peer_status_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + peer=peer, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BgpPeerStatusListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_bgp_peer_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} + + def supported_vpn_devices( + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + """Gets a xml format representation for supported vpn devices. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.supported_vpn_devices.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + supported_vpn_devices.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices'} + + + def _get_learned_routes_initial( + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.get_learned_routes.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('GatewayRouteListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_learned_routes( + self, resource_group_name, virtual_network_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): + """This operation retrieves a list of routes the virtual network gateway + has learned, including routes learned from BGP peers. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.GatewayRouteListResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.GatewayRouteListResult]] + :raises: :class:`CloudError` + """ + raw_result = self._get_learned_routes_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GatewayRouteListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} + + + def _get_advertised_routes_initial( + self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.get_advertised_routes.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_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['peer'] = self._serialize.query("peer", peer, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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('GatewayRouteListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_advertised_routes( + self, resource_group_name, virtual_network_gateway_name, peer, custom_headers=None, raw=False, polling=True, **operation_config): + """This operation retrieves a list of routes the virtual network gateway + is advertising to the specified peer. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_name: The name of the virtual network + gateway. + :type virtual_network_gateway_name: str + :param peer: The IP address of the peer + :type peer: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GatewayRouteListResult + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.GatewayRouteListResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.GatewayRouteListResult]] + :raises: :class:`CloudError` + """ + raw_result = self._get_advertised_routes_initial( + resource_group_name=resource_group_name, + virtual_network_gateway_name=virtual_network_gateway_name, + peer=peer, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GatewayRouteListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} + + def vpn_device_configuration_script( + self, resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers=None, raw=False, **operation_config): + """Gets a xml format representation for vpn device configuration script. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_gateway_connection_name: The name of the + virtual network gateway connection for which the configuration script + is generated. + :type virtual_network_gateway_connection_name: str + :param parameters: Parameters supplied to the generate vpn device + script operation. + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.VpnDeviceScriptParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.vpn_device_configuration_script.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VpnDeviceScriptParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + vpn_device_configuration_script.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_network_peerings_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_network_peerings_operations.py new file mode 100644 index 000000000000..9b0e497a4dd4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_network_peerings_operations.py @@ -0,0 +1,370 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class VirtualNetworkPeeringsOperations(object): + """VirtualNetworkPeeringsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified virtual network peering. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the virtual network + peering. + :type virtual_network_peering_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} + + def get( + self, resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified virtual network peering. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the virtual network + peering. + :type virtual_network_peering_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VirtualNetworkPeering or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeering + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetworkPeering', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} + + + def _create_or_update_initial( + self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), + 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('VirtualNetworkPeering', response) + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkPeering', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a peering in the specified virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param virtual_network_peering_name: The name of the peering. + :type virtual_network_peering_name: str + :param virtual_network_peering_parameters: Parameters supplied to the + create or update virtual network peering operation. + :type virtual_network_peering_parameters: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeering + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetworkPeering + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeering] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeering]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + virtual_network_peering_name=virtual_network_peering_name, + virtual_network_peering_parameters=virtual_network_peering_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VirtualNetworkPeering', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} + + def list( + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + """Gets all virtual network peerings in a virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VirtualNetworkPeering + :rtype: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeeringPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPeering] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.VirtualNetworkPeeringPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualNetworkPeeringPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_networks_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_networks_operations.py new file mode 100644 index 000000000000..20348aee0975 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/operations/virtual_networks_operations.py @@ -0,0 +1,663 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class VirtualNetworksOperations(object): + """VirtualNetworksOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-01-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified virtual network. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} + + def get( + self, resource_group_name, virtual_network_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified virtual network by resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param expand: Expands referenced resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_01_01.models.VirtualNetwork or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_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') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetwork', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} + + + def _create_or_update_initial( + self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VirtualNetwork') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + 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('VirtualNetwork', response) + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetwork', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, virtual_network_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a virtual network in the specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param parameters: Parameters supplied to the create or update virtual + network operation + :type parameters: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetwork + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetwork] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.VirtualNetwork]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VirtualNetwork', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} + + + def _update_tags_initial( + self, resource_group_name, virtual_network_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetwork', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, virtual_network_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a virtual network tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualNetwork or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_01_01.models.VirtualNetwork] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_01_01.models.VirtualNetwork]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + virtual_network_name=virtual_network_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VirtualNetwork', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} + + def list_all( + self, custom_headers=None, raw=False, **operation_config): + """Gets all virtual networks in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VirtualNetwork + :rtype: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetwork] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.VirtualNetworkPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualNetworkPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all virtual networks in a resource group. + + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VirtualNetwork + :rtype: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkPaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetwork] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + '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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.VirtualNetworkPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualNetworkPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks'} + + def check_ip_address_availability( + self, resource_group_name, virtual_network_name, ip_address=None, custom_headers=None, raw=False, **operation_config): + """Checks whether a private IP address is available for use. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param ip_address: The private IP address to be verified. + :type ip_address: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IPAddressAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.network.v2018_01_01.models.IPAddressAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_ip_address_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_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 = {} + if ip_address is not None: + query_parameters['ipAddress'] = self._serialize.query("ip_address", ip_address, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IPAddressAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_ip_address_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'} + + def list_usage( + self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + """Lists usage stats. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param virtual_network_name: The name of the virtual network. + :type virtual_network_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VirtualNetworkUsage + :rtype: + ~azure.mgmt.network.v2018_01_01.models.VirtualNetworkUsagePaged[~azure.mgmt.network.v2018_01_01.models.VirtualNetworkUsage] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_usage.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.VirtualNetworkUsagePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualNetworkUsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_01_01/version.py b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/version.py new file mode 100644 index 000000000000..53a203f32aaf --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_01_01/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "" + diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/__init__.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/__init__.py new file mode 100644 index 000000000000..3587c19cedfc --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .policy_insights_client import PolicyInsightsClient +from .version import VERSION + +__all__ = ['PolicyInsightsClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/__init__.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/__init__.py new file mode 100644 index 000000000000..acf6eca04eb0 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/__init__.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .policy_event_py3 import PolicyEvent + from .policy_events_query_results_py3 import PolicyEventsQueryResults + from .query_failure_error_py3 import QueryFailureError + from .query_failure_py3 import QueryFailure, QueryFailureException + from .policy_state_py3 import PolicyState + from .policy_states_query_results_py3 import PolicyStatesQueryResults + from .summary_results_py3 import SummaryResults + from .policy_definition_summary_py3 import PolicyDefinitionSummary + from .policy_assignment_summary_py3 import PolicyAssignmentSummary + from .summary_py3 import Summary + from .summarize_results_py3 import SummarizeResults + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .operations_list_results_py3 import OperationsListResults + from .query_options_py3 import QueryOptions +except (SyntaxError, ImportError): + from .policy_event import PolicyEvent + from .policy_events_query_results import PolicyEventsQueryResults + from .query_failure_error import QueryFailureError + from .query_failure import QueryFailure, QueryFailureException + from .policy_state import PolicyState + from .policy_states_query_results import PolicyStatesQueryResults + from .summary_results import SummaryResults + from .policy_definition_summary import PolicyDefinitionSummary + from .policy_assignment_summary import PolicyAssignmentSummary + from .summary import Summary + from .summarize_results import SummarizeResults + from .operation_display import OperationDisplay + from .operation import Operation + from .operations_list_results import OperationsListResults + from .query_options import QueryOptions +from .policy_insights_client_enums import ( + PolicyStatesResource, +) + +__all__ = [ + 'PolicyEvent', + 'PolicyEventsQueryResults', + 'QueryFailureError', + 'QueryFailure', 'QueryFailureException', + 'PolicyState', + 'PolicyStatesQueryResults', + 'SummaryResults', + 'PolicyDefinitionSummary', + 'PolicyAssignmentSummary', + 'Summary', + 'SummarizeResults', + 'OperationDisplay', + 'Operation', + 'OperationsListResults', + 'QueryOptions', + 'PolicyStatesResource', +] diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operation.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operation.py new file mode 100644 index 000000000000..b1de7ee85c7e --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operation.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Operation definition. + + :param name: Operation name. + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.policyinsights.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operation_display.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operation_display.py new file mode 100644 index 000000000000..49e584de324d --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operation_display.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider name. + :type provider: str + :param resource: Resource name on which the operation is performed. + :type resource: str + :param operation: Operation name. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operation_display_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operation_display_py3.py new file mode 100644 index 000000000000..3ed545a5f6d2 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operation_display_py3.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider name. + :type provider: str + :param resource: Resource name on which the operation is performed. + :type resource: str + :param operation: Operation name. + :type operation: str + :param description: Operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operation_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operation_py3.py new file mode 100644 index 000000000000..d20a3bced084 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operation_py3.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Operation definition. + + :param name: Operation name. + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.policyinsights.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operations_list_results.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operations_list_results.py new file mode 100644 index 000000000000..69e4222179da --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operations_list_results.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationsListResults(Model): + """List of available operations. + + :param odatacount: OData entity count; represents the number of operations + returned. + :type odatacount: int + :param value: List of available operations. + :type value: list[~azure.mgmt.policyinsights.models.Operation] + """ + + _validation = { + 'odatacount': {'minimum': 1}, + } + + _attribute_map = { + 'odatacount': {'key': '@odata\\.count', 'type': 'int'}, + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__(self, **kwargs): + super(OperationsListResults, self).__init__(**kwargs) + self.odatacount = kwargs.get('odatacount', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operations_list_results_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operations_list_results_py3.py new file mode 100644 index 000000000000..794009aa62e4 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/operations_list_results_py3.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationsListResults(Model): + """List of available operations. + + :param odatacount: OData entity count; represents the number of operations + returned. + :type odatacount: int + :param value: List of available operations. + :type value: list[~azure.mgmt.policyinsights.models.Operation] + """ + + _validation = { + 'odatacount': {'minimum': 1}, + } + + _attribute_map = { + 'odatacount': {'key': '@odata\\.count', 'type': 'int'}, + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__(self, *, odatacount: int=None, value=None, **kwargs) -> None: + super(OperationsListResults, self).__init__(**kwargs) + self.odatacount = odatacount + self.value = value diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_assignment_summary.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_assignment_summary.py new file mode 100644 index 000000000000..33988b36213c --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_assignment_summary.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyAssignmentSummary(Model): + """Policy assignment summary. + + :param policy_assignment_id: Policy assignment ID. + :type policy_assignment_id: str + :param policy_set_definition_id: Policy set definition ID, if the policy + assignment is for a policy set. + :type policy_set_definition_id: str + :param results: Non-compliance summary for the policy assignment. + :type results: ~azure.mgmt.policyinsights.models.SummaryResults + :param policy_definitions: Policy definitions summary. + :type policy_definitions: + list[~azure.mgmt.policyinsights.models.PolicyDefinitionSummary] + """ + + _attribute_map = { + 'policy_assignment_id': {'key': 'policyAssignmentId', 'type': 'str'}, + 'policy_set_definition_id': {'key': 'policySetDefinitionId', 'type': 'str'}, + 'results': {'key': 'results', 'type': 'SummaryResults'}, + 'policy_definitions': {'key': 'policyDefinitions', 'type': '[PolicyDefinitionSummary]'}, + } + + def __init__(self, **kwargs): + super(PolicyAssignmentSummary, self).__init__(**kwargs) + self.policy_assignment_id = kwargs.get('policy_assignment_id', None) + self.policy_set_definition_id = kwargs.get('policy_set_definition_id', None) + self.results = kwargs.get('results', None) + self.policy_definitions = kwargs.get('policy_definitions', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_assignment_summary_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_assignment_summary_py3.py new file mode 100644 index 000000000000..7a1eec689ae3 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_assignment_summary_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyAssignmentSummary(Model): + """Policy assignment summary. + + :param policy_assignment_id: Policy assignment ID. + :type policy_assignment_id: str + :param policy_set_definition_id: Policy set definition ID, if the policy + assignment is for a policy set. + :type policy_set_definition_id: str + :param results: Non-compliance summary for the policy assignment. + :type results: ~azure.mgmt.policyinsights.models.SummaryResults + :param policy_definitions: Policy definitions summary. + :type policy_definitions: + list[~azure.mgmt.policyinsights.models.PolicyDefinitionSummary] + """ + + _attribute_map = { + 'policy_assignment_id': {'key': 'policyAssignmentId', 'type': 'str'}, + 'policy_set_definition_id': {'key': 'policySetDefinitionId', 'type': 'str'}, + 'results': {'key': 'results', 'type': 'SummaryResults'}, + 'policy_definitions': {'key': 'policyDefinitions', 'type': '[PolicyDefinitionSummary]'}, + } + + def __init__(self, *, policy_assignment_id: str=None, policy_set_definition_id: str=None, results=None, policy_definitions=None, **kwargs) -> None: + super(PolicyAssignmentSummary, self).__init__(**kwargs) + self.policy_assignment_id = policy_assignment_id + self.policy_set_definition_id = policy_set_definition_id + self.results = results + self.policy_definitions = policy_definitions diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_definition_summary.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_definition_summary.py new file mode 100644 index 000000000000..0edf701bc0a5 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_definition_summary.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyDefinitionSummary(Model): + """Policy definition summary. + + :param policy_definition_id: Policy definition ID. + :type policy_definition_id: str + :param effect: Policy effect, i.e. policy definition action. + :type effect: str + :param results: Non-compliance summary for the policy definition. + :type results: ~azure.mgmt.policyinsights.models.SummaryResults + """ + + _attribute_map = { + 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, + 'effect': {'key': 'effect', 'type': 'str'}, + 'results': {'key': 'results', 'type': 'SummaryResults'}, + } + + def __init__(self, **kwargs): + super(PolicyDefinitionSummary, self).__init__(**kwargs) + self.policy_definition_id = kwargs.get('policy_definition_id', None) + self.effect = kwargs.get('effect', None) + self.results = kwargs.get('results', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_definition_summary_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_definition_summary_py3.py new file mode 100644 index 000000000000..95bf6c67ae5d --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_definition_summary_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyDefinitionSummary(Model): + """Policy definition summary. + + :param policy_definition_id: Policy definition ID. + :type policy_definition_id: str + :param effect: Policy effect, i.e. policy definition action. + :type effect: str + :param results: Non-compliance summary for the policy definition. + :type results: ~azure.mgmt.policyinsights.models.SummaryResults + """ + + _attribute_map = { + 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, + 'effect': {'key': 'effect', 'type': 'str'}, + 'results': {'key': 'results', 'type': 'SummaryResults'}, + } + + def __init__(self, *, policy_definition_id: str=None, effect: str=None, results=None, **kwargs) -> None: + super(PolicyDefinitionSummary, self).__init__(**kwargs) + self.policy_definition_id = policy_definition_id + self.effect = effect + self.results = results diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_event.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_event.py new file mode 100644 index 000000000000..eac7944437cc --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_event.py @@ -0,0 +1,159 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyEvent(Model): + """Policy event record. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param odataid: OData entity ID; always set to null since policy event + records do not have an entity ID. + :type odataid: str + :param odatacontext: OData context string; used by OData clients to + resolve type information based on metadata. + :type odatacontext: str + :param timestamp: Timestamp for the policy event record. + :type timestamp: datetime + :param resource_id: Resource ID. + :type resource_id: str + :param policy_assignment_id: Policy assignment ID. + :type policy_assignment_id: str + :param policy_definition_id: Policy definition ID. + :type policy_definition_id: str + :param effective_parameters: Effective parameters for the policy + assignment. + :type effective_parameters: str + :param is_compliant: Flag which states whether the resource is compliant + against the policy assignment it was evaluated against. + :type is_compliant: bool + :param subscription_id: Subscription ID. + :type subscription_id: str + :param resource_type: Resource type. + :type resource_type: str + :param resource_location: Resource location. + :type resource_location: str + :param resource_group: Resource group name. + :type resource_group: str + :param resource_tags: List of resource tags. + :type resource_tags: str + :param policy_assignment_name: Policy assignment name. + :type policy_assignment_name: str + :param policy_assignment_owner: Policy assignment owner. + :type policy_assignment_owner: str + :param policy_assignment_parameters: Policy assignment parameters. + :type policy_assignment_parameters: str + :param policy_assignment_scope: Policy assignment scope. + :type policy_assignment_scope: str + :param policy_definition_name: Policy definition name. + :type policy_definition_name: str + :param policy_definition_action: Policy definition action, i.e. effect. + :type policy_definition_action: str + :param policy_definition_category: Policy definition category. + :type policy_definition_category: str + :param policy_set_definition_id: Policy set definition ID, if the policy + assignment is for a policy set. + :type policy_set_definition_id: str + :param policy_set_definition_name: Policy set definition name, if the + policy assignment is for a policy set. + :type policy_set_definition_name: str + :param policy_set_definition_owner: Policy set definition owner, if the + policy assignment is for a policy set. + :type policy_set_definition_owner: str + :param policy_set_definition_category: Policy set definition category, if + the policy assignment is for a policy set. + :type policy_set_definition_category: str + :param policy_set_definition_parameters: Policy set definition parameters, + if the policy assignment is for a policy set. + :type policy_set_definition_parameters: str + :param management_group_ids: Comma seperated list of management group IDs, + which represent the hierarchy of the management groups the resource is + under. + :type management_group_ids: str + :param policy_definition_reference_id: Reference ID for the policy + definition inside the policy set, if the policy assignment is for a policy + set. + :type policy_definition_reference_id: str + :param tenant_id: Tenant ID for the policy event record. + :type tenant_id: str + :param principal_oid: Principal object ID for the user who initiated the + resource operation that triggered the policy event. + :type principal_oid: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'odataid': {'key': '@odata\\.id', 'type': 'str'}, + 'odatacontext': {'key': '@odata\\.context', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'policy_assignment_id': {'key': 'policyAssignmentId', 'type': 'str'}, + 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, + 'effective_parameters': {'key': 'effectiveParameters', 'type': 'str'}, + 'is_compliant': {'key': 'isCompliant', 'type': 'bool'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'resource_tags': {'key': 'resourceTags', 'type': 'str'}, + 'policy_assignment_name': {'key': 'policyAssignmentName', 'type': 'str'}, + 'policy_assignment_owner': {'key': 'policyAssignmentOwner', 'type': 'str'}, + 'policy_assignment_parameters': {'key': 'policyAssignmentParameters', 'type': 'str'}, + 'policy_assignment_scope': {'key': 'policyAssignmentScope', 'type': 'str'}, + 'policy_definition_name': {'key': 'policyDefinitionName', 'type': 'str'}, + 'policy_definition_action': {'key': 'policyDefinitionAction', 'type': 'str'}, + 'policy_definition_category': {'key': 'policyDefinitionCategory', 'type': 'str'}, + 'policy_set_definition_id': {'key': 'policySetDefinitionId', 'type': 'str'}, + 'policy_set_definition_name': {'key': 'policySetDefinitionName', 'type': 'str'}, + 'policy_set_definition_owner': {'key': 'policySetDefinitionOwner', 'type': 'str'}, + 'policy_set_definition_category': {'key': 'policySetDefinitionCategory', 'type': 'str'}, + 'policy_set_definition_parameters': {'key': 'policySetDefinitionParameters', 'type': 'str'}, + 'management_group_ids': {'key': 'managementGroupIds', 'type': 'str'}, + 'policy_definition_reference_id': {'key': 'policyDefinitionReferenceId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'principal_oid': {'key': 'principalOid', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PolicyEvent, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.odataid = kwargs.get('odataid', None) + self.odatacontext = kwargs.get('odatacontext', None) + self.timestamp = kwargs.get('timestamp', None) + self.resource_id = kwargs.get('resource_id', None) + self.policy_assignment_id = kwargs.get('policy_assignment_id', None) + self.policy_definition_id = kwargs.get('policy_definition_id', None) + self.effective_parameters = kwargs.get('effective_parameters', None) + self.is_compliant = kwargs.get('is_compliant', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_location = kwargs.get('resource_location', None) + self.resource_group = kwargs.get('resource_group', None) + self.resource_tags = kwargs.get('resource_tags', None) + self.policy_assignment_name = kwargs.get('policy_assignment_name', None) + self.policy_assignment_owner = kwargs.get('policy_assignment_owner', None) + self.policy_assignment_parameters = kwargs.get('policy_assignment_parameters', None) + self.policy_assignment_scope = kwargs.get('policy_assignment_scope', None) + self.policy_definition_name = kwargs.get('policy_definition_name', None) + self.policy_definition_action = kwargs.get('policy_definition_action', None) + self.policy_definition_category = kwargs.get('policy_definition_category', None) + self.policy_set_definition_id = kwargs.get('policy_set_definition_id', None) + self.policy_set_definition_name = kwargs.get('policy_set_definition_name', None) + self.policy_set_definition_owner = kwargs.get('policy_set_definition_owner', None) + self.policy_set_definition_category = kwargs.get('policy_set_definition_category', None) + self.policy_set_definition_parameters = kwargs.get('policy_set_definition_parameters', None) + self.management_group_ids = kwargs.get('management_group_ids', None) + self.policy_definition_reference_id = kwargs.get('policy_definition_reference_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.principal_oid = kwargs.get('principal_oid', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_event_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_event_py3.py new file mode 100644 index 000000000000..41638d99fb4b --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_event_py3.py @@ -0,0 +1,159 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyEvent(Model): + """Policy event record. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param odataid: OData entity ID; always set to null since policy event + records do not have an entity ID. + :type odataid: str + :param odatacontext: OData context string; used by OData clients to + resolve type information based on metadata. + :type odatacontext: str + :param timestamp: Timestamp for the policy event record. + :type timestamp: datetime + :param resource_id: Resource ID. + :type resource_id: str + :param policy_assignment_id: Policy assignment ID. + :type policy_assignment_id: str + :param policy_definition_id: Policy definition ID. + :type policy_definition_id: str + :param effective_parameters: Effective parameters for the policy + assignment. + :type effective_parameters: str + :param is_compliant: Flag which states whether the resource is compliant + against the policy assignment it was evaluated against. + :type is_compliant: bool + :param subscription_id: Subscription ID. + :type subscription_id: str + :param resource_type: Resource type. + :type resource_type: str + :param resource_location: Resource location. + :type resource_location: str + :param resource_group: Resource group name. + :type resource_group: str + :param resource_tags: List of resource tags. + :type resource_tags: str + :param policy_assignment_name: Policy assignment name. + :type policy_assignment_name: str + :param policy_assignment_owner: Policy assignment owner. + :type policy_assignment_owner: str + :param policy_assignment_parameters: Policy assignment parameters. + :type policy_assignment_parameters: str + :param policy_assignment_scope: Policy assignment scope. + :type policy_assignment_scope: str + :param policy_definition_name: Policy definition name. + :type policy_definition_name: str + :param policy_definition_action: Policy definition action, i.e. effect. + :type policy_definition_action: str + :param policy_definition_category: Policy definition category. + :type policy_definition_category: str + :param policy_set_definition_id: Policy set definition ID, if the policy + assignment is for a policy set. + :type policy_set_definition_id: str + :param policy_set_definition_name: Policy set definition name, if the + policy assignment is for a policy set. + :type policy_set_definition_name: str + :param policy_set_definition_owner: Policy set definition owner, if the + policy assignment is for a policy set. + :type policy_set_definition_owner: str + :param policy_set_definition_category: Policy set definition category, if + the policy assignment is for a policy set. + :type policy_set_definition_category: str + :param policy_set_definition_parameters: Policy set definition parameters, + if the policy assignment is for a policy set. + :type policy_set_definition_parameters: str + :param management_group_ids: Comma seperated list of management group IDs, + which represent the hierarchy of the management groups the resource is + under. + :type management_group_ids: str + :param policy_definition_reference_id: Reference ID for the policy + definition inside the policy set, if the policy assignment is for a policy + set. + :type policy_definition_reference_id: str + :param tenant_id: Tenant ID for the policy event record. + :type tenant_id: str + :param principal_oid: Principal object ID for the user who initiated the + resource operation that triggered the policy event. + :type principal_oid: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'odataid': {'key': '@odata\\.id', 'type': 'str'}, + 'odatacontext': {'key': '@odata\\.context', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'policy_assignment_id': {'key': 'policyAssignmentId', 'type': 'str'}, + 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, + 'effective_parameters': {'key': 'effectiveParameters', 'type': 'str'}, + 'is_compliant': {'key': 'isCompliant', 'type': 'bool'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'resource_tags': {'key': 'resourceTags', 'type': 'str'}, + 'policy_assignment_name': {'key': 'policyAssignmentName', 'type': 'str'}, + 'policy_assignment_owner': {'key': 'policyAssignmentOwner', 'type': 'str'}, + 'policy_assignment_parameters': {'key': 'policyAssignmentParameters', 'type': 'str'}, + 'policy_assignment_scope': {'key': 'policyAssignmentScope', 'type': 'str'}, + 'policy_definition_name': {'key': 'policyDefinitionName', 'type': 'str'}, + 'policy_definition_action': {'key': 'policyDefinitionAction', 'type': 'str'}, + 'policy_definition_category': {'key': 'policyDefinitionCategory', 'type': 'str'}, + 'policy_set_definition_id': {'key': 'policySetDefinitionId', 'type': 'str'}, + 'policy_set_definition_name': {'key': 'policySetDefinitionName', 'type': 'str'}, + 'policy_set_definition_owner': {'key': 'policySetDefinitionOwner', 'type': 'str'}, + 'policy_set_definition_category': {'key': 'policySetDefinitionCategory', 'type': 'str'}, + 'policy_set_definition_parameters': {'key': 'policySetDefinitionParameters', 'type': 'str'}, + 'management_group_ids': {'key': 'managementGroupIds', 'type': 'str'}, + 'policy_definition_reference_id': {'key': 'policyDefinitionReferenceId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'principal_oid': {'key': 'principalOid', 'type': 'str'}, + } + + def __init__(self, *, additional_properties=None, odataid: str=None, odatacontext: str=None, timestamp=None, resource_id: str=None, policy_assignment_id: str=None, policy_definition_id: str=None, effective_parameters: str=None, is_compliant: bool=None, subscription_id: str=None, resource_type: str=None, resource_location: str=None, resource_group: str=None, resource_tags: str=None, policy_assignment_name: str=None, policy_assignment_owner: str=None, policy_assignment_parameters: str=None, policy_assignment_scope: str=None, policy_definition_name: str=None, policy_definition_action: str=None, policy_definition_category: str=None, policy_set_definition_id: str=None, policy_set_definition_name: str=None, policy_set_definition_owner: str=None, policy_set_definition_category: str=None, policy_set_definition_parameters: str=None, management_group_ids: str=None, policy_definition_reference_id: str=None, tenant_id: str=None, principal_oid: str=None, **kwargs) -> None: + super(PolicyEvent, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.odataid = odataid + self.odatacontext = odatacontext + self.timestamp = timestamp + self.resource_id = resource_id + self.policy_assignment_id = policy_assignment_id + self.policy_definition_id = policy_definition_id + self.effective_parameters = effective_parameters + self.is_compliant = is_compliant + self.subscription_id = subscription_id + self.resource_type = resource_type + self.resource_location = resource_location + self.resource_group = resource_group + self.resource_tags = resource_tags + self.policy_assignment_name = policy_assignment_name + self.policy_assignment_owner = policy_assignment_owner + self.policy_assignment_parameters = policy_assignment_parameters + self.policy_assignment_scope = policy_assignment_scope + self.policy_definition_name = policy_definition_name + self.policy_definition_action = policy_definition_action + self.policy_definition_category = policy_definition_category + self.policy_set_definition_id = policy_set_definition_id + self.policy_set_definition_name = policy_set_definition_name + self.policy_set_definition_owner = policy_set_definition_owner + self.policy_set_definition_category = policy_set_definition_category + self.policy_set_definition_parameters = policy_set_definition_parameters + self.management_group_ids = management_group_ids + self.policy_definition_reference_id = policy_definition_reference_id + self.tenant_id = tenant_id + self.principal_oid = principal_oid diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_events_query_results.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_events_query_results.py new file mode 100644 index 000000000000..ef3a73ebac0f --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_events_query_results.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyEventsQueryResults(Model): + """Query results. + + :param odatacontext: OData context string; used by OData clients to + resolve type information based on metadata. + :type odatacontext: str + :param odatacount: OData entity count; represents the number of policy + event records returned. + :type odatacount: int + :param value: Query results. + :type value: list[~azure.mgmt.policyinsights.models.PolicyEvent] + """ + + _validation = { + 'odatacount': {'minimum': 0}, + } + + _attribute_map = { + 'odatacontext': {'key': '@odata\\.context', 'type': 'str'}, + 'odatacount': {'key': '@odata\\.count', 'type': 'int'}, + 'value': {'key': 'value', 'type': '[PolicyEvent]'}, + } + + def __init__(self, **kwargs): + super(PolicyEventsQueryResults, self).__init__(**kwargs) + self.odatacontext = kwargs.get('odatacontext', None) + self.odatacount = kwargs.get('odatacount', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_events_query_results_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_events_query_results_py3.py new file mode 100644 index 000000000000..e1876afab02a --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_events_query_results_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyEventsQueryResults(Model): + """Query results. + + :param odatacontext: OData context string; used by OData clients to + resolve type information based on metadata. + :type odatacontext: str + :param odatacount: OData entity count; represents the number of policy + event records returned. + :type odatacount: int + :param value: Query results. + :type value: list[~azure.mgmt.policyinsights.models.PolicyEvent] + """ + + _validation = { + 'odatacount': {'minimum': 0}, + } + + _attribute_map = { + 'odatacontext': {'key': '@odata\\.context', 'type': 'str'}, + 'odatacount': {'key': '@odata\\.count', 'type': 'int'}, + 'value': {'key': 'value', 'type': '[PolicyEvent]'}, + } + + def __init__(self, *, odatacontext: str=None, odatacount: int=None, value=None, **kwargs) -> None: + super(PolicyEventsQueryResults, self).__init__(**kwargs) + self.odatacontext = odatacontext + self.odatacount = odatacount + self.value = value diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_insights_client_enums.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_insights_client_enums.py new file mode 100644 index 000000000000..98a1f368192d --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_insights_client_enums.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class PolicyStatesResource(str, Enum): + + default = "default" + latest = "latest" diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_state.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_state.py new file mode 100644 index 000000000000..9f85ee45e1b9 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_state.py @@ -0,0 +1,150 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyState(Model): + """Policy state record. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param odataid: OData entity ID; always set to null since policy state + records do not have an entity ID. + :type odataid: str + :param odatacontext: OData context string; used by OData clients to + resolve type information based on metadata. + :type odatacontext: str + :param timestamp: Timestamp for the policy state record. + :type timestamp: datetime + :param resource_id: Resource ID. + :type resource_id: str + :param policy_assignment_id: Policy assignment ID. + :type policy_assignment_id: str + :param policy_definition_id: Policy definition ID. + :type policy_definition_id: str + :param effective_parameters: Effective parameters for the policy + assignment. + :type effective_parameters: str + :param is_compliant: Flag which states whether the resource is compliant + against the policy assignment it was evaluated against. + :type is_compliant: bool + :param subscription_id: Subscription ID. + :type subscription_id: str + :param resource_type: Resource type. + :type resource_type: str + :param resource_location: Resource location. + :type resource_location: str + :param resource_group: Resource group name. + :type resource_group: str + :param resource_tags: List of resource tags. + :type resource_tags: str + :param policy_assignment_name: Policy assignment name. + :type policy_assignment_name: str + :param policy_assignment_owner: Policy assignment owner. + :type policy_assignment_owner: str + :param policy_assignment_parameters: Policy assignment parameters. + :type policy_assignment_parameters: str + :param policy_assignment_scope: Policy assignment scope. + :type policy_assignment_scope: str + :param policy_definition_name: Policy definition name. + :type policy_definition_name: str + :param policy_definition_action: Policy definition action, i.e. effect. + :type policy_definition_action: str + :param policy_definition_category: Policy definition category. + :type policy_definition_category: str + :param policy_set_definition_id: Policy set definition ID, if the policy + assignment is for a policy set. + :type policy_set_definition_id: str + :param policy_set_definition_name: Policy set definition name, if the + policy assignment is for a policy set. + :type policy_set_definition_name: str + :param policy_set_definition_owner: Policy set definition owner, if the + policy assignment is for a policy set. + :type policy_set_definition_owner: str + :param policy_set_definition_category: Policy set definition category, if + the policy assignment is for a policy set. + :type policy_set_definition_category: str + :param policy_set_definition_parameters: Policy set definition parameters, + if the policy assignment is for a policy set. + :type policy_set_definition_parameters: str + :param management_group_ids: Comma seperated list of management group IDs, + which represent the hierarchy of the management groups the resource is + under. + :type management_group_ids: str + :param policy_definition_reference_id: Reference ID for the policy + definition inside the policy set, if the policy assignment is for a policy + set. + :type policy_definition_reference_id: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'odataid': {'key': '@odata\\.id', 'type': 'str'}, + 'odatacontext': {'key': '@odata\\.context', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'policy_assignment_id': {'key': 'policyAssignmentId', 'type': 'str'}, + 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, + 'effective_parameters': {'key': 'effectiveParameters', 'type': 'str'}, + 'is_compliant': {'key': 'isCompliant', 'type': 'bool'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'resource_tags': {'key': 'resourceTags', 'type': 'str'}, + 'policy_assignment_name': {'key': 'policyAssignmentName', 'type': 'str'}, + 'policy_assignment_owner': {'key': 'policyAssignmentOwner', 'type': 'str'}, + 'policy_assignment_parameters': {'key': 'policyAssignmentParameters', 'type': 'str'}, + 'policy_assignment_scope': {'key': 'policyAssignmentScope', 'type': 'str'}, + 'policy_definition_name': {'key': 'policyDefinitionName', 'type': 'str'}, + 'policy_definition_action': {'key': 'policyDefinitionAction', 'type': 'str'}, + 'policy_definition_category': {'key': 'policyDefinitionCategory', 'type': 'str'}, + 'policy_set_definition_id': {'key': 'policySetDefinitionId', 'type': 'str'}, + 'policy_set_definition_name': {'key': 'policySetDefinitionName', 'type': 'str'}, + 'policy_set_definition_owner': {'key': 'policySetDefinitionOwner', 'type': 'str'}, + 'policy_set_definition_category': {'key': 'policySetDefinitionCategory', 'type': 'str'}, + 'policy_set_definition_parameters': {'key': 'policySetDefinitionParameters', 'type': 'str'}, + 'management_group_ids': {'key': 'managementGroupIds', 'type': 'str'}, + 'policy_definition_reference_id': {'key': 'policyDefinitionReferenceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PolicyState, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.odataid = kwargs.get('odataid', None) + self.odatacontext = kwargs.get('odatacontext', None) + self.timestamp = kwargs.get('timestamp', None) + self.resource_id = kwargs.get('resource_id', None) + self.policy_assignment_id = kwargs.get('policy_assignment_id', None) + self.policy_definition_id = kwargs.get('policy_definition_id', None) + self.effective_parameters = kwargs.get('effective_parameters', None) + self.is_compliant = kwargs.get('is_compliant', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_location = kwargs.get('resource_location', None) + self.resource_group = kwargs.get('resource_group', None) + self.resource_tags = kwargs.get('resource_tags', None) + self.policy_assignment_name = kwargs.get('policy_assignment_name', None) + self.policy_assignment_owner = kwargs.get('policy_assignment_owner', None) + self.policy_assignment_parameters = kwargs.get('policy_assignment_parameters', None) + self.policy_assignment_scope = kwargs.get('policy_assignment_scope', None) + self.policy_definition_name = kwargs.get('policy_definition_name', None) + self.policy_definition_action = kwargs.get('policy_definition_action', None) + self.policy_definition_category = kwargs.get('policy_definition_category', None) + self.policy_set_definition_id = kwargs.get('policy_set_definition_id', None) + self.policy_set_definition_name = kwargs.get('policy_set_definition_name', None) + self.policy_set_definition_owner = kwargs.get('policy_set_definition_owner', None) + self.policy_set_definition_category = kwargs.get('policy_set_definition_category', None) + self.policy_set_definition_parameters = kwargs.get('policy_set_definition_parameters', None) + self.management_group_ids = kwargs.get('management_group_ids', None) + self.policy_definition_reference_id = kwargs.get('policy_definition_reference_id', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_state_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_state_py3.py new file mode 100644 index 000000000000..766127a8abcc --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_state_py3.py @@ -0,0 +1,150 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyState(Model): + """Policy state record. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param odataid: OData entity ID; always set to null since policy state + records do not have an entity ID. + :type odataid: str + :param odatacontext: OData context string; used by OData clients to + resolve type information based on metadata. + :type odatacontext: str + :param timestamp: Timestamp for the policy state record. + :type timestamp: datetime + :param resource_id: Resource ID. + :type resource_id: str + :param policy_assignment_id: Policy assignment ID. + :type policy_assignment_id: str + :param policy_definition_id: Policy definition ID. + :type policy_definition_id: str + :param effective_parameters: Effective parameters for the policy + assignment. + :type effective_parameters: str + :param is_compliant: Flag which states whether the resource is compliant + against the policy assignment it was evaluated against. + :type is_compliant: bool + :param subscription_id: Subscription ID. + :type subscription_id: str + :param resource_type: Resource type. + :type resource_type: str + :param resource_location: Resource location. + :type resource_location: str + :param resource_group: Resource group name. + :type resource_group: str + :param resource_tags: List of resource tags. + :type resource_tags: str + :param policy_assignment_name: Policy assignment name. + :type policy_assignment_name: str + :param policy_assignment_owner: Policy assignment owner. + :type policy_assignment_owner: str + :param policy_assignment_parameters: Policy assignment parameters. + :type policy_assignment_parameters: str + :param policy_assignment_scope: Policy assignment scope. + :type policy_assignment_scope: str + :param policy_definition_name: Policy definition name. + :type policy_definition_name: str + :param policy_definition_action: Policy definition action, i.e. effect. + :type policy_definition_action: str + :param policy_definition_category: Policy definition category. + :type policy_definition_category: str + :param policy_set_definition_id: Policy set definition ID, if the policy + assignment is for a policy set. + :type policy_set_definition_id: str + :param policy_set_definition_name: Policy set definition name, if the + policy assignment is for a policy set. + :type policy_set_definition_name: str + :param policy_set_definition_owner: Policy set definition owner, if the + policy assignment is for a policy set. + :type policy_set_definition_owner: str + :param policy_set_definition_category: Policy set definition category, if + the policy assignment is for a policy set. + :type policy_set_definition_category: str + :param policy_set_definition_parameters: Policy set definition parameters, + if the policy assignment is for a policy set. + :type policy_set_definition_parameters: str + :param management_group_ids: Comma seperated list of management group IDs, + which represent the hierarchy of the management groups the resource is + under. + :type management_group_ids: str + :param policy_definition_reference_id: Reference ID for the policy + definition inside the policy set, if the policy assignment is for a policy + set. + :type policy_definition_reference_id: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'odataid': {'key': '@odata\\.id', 'type': 'str'}, + 'odatacontext': {'key': '@odata\\.context', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'policy_assignment_id': {'key': 'policyAssignmentId', 'type': 'str'}, + 'policy_definition_id': {'key': 'policyDefinitionId', 'type': 'str'}, + 'effective_parameters': {'key': 'effectiveParameters', 'type': 'str'}, + 'is_compliant': {'key': 'isCompliant', 'type': 'bool'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'resource_tags': {'key': 'resourceTags', 'type': 'str'}, + 'policy_assignment_name': {'key': 'policyAssignmentName', 'type': 'str'}, + 'policy_assignment_owner': {'key': 'policyAssignmentOwner', 'type': 'str'}, + 'policy_assignment_parameters': {'key': 'policyAssignmentParameters', 'type': 'str'}, + 'policy_assignment_scope': {'key': 'policyAssignmentScope', 'type': 'str'}, + 'policy_definition_name': {'key': 'policyDefinitionName', 'type': 'str'}, + 'policy_definition_action': {'key': 'policyDefinitionAction', 'type': 'str'}, + 'policy_definition_category': {'key': 'policyDefinitionCategory', 'type': 'str'}, + 'policy_set_definition_id': {'key': 'policySetDefinitionId', 'type': 'str'}, + 'policy_set_definition_name': {'key': 'policySetDefinitionName', 'type': 'str'}, + 'policy_set_definition_owner': {'key': 'policySetDefinitionOwner', 'type': 'str'}, + 'policy_set_definition_category': {'key': 'policySetDefinitionCategory', 'type': 'str'}, + 'policy_set_definition_parameters': {'key': 'policySetDefinitionParameters', 'type': 'str'}, + 'management_group_ids': {'key': 'managementGroupIds', 'type': 'str'}, + 'policy_definition_reference_id': {'key': 'policyDefinitionReferenceId', 'type': 'str'}, + } + + def __init__(self, *, additional_properties=None, odataid: str=None, odatacontext: str=None, timestamp=None, resource_id: str=None, policy_assignment_id: str=None, policy_definition_id: str=None, effective_parameters: str=None, is_compliant: bool=None, subscription_id: str=None, resource_type: str=None, resource_location: str=None, resource_group: str=None, resource_tags: str=None, policy_assignment_name: str=None, policy_assignment_owner: str=None, policy_assignment_parameters: str=None, policy_assignment_scope: str=None, policy_definition_name: str=None, policy_definition_action: str=None, policy_definition_category: str=None, policy_set_definition_id: str=None, policy_set_definition_name: str=None, policy_set_definition_owner: str=None, policy_set_definition_category: str=None, policy_set_definition_parameters: str=None, management_group_ids: str=None, policy_definition_reference_id: str=None, **kwargs) -> None: + super(PolicyState, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.odataid = odataid + self.odatacontext = odatacontext + self.timestamp = timestamp + self.resource_id = resource_id + self.policy_assignment_id = policy_assignment_id + self.policy_definition_id = policy_definition_id + self.effective_parameters = effective_parameters + self.is_compliant = is_compliant + self.subscription_id = subscription_id + self.resource_type = resource_type + self.resource_location = resource_location + self.resource_group = resource_group + self.resource_tags = resource_tags + self.policy_assignment_name = policy_assignment_name + self.policy_assignment_owner = policy_assignment_owner + self.policy_assignment_parameters = policy_assignment_parameters + self.policy_assignment_scope = policy_assignment_scope + self.policy_definition_name = policy_definition_name + self.policy_definition_action = policy_definition_action + self.policy_definition_category = policy_definition_category + self.policy_set_definition_id = policy_set_definition_id + self.policy_set_definition_name = policy_set_definition_name + self.policy_set_definition_owner = policy_set_definition_owner + self.policy_set_definition_category = policy_set_definition_category + self.policy_set_definition_parameters = policy_set_definition_parameters + self.management_group_ids = management_group_ids + self.policy_definition_reference_id = policy_definition_reference_id diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_states_query_results.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_states_query_results.py new file mode 100644 index 000000000000..d4e45f98a688 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_states_query_results.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyStatesQueryResults(Model): + """Query results. + + :param odatacontext: OData context string; used by OData clients to + resolve type information based on metadata. + :type odatacontext: str + :param odatacount: OData entity count; represents the number of policy + state records returned. + :type odatacount: int + :param value: Query results. + :type value: list[~azure.mgmt.policyinsights.models.PolicyState] + """ + + _validation = { + 'odatacount': {'minimum': 0}, + } + + _attribute_map = { + 'odatacontext': {'key': '@odata\\.context', 'type': 'str'}, + 'odatacount': {'key': '@odata\\.count', 'type': 'int'}, + 'value': {'key': 'value', 'type': '[PolicyState]'}, + } + + def __init__(self, **kwargs): + super(PolicyStatesQueryResults, self).__init__(**kwargs) + self.odatacontext = kwargs.get('odatacontext', None) + self.odatacount = kwargs.get('odatacount', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_states_query_results_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_states_query_results_py3.py new file mode 100644 index 000000000000..29cd60ec18d2 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/policy_states_query_results_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PolicyStatesQueryResults(Model): + """Query results. + + :param odatacontext: OData context string; used by OData clients to + resolve type information based on metadata. + :type odatacontext: str + :param odatacount: OData entity count; represents the number of policy + state records returned. + :type odatacount: int + :param value: Query results. + :type value: list[~azure.mgmt.policyinsights.models.PolicyState] + """ + + _validation = { + 'odatacount': {'minimum': 0}, + } + + _attribute_map = { + 'odatacontext': {'key': '@odata\\.context', 'type': 'str'}, + 'odatacount': {'key': '@odata\\.count', 'type': 'int'}, + 'value': {'key': 'value', 'type': '[PolicyState]'}, + } + + def __init__(self, *, odatacontext: str=None, odatacount: int=None, value=None, **kwargs) -> None: + super(PolicyStatesQueryResults, self).__init__(**kwargs) + self.odatacontext = odatacontext + self.odatacount = odatacount + self.value = value diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_failure.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_failure.py new file mode 100644 index 000000000000..de37462dd02e --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_failure.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class QueryFailure(Model): + """Error response. + + :param error: Error definition. + :type error: ~azure.mgmt.policyinsights.models.QueryFailureError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'QueryFailureError'}, + } + + def __init__(self, **kwargs): + super(QueryFailure, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class QueryFailureException(HttpOperationError): + """Server responsed with exception of type: 'QueryFailure'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(QueryFailureException, self).__init__(deserialize, response, 'QueryFailure', *args) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_failure_error.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_failure_error.py new file mode 100644 index 000000000000..6fea350785bf --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_failure_error.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryFailureError(Model): + """Error definition. + + :param code: Service specific error code which serves as the substatus for + the HTTP error code. + :type code: str + :param message: Description of the error. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QueryFailureError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_failure_error_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_failure_error_py3.py new file mode 100644 index 000000000000..40d0b77dc4c9 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_failure_error_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryFailureError(Model): + """Error definition. + + :param code: Service specific error code which serves as the substatus for + the HTTP error code. + :type code: str + :param message: Description of the error. + :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(QueryFailureError, self).__init__(**kwargs) + self.code = code + self.message = message diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_failure_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_failure_py3.py new file mode 100644 index 000000000000..9b2d224bed03 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_failure_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class QueryFailure(Model): + """Error response. + + :param error: Error definition. + :type error: ~azure.mgmt.policyinsights.models.QueryFailureError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'QueryFailureError'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(QueryFailure, self).__init__(**kwargs) + self.error = error + + +class QueryFailureException(HttpOperationError): + """Server responsed with exception of type: 'QueryFailure'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(QueryFailureException, self).__init__(deserialize, response, 'QueryFailure', *args) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_options.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_options.py new file mode 100644 index 000000000000..6e245f40e72b --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_options.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryOptions(Model): + """Additional parameters for a set of operations. + + :param top: Maximum number of records to return. + :type top: int + :param order_by: Ordering expression using OData notation. One or more + comma-separated column names with an optional "desc" (the default) or + "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". + :type order_by: str + :param select: Select expression using OData notation. Limits the columns + on each record to just those requested, e.g. "$select=PolicyAssignmentId, + ResourceId". + :type select: str + :param from_property: ISO 8601 formatted timestamp specifying the start + time of the interval to query. When not specified, the service uses ($to - + 1-day). + :type from_property: datetime + :param to: ISO 8601 formatted timestamp specifying the end time of the + interval to query. When not specified, the service uses request time. + :type to: datetime + :param filter: OData filter expression. + :type filter: str + :param apply: OData apply expression for aggregations. + :type apply: str + """ + + _attribute_map = { + 'top': {'key': '', 'type': 'int'}, + 'order_by': {'key': '', 'type': 'str'}, + 'select': {'key': '', 'type': 'str'}, + 'from_property': {'key': '', 'type': 'iso-8601'}, + 'to': {'key': '', 'type': 'iso-8601'}, + 'filter': {'key': '', 'type': 'str'}, + 'apply': {'key': '', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QueryOptions, self).__init__(**kwargs) + self.top = kwargs.get('top', None) + self.order_by = kwargs.get('order_by', None) + self.select = kwargs.get('select', None) + self.from_property = kwargs.get('from_property', None) + self.to = kwargs.get('to', None) + self.filter = kwargs.get('filter', None) + self.apply = kwargs.get('apply', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_options_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_options_py3.py new file mode 100644 index 000000000000..fde9a44d983e --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/query_options_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryOptions(Model): + """Additional parameters for a set of operations. + + :param top: Maximum number of records to return. + :type top: int + :param order_by: Ordering expression using OData notation. One or more + comma-separated column names with an optional "desc" (the default) or + "asc", e.g. "$orderby=PolicyAssignmentId, ResourceId asc". + :type order_by: str + :param select: Select expression using OData notation. Limits the columns + on each record to just those requested, e.g. "$select=PolicyAssignmentId, + ResourceId". + :type select: str + :param from_property: ISO 8601 formatted timestamp specifying the start + time of the interval to query. When not specified, the service uses ($to - + 1-day). + :type from_property: datetime + :param to: ISO 8601 formatted timestamp specifying the end time of the + interval to query. When not specified, the service uses request time. + :type to: datetime + :param filter: OData filter expression. + :type filter: str + :param apply: OData apply expression for aggregations. + :type apply: str + """ + + _attribute_map = { + 'top': {'key': '', 'type': 'int'}, + 'order_by': {'key': '', 'type': 'str'}, + 'select': {'key': '', 'type': 'str'}, + 'from_property': {'key': '', 'type': 'iso-8601'}, + 'to': {'key': '', 'type': 'iso-8601'}, + 'filter': {'key': '', 'type': 'str'}, + 'apply': {'key': '', 'type': 'str'}, + } + + def __init__(self, *, top: int=None, order_by: str=None, select: str=None, from_property=None, to=None, filter: str=None, apply: str=None, **kwargs) -> None: + super(QueryOptions, self).__init__(**kwargs) + self.top = top + self.order_by = order_by + self.select = select + self.from_property = from_property + self.to = to + self.filter = filter + self.apply = apply diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summarize_results.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summarize_results.py new file mode 100644 index 000000000000..60c4d510c6b4 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summarize_results.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SummarizeResults(Model): + """Summarize action results. + + :param odatacontext: OData context string; used by OData clients to + resolve type information based on metadata. + :type odatacontext: str + :param odatacount: OData entity count; represents the number of summaries + returned; always set to 1. + :type odatacount: int + :param value: Summarize action results. + :type value: list[~azure.mgmt.policyinsights.models.Summary] + """ + + _validation = { + 'odatacount': {'maximum': 1, 'minimum': 1}, + } + + _attribute_map = { + 'odatacontext': {'key': '@odata\\.context', 'type': 'str'}, + 'odatacount': {'key': '@odata\\.count', 'type': 'int'}, + 'value': {'key': 'value', 'type': '[Summary]'}, + } + + def __init__(self, **kwargs): + super(SummarizeResults, self).__init__(**kwargs) + self.odatacontext = kwargs.get('odatacontext', None) + self.odatacount = kwargs.get('odatacount', None) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summarize_results_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summarize_results_py3.py new file mode 100644 index 000000000000..40345a92bfb7 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summarize_results_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SummarizeResults(Model): + """Summarize action results. + + :param odatacontext: OData context string; used by OData clients to + resolve type information based on metadata. + :type odatacontext: str + :param odatacount: OData entity count; represents the number of summaries + returned; always set to 1. + :type odatacount: int + :param value: Summarize action results. + :type value: list[~azure.mgmt.policyinsights.models.Summary] + """ + + _validation = { + 'odatacount': {'maximum': 1, 'minimum': 1}, + } + + _attribute_map = { + 'odatacontext': {'key': '@odata\\.context', 'type': 'str'}, + 'odatacount': {'key': '@odata\\.count', 'type': 'int'}, + 'value': {'key': 'value', 'type': '[Summary]'}, + } + + def __init__(self, *, odatacontext: str=None, odatacount: int=None, value=None, **kwargs) -> None: + super(SummarizeResults, self).__init__(**kwargs) + self.odatacontext = odatacontext + self.odatacount = odatacount + self.value = value diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summary.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summary.py new file mode 100644 index 000000000000..75aee548d8e0 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summary.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Summary(Model): + """Summary results. + + :param odataid: OData entity ID; always set to null since summaries do not + have an entity ID. + :type odataid: str + :param odatacontext: OData context string; used by OData clients to + resolve type information based on metadata. + :type odatacontext: str + :param results: Non-compliance summary for all policy assignments. + :type results: ~azure.mgmt.policyinsights.models.SummaryResults + :param policy_assignments: Policy assignments summary. + :type policy_assignments: + list[~azure.mgmt.policyinsights.models.PolicyAssignmentSummary] + """ + + _attribute_map = { + 'odataid': {'key': '@odata\\.id', 'type': 'str'}, + 'odatacontext': {'key': '@odata\\.context', 'type': 'str'}, + 'results': {'key': 'results', 'type': 'SummaryResults'}, + 'policy_assignments': {'key': 'policyAssignments', 'type': '[PolicyAssignmentSummary]'}, + } + + def __init__(self, **kwargs): + super(Summary, self).__init__(**kwargs) + self.odataid = kwargs.get('odataid', None) + self.odatacontext = kwargs.get('odatacontext', None) + self.results = kwargs.get('results', None) + self.policy_assignments = kwargs.get('policy_assignments', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summary_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summary_py3.py new file mode 100644 index 000000000000..9ede585c9116 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summary_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Summary(Model): + """Summary results. + + :param odataid: OData entity ID; always set to null since summaries do not + have an entity ID. + :type odataid: str + :param odatacontext: OData context string; used by OData clients to + resolve type information based on metadata. + :type odatacontext: str + :param results: Non-compliance summary for all policy assignments. + :type results: ~azure.mgmt.policyinsights.models.SummaryResults + :param policy_assignments: Policy assignments summary. + :type policy_assignments: + list[~azure.mgmt.policyinsights.models.PolicyAssignmentSummary] + """ + + _attribute_map = { + 'odataid': {'key': '@odata\\.id', 'type': 'str'}, + 'odatacontext': {'key': '@odata\\.context', 'type': 'str'}, + 'results': {'key': 'results', 'type': 'SummaryResults'}, + 'policy_assignments': {'key': 'policyAssignments', 'type': '[PolicyAssignmentSummary]'}, + } + + def __init__(self, *, odataid: str=None, odatacontext: str=None, results=None, policy_assignments=None, **kwargs) -> None: + super(Summary, self).__init__(**kwargs) + self.odataid = odataid + self.odatacontext = odatacontext + self.results = results + self.policy_assignments = policy_assignments diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summary_results.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summary_results.py new file mode 100644 index 000000000000..eedc207cfe04 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summary_results.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SummaryResults(Model): + """Non-compliance summary on a particular summary level. + + :param query_results_uri: HTTP POST URI for queryResults action on + Microsoft.PolicyInsights to retrieve raw results for the non-compliance + summary. + :type query_results_uri: str + :param non_compliant_resources: Number of non-compliant resources. + :type non_compliant_resources: int + :param non_compliant_policies: Number of non-compliant policies. + :type non_compliant_policies: int + """ + + _validation = { + 'non_compliant_resources': {'minimum': 0}, + 'non_compliant_policies': {'minimum': 0}, + } + + _attribute_map = { + 'query_results_uri': {'key': 'queryResultsUri', 'type': 'str'}, + 'non_compliant_resources': {'key': 'nonCompliantResources', 'type': 'int'}, + 'non_compliant_policies': {'key': 'nonCompliantPolicies', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(SummaryResults, self).__init__(**kwargs) + self.query_results_uri = kwargs.get('query_results_uri', None) + self.non_compliant_resources = kwargs.get('non_compliant_resources', None) + self.non_compliant_policies = kwargs.get('non_compliant_policies', None) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summary_results_py3.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summary_results_py3.py new file mode 100644 index 000000000000..a5bf422386e6 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/models/summary_results_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SummaryResults(Model): + """Non-compliance summary on a particular summary level. + + :param query_results_uri: HTTP POST URI for queryResults action on + Microsoft.PolicyInsights to retrieve raw results for the non-compliance + summary. + :type query_results_uri: str + :param non_compliant_resources: Number of non-compliant resources. + :type non_compliant_resources: int + :param non_compliant_policies: Number of non-compliant policies. + :type non_compliant_policies: int + """ + + _validation = { + 'non_compliant_resources': {'minimum': 0}, + 'non_compliant_policies': {'minimum': 0}, + } + + _attribute_map = { + 'query_results_uri': {'key': 'queryResultsUri', 'type': 'str'}, + 'non_compliant_resources': {'key': 'nonCompliantResources', 'type': 'int'}, + 'non_compliant_policies': {'key': 'nonCompliantPolicies', 'type': 'int'}, + } + + def __init__(self, *, query_results_uri: str=None, non_compliant_resources: int=None, non_compliant_policies: int=None, **kwargs) -> None: + super(SummaryResults, self).__init__(**kwargs) + self.query_results_uri = query_results_uri + self.non_compliant_resources = non_compliant_resources + self.non_compliant_policies = non_compliant_policies diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/__init__.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/__init__.py new file mode 100644 index 000000000000..12605ac45d0f --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/__init__.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .policy_events_operations import PolicyEventsOperations +from .policy_states_operations import PolicyStatesOperations +from .operations import Operations + +__all__ = [ + 'PolicyEventsOperations', + 'PolicyStatesOperations', + 'Operations', +] diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/operations.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/operations.py new file mode 100644 index 000000000000..ba9734dd8e60 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/operations.py @@ -0,0 +1,88 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version to use with the client requests. Constant value: "2017-12-12-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-12-12-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists available operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationsListResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.OperationsListResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationsListResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.PolicyInsights/operations'} diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/policy_events_operations.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/policy_events_operations.py new file mode 100644 index 000000000000..990382d3e2ca --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/policy_events_operations.py @@ -0,0 +1,892 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PolicyEventsOperations(object): + """PolicyEventsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar policy_events_resource: The name of the virtual resource under PolicyEvents resource type; only "default" is allowed. Constant value: "default". + :ivar management_groups_namespace: The namespace for Microsoft Management RP; only "Microsoft.Management" is allowed. Constant value: "Microsoft.Management". + :ivar api_version: API version to use with the client requests. Constant value: "2017-12-12-preview". + :ivar authorization_namespace: The namespace for Microsoft Authorization resource provider; only "Microsoft.Authorization" is allowed. Constant value: "Microsoft.Authorization". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.policy_events_resource = "default" + self.management_groups_namespace = "Microsoft.Management" + self.api_version = "2017-12-12-preview" + self.authorization_namespace = "Microsoft.Authorization" + + self.config = config + + def list_query_results_for_management_group( + self, management_group_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy events for the resources under the management group. + + :param management_group_name: Management group name. + :type management_group_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyEventsQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyEventsQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_management_group.metadata['url'] + path_format_arguments = { + 'policyEventsResource': self._serialize.url("self.policy_events_resource", self.policy_events_resource, 'str'), + 'managementGroupsNamespace': self._serialize.url("self.management_groups_namespace", self.management_groups_namespace, 'str'), + 'managementGroupName': self._serialize.url("management_group_name", management_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyEventsQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_management_group.metadata = {'url': '/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} + + def list_query_results_for_subscription( + self, subscription_id, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy events for the resources under the subscription. + + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyEventsQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyEventsQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_subscription.metadata['url'] + path_format_arguments = { + 'policyEventsResource': self._serialize.url("self.policy_events_resource", self.policy_events_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", 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') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyEventsQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} + + def list_query_results_for_resource_group( + self, subscription_id, resource_group_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy events for the resources under the resource group. + + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param resource_group_name: Resource group name. + :type resource_group_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyEventsQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyEventsQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_resource_group.metadata['url'] + path_format_arguments = { + 'policyEventsResource': self._serialize.url("self.policy_events_resource", self.policy_events_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyEventsQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} + + def list_query_results_for_resource( + self, resource_id, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy events for the resource. + + :param resource_id: Resource ID. + :type resource_id: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyEventsQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyEventsQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_resource.metadata['url'] + path_format_arguments = { + 'policyEventsResource': self._serialize.url("self.policy_events_resource", self.policy_events_resource, 'str'), + 'resourceId': self._serialize.url("resource_id", resource_id, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyEventsQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_resource.metadata = {'url': '/{resourceId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} + + def list_query_results_for_policy_set_definition( + self, subscription_id, policy_set_definition_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy events for the subscription level policy set definition. + + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param policy_set_definition_name: Policy set definition name. + :type policy_set_definition_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyEventsQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyEventsQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_policy_set_definition.metadata['url'] + path_format_arguments = { + 'policyEventsResource': self._serialize.url("self.policy_events_resource", self.policy_events_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'authorizationNamespace': self._serialize.url("self.authorization_namespace", self.authorization_namespace, 'str'), + 'policySetDefinitionName': self._serialize.url("policy_set_definition_name", policy_set_definition_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyEventsQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_policy_set_definition.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} + + def list_query_results_for_policy_definition( + self, subscription_id, policy_definition_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy events for the subscription level policy definition. + + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param policy_definition_name: Policy definition name. + :type policy_definition_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyEventsQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyEventsQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_policy_definition.metadata['url'] + path_format_arguments = { + 'policyEventsResource': self._serialize.url("self.policy_events_resource", self.policy_events_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'authorizationNamespace': self._serialize.url("self.authorization_namespace", self.authorization_namespace, 'str'), + 'policyDefinitionName': self._serialize.url("policy_definition_name", policy_definition_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyEventsQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_policy_definition.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} + + def list_query_results_for_subscription_level_policy_assignment( + self, subscription_id, policy_assignment_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy events for the subscription level policy assignment. + + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param policy_assignment_name: Policy assignment name. + :type policy_assignment_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyEventsQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyEventsQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_subscription_level_policy_assignment.metadata['url'] + path_format_arguments = { + 'policyEventsResource': self._serialize.url("self.policy_events_resource", self.policy_events_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'authorizationNamespace': self._serialize.url("self.authorization_namespace", self.authorization_namespace, 'str'), + 'policyAssignmentName': self._serialize.url("policy_assignment_name", policy_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyEventsQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_subscription_level_policy_assignment.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} + + def list_query_results_for_resource_group_level_policy_assignment( + self, subscription_id, resource_group_name, policy_assignment_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy events for the resource group level policy assignment. + + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param resource_group_name: Resource group name. + :type resource_group_name: str + :param policy_assignment_name: Policy assignment name. + :type policy_assignment_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyEventsQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyEventsQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_resource_group_level_policy_assignment.metadata['url'] + path_format_arguments = { + 'policyEventsResource': self._serialize.url("self.policy_events_resource", self.policy_events_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'authorizationNamespace': self._serialize.url("self.authorization_namespace", self.authorization_namespace, 'str'), + 'policyAssignmentName': self._serialize.url("policy_assignment_name", policy_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyEventsQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_resource_group_level_policy_assignment.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} + + def get_metadata( + self, scope, custom_headers=None, raw=False, **operation_config): + """Gets OData metadata XML document. + + :param scope: A valid scope, i.e. management group, subscription, + resource group, or resource ID. Scope used has no effect on metadata + returned. + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + # Construct URL + url = self.get_metadata.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_metadata.metadata = {'url': '/{scope}/providers/Microsoft.PolicyInsights/policyEvents/$metadata'} diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/policy_states_operations.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/policy_states_operations.py new file mode 100644 index 000000000000..61671e39fdfd --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/policy_states_operations.py @@ -0,0 +1,1613 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PolicyStatesOperations(object): + """PolicyStatesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar management_groups_namespace: The namespace for Microsoft Management RP; only "Microsoft.Management" is allowed. Constant value: "Microsoft.Management". + :ivar api_version: API version to use with the client requests. Constant value: "2017-12-12-preview". + :ivar policy_states_summary_resource: The virtual resource under PolicyStates resource type for summarize action. In a given time range, 'latest' represents the latest policy state(s) and is the only allowed value. Constant value: "latest". + :ivar authorization_namespace: The namespace for Microsoft Authorization resource provider; only "Microsoft.Authorization" is allowed. Constant value: "Microsoft.Authorization". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.management_groups_namespace = "Microsoft.Management" + self.api_version = "2017-12-12-preview" + self.policy_states_summary_resource = "latest" + self.authorization_namespace = "Microsoft.Authorization" + + self.config = config + + def list_query_results_for_management_group( + self, policy_states_resource, management_group_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy states for the resources under the management group. + + :param policy_states_resource: The virtual resource under PolicyStates + resource type. In a given time range, 'latest' represents the latest + policy state(s), whereas 'default' represents all policy state(s). + Possible values include: 'default', 'latest' + :type policy_states_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param management_group_name: Management group name. + :type management_group_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyStatesQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyStatesQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_management_group.metadata['url'] + path_format_arguments = { + 'policyStatesResource': self._serialize.url("policy_states_resource", policy_states_resource, 'str'), + 'managementGroupsNamespace': self._serialize.url("self.management_groups_namespace", self.management_groups_namespace, 'str'), + 'managementGroupName': self._serialize.url("management_group_name", management_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyStatesQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_management_group.metadata = {'url': '/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults'} + + def summarize_for_management_group( + self, management_group_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Summarizes policy states for the resources under the management group. + + :param management_group_name: Management group name. + :type management_group_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SummarizeResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + + # Construct URL + url = self.summarize_for_management_group.metadata['url'] + path_format_arguments = { + 'policyStatesSummaryResource': self._serialize.url("self.policy_states_summary_resource", self.policy_states_summary_resource, 'str'), + 'managementGroupsNamespace': self._serialize.url("self.management_groups_namespace", self.management_groups_namespace, 'str'), + 'managementGroupName': self._serialize.url("management_group_name", management_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SummarizeResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + summarize_for_management_group.metadata = {'url': '/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize'} + + def list_query_results_for_subscription( + self, policy_states_resource, subscription_id, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy states for the resources under the subscription. + + :param policy_states_resource: The virtual resource under PolicyStates + resource type. In a given time range, 'latest' represents the latest + policy state(s), whereas 'default' represents all policy state(s). + Possible values include: 'default', 'latest' + :type policy_states_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyStatesQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyStatesQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_subscription.metadata['url'] + path_format_arguments = { + 'policyStatesResource': self._serialize.url("policy_states_resource", policy_states_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", 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') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyStatesQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults'} + + def summarize_for_subscription( + self, subscription_id, query_options=None, custom_headers=None, raw=False, **operation_config): + """Summarizes policy states for the resources under the subscription. + + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SummarizeResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + + # Construct URL + url = self.summarize_for_subscription.metadata['url'] + path_format_arguments = { + 'policyStatesSummaryResource': self._serialize.url("self.policy_states_summary_resource", self.policy_states_summary_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", 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') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SummarizeResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + summarize_for_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize'} + + def list_query_results_for_resource_group( + self, policy_states_resource, subscription_id, resource_group_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy states for the resources under the resource group. + + :param policy_states_resource: The virtual resource under PolicyStates + resource type. In a given time range, 'latest' represents the latest + policy state(s), whereas 'default' represents all policy state(s). + Possible values include: 'default', 'latest' + :type policy_states_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param resource_group_name: Resource group name. + :type resource_group_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyStatesQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyStatesQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_resource_group.metadata['url'] + path_format_arguments = { + 'policyStatesResource': self._serialize.url("policy_states_resource", policy_states_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyStatesQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults'} + + def summarize_for_resource_group( + self, subscription_id, resource_group_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Summarizes policy states for the resources under the resource group. + + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param resource_group_name: Resource group name. + :type resource_group_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SummarizeResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + + # Construct URL + url = self.summarize_for_resource_group.metadata['url'] + path_format_arguments = { + 'policyStatesSummaryResource': self._serialize.url("self.policy_states_summary_resource", self.policy_states_summary_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SummarizeResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + summarize_for_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize'} + + def list_query_results_for_resource( + self, policy_states_resource, resource_id, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy states for the resource. + + :param policy_states_resource: The virtual resource under PolicyStates + resource type. In a given time range, 'latest' represents the latest + policy state(s), whereas 'default' represents all policy state(s). + Possible values include: 'default', 'latest' + :type policy_states_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param resource_id: Resource ID. + :type resource_id: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyStatesQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyStatesQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_resource.metadata['url'] + path_format_arguments = { + 'policyStatesResource': self._serialize.url("policy_states_resource", policy_states_resource, 'str'), + 'resourceId': self._serialize.url("resource_id", resource_id, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyStatesQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_resource.metadata = {'url': '/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults'} + + def summarize_for_resource( + self, resource_id, query_options=None, custom_headers=None, raw=False, **operation_config): + """Summarizes policy states for the resource. + + :param resource_id: Resource ID. + :type resource_id: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SummarizeResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + + # Construct URL + url = self.summarize_for_resource.metadata['url'] + path_format_arguments = { + 'policyStatesSummaryResource': self._serialize.url("self.policy_states_summary_resource", self.policy_states_summary_resource, 'str'), + 'resourceId': self._serialize.url("resource_id", resource_id, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SummarizeResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + summarize_for_resource.metadata = {'url': '/{resourceId}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize'} + + def list_query_results_for_policy_set_definition( + self, policy_states_resource, subscription_id, policy_set_definition_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy states for the subscription level policy set definition. + + :param policy_states_resource: The virtual resource under PolicyStates + resource type. In a given time range, 'latest' represents the latest + policy state(s), whereas 'default' represents all policy state(s). + Possible values include: 'default', 'latest' + :type policy_states_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param policy_set_definition_name: Policy set definition name. + :type policy_set_definition_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyStatesQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyStatesQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_policy_set_definition.metadata['url'] + path_format_arguments = { + 'policyStatesResource': self._serialize.url("policy_states_resource", policy_states_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'authorizationNamespace': self._serialize.url("self.authorization_namespace", self.authorization_namespace, 'str'), + 'policySetDefinitionName': self._serialize.url("policy_set_definition_name", policy_set_definition_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyStatesQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_policy_set_definition.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults'} + + def summarize_for_policy_set_definition( + self, subscription_id, policy_set_definition_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Summarizes policy states for the subscription level policy set + definition. + + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param policy_set_definition_name: Policy set definition name. + :type policy_set_definition_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SummarizeResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + + # Construct URL + url = self.summarize_for_policy_set_definition.metadata['url'] + path_format_arguments = { + 'policyStatesSummaryResource': self._serialize.url("self.policy_states_summary_resource", self.policy_states_summary_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'authorizationNamespace': self._serialize.url("self.authorization_namespace", self.authorization_namespace, 'str'), + 'policySetDefinitionName': self._serialize.url("policy_set_definition_name", policy_set_definition_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SummarizeResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + summarize_for_policy_set_definition.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize'} + + def list_query_results_for_policy_definition( + self, policy_states_resource, subscription_id, policy_definition_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy states for the subscription level policy definition. + + :param policy_states_resource: The virtual resource under PolicyStates + resource type. In a given time range, 'latest' represents the latest + policy state(s), whereas 'default' represents all policy state(s). + Possible values include: 'default', 'latest' + :type policy_states_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param policy_definition_name: Policy definition name. + :type policy_definition_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyStatesQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyStatesQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_policy_definition.metadata['url'] + path_format_arguments = { + 'policyStatesResource': self._serialize.url("policy_states_resource", policy_states_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'authorizationNamespace': self._serialize.url("self.authorization_namespace", self.authorization_namespace, 'str'), + 'policyDefinitionName': self._serialize.url("policy_definition_name", policy_definition_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyStatesQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_policy_definition.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults'} + + def summarize_for_policy_definition( + self, subscription_id, policy_definition_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Summarizes policy states for the subscription level policy definition. + + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param policy_definition_name: Policy definition name. + :type policy_definition_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SummarizeResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + + # Construct URL + url = self.summarize_for_policy_definition.metadata['url'] + path_format_arguments = { + 'policyStatesSummaryResource': self._serialize.url("self.policy_states_summary_resource", self.policy_states_summary_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'authorizationNamespace': self._serialize.url("self.authorization_namespace", self.authorization_namespace, 'str'), + 'policyDefinitionName': self._serialize.url("policy_definition_name", policy_definition_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SummarizeResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + summarize_for_policy_definition.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize'} + + def list_query_results_for_subscription_level_policy_assignment( + self, policy_states_resource, subscription_id, policy_assignment_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy states for the subscription level policy assignment. + + :param policy_states_resource: The virtual resource under PolicyStates + resource type. In a given time range, 'latest' represents the latest + policy state(s), whereas 'default' represents all policy state(s). + Possible values include: 'default', 'latest' + :type policy_states_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param policy_assignment_name: Policy assignment name. + :type policy_assignment_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyStatesQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyStatesQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_subscription_level_policy_assignment.metadata['url'] + path_format_arguments = { + 'policyStatesResource': self._serialize.url("policy_states_resource", policy_states_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'authorizationNamespace': self._serialize.url("self.authorization_namespace", self.authorization_namespace, 'str'), + 'policyAssignmentName': self._serialize.url("policy_assignment_name", policy_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyStatesQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_subscription_level_policy_assignment.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults'} + + def summarize_for_subscription_level_policy_assignment( + self, subscription_id, policy_assignment_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Summarizes policy states for the subscription level policy assignment. + + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param policy_assignment_name: Policy assignment name. + :type policy_assignment_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SummarizeResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + + # Construct URL + url = self.summarize_for_subscription_level_policy_assignment.metadata['url'] + path_format_arguments = { + 'policyStatesSummaryResource': self._serialize.url("self.policy_states_summary_resource", self.policy_states_summary_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'authorizationNamespace': self._serialize.url("self.authorization_namespace", self.authorization_namespace, 'str'), + 'policyAssignmentName': self._serialize.url("policy_assignment_name", policy_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SummarizeResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + summarize_for_subscription_level_policy_assignment.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize'} + + def list_query_results_for_resource_group_level_policy_assignment( + self, policy_states_resource, subscription_id, resource_group_name, policy_assignment_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Queries policy states for the resource group level policy assignment. + + :param policy_states_resource: The virtual resource under PolicyStates + resource type. In a given time range, 'latest' represents the latest + policy state(s), whereas 'default' represents all policy state(s). + Possible values include: 'default', 'latest' + :type policy_states_resource: str or + ~azure.mgmt.policyinsights.models.PolicyStatesResource + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param resource_group_name: Resource group name. + :type resource_group_name: str + :param policy_assignment_name: Policy assignment name. + :type policy_assignment_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PolicyStatesQueryResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.PolicyStatesQueryResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + order_by = None + if query_options is not None: + order_by = query_options.order_by + select = None + if query_options is not None: + select = query_options.select + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + apply = None + if query_options is not None: + apply = query_options.apply + + # Construct URL + url = self.list_query_results_for_resource_group_level_policy_assignment.metadata['url'] + path_format_arguments = { + 'policyStatesResource': self._serialize.url("policy_states_resource", policy_states_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'authorizationNamespace': self._serialize.url("self.authorization_namespace", self.authorization_namespace, 'str'), + 'policyAssignmentName': self._serialize.url("policy_assignment_name", policy_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if order_by is not None: + query_parameters['$orderby'] = self._serialize.query("order_by", order_by, 'str') + if select is not None: + query_parameters['$select'] = self._serialize.query("select", select, 'str') + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if apply is not None: + query_parameters['$apply'] = self._serialize.query("apply", apply, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PolicyStatesQueryResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_query_results_for_resource_group_level_policy_assignment.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesResource}/queryResults'} + + def summarize_for_resource_group_level_policy_assignment( + self, subscription_id, resource_group_name, policy_assignment_name, query_options=None, custom_headers=None, raw=False, **operation_config): + """Summarizes policy states for the resource group level policy + assignment. + + :param subscription_id: Microsoft Azure subscription ID. + :type subscription_id: str + :param resource_group_name: Resource group name. + :type resource_group_name: str + :param policy_assignment_name: Policy assignment name. + :type policy_assignment_name: str + :param query_options: Additional parameters for the operation + :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SummarizeResults or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.policyinsights.models.SummarizeResults or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + top = None + if query_options is not None: + top = query_options.top + from_parameter = None + if query_options is not None: + from_parameter = query_options.from_property + to = None + if query_options is not None: + to = query_options.to + filter = None + if query_options is not None: + filter = query_options.filter + + # Construct URL + url = self.summarize_for_resource_group_level_policy_assignment.metadata['url'] + path_format_arguments = { + 'policyStatesSummaryResource': self._serialize.url("self.policy_states_summary_resource", self.policy_states_summary_resource, 'str'), + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'authorizationNamespace': self._serialize.url("self.authorization_namespace", self.authorization_namespace, 'str'), + 'policyAssignmentName': self._serialize.url("policy_assignment_name", policy_assignment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=0) + if from_parameter is not None: + query_parameters['$from'] = self._serialize.query("from_parameter", from_parameter, 'iso-8601') + if to is not None: + query_parameters['$to'] = self._serialize.query("to", to, 'iso-8601') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SummarizeResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + summarize_for_resource_group_level_policy_assignment.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyStates/{policyStatesSummaryResource}/summarize'} + + def get_metadata( + self, scope, custom_headers=None, raw=False, **operation_config): + """Gets OData metadata XML document. + + :param scope: A valid scope, i.e. management group, subscription, + resource group, or resource ID. Scope used has no effect on metadata + returned. + :type scope: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: str or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`QueryFailureException` + """ + # Construct URL + url = self.get_metadata.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.QueryFailureException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_metadata.metadata = {'url': '/{scope}/providers/Microsoft.PolicyInsights/policyStates/$metadata'} diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/policy_insights_client.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/policy_insights_client.py new file mode 100644 index 000000000000..79b78a17c5ef --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/policy_insights_client.py @@ -0,0 +1,84 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import ServiceClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.policy_events_operations import PolicyEventsOperations +from .operations.policy_states_operations import PolicyStatesOperations +from .operations.operations import Operations +from . import models + + +class PolicyInsightsClientConfiguration(AzureConfiguration): + """Configuration for PolicyInsightsClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(PolicyInsightsClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-policyinsights/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + + +class PolicyInsightsClient(object): + """PolicyInsightsClient + + :ivar config: Configuration for client. + :vartype config: PolicyInsightsClientConfiguration + + :ivar policy_events: PolicyEvents operations + :vartype policy_events: azure.mgmt.policyinsights.operations.PolicyEventsOperations + :ivar policy_states: PolicyStates operations + :vartype policy_states: azure.mgmt.policyinsights.operations.PolicyStatesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.policyinsights.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + self.config = PolicyInsightsClientConfiguration(credentials, 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)} + self.api_version = '2017-12-12-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.policy_events = PolicyEventsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.policy_states = PolicyStatesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-policyinsights/azure/mgmt/policyinsights/version.py b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/version.py new file mode 100644 index 000000000000..c78d6ddcf530 --- /dev/null +++ b/azure-mgmt-policyinsights/azure/mgmt/policyinsights/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2017-12-12-preview" +